emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Christian Moe <mail@christianmoe.com>
Cc: emacs-orgmode@gnu.org, gerard.vermeulen@posteo.net,
	Timothy <orgmode@tec.tecosaur.net>
Subject: Re: [PATCH] ox-html.el: add option to embed SVG for CSS support in SVG
Date: Wed, 07 Jun 2023 17:57:15 +0000	[thread overview]
Message-ID: <87v8fznojo.fsf@localhost> (raw)
In-Reply-To: <87h6rjqr9y.fsf@christianmoe.com>

Christian Moe <mail@christianmoe.com> writes:

>> Reading the linked threads, it seems that <object> has its own
>> downsides. Why is it strictly better then?
>
> I'm not sure it's strictly better.
>
> The problem in the linked threads was with scaling, and I don't think it
> applies anymore. As I just tested in Firefox, at least, I can control
> the size of Gerard's SVG illustration perfectly well by setting CSS
> height and width attributes on an <object>.

That ship sailed long time ago.
Now, switching back to <object> will be a breaking change that should be
justified. Mind that we use "img" tag for all images, not just svg.

For now, you are just pointing that <object> will inherit CSS of the
page.

But there will be downsides you mentioned, like absence of alt
attribute (which is a big deal - we do not want to compromise
accessibility for blind users - see
https://orgmode.org/list/CAJcAo8uTOpEazLNCr0t1kFqPGTLz=G=aDnKLhuo1-Ura8-m7-Q@mail.gmail.com or
https://list.orgmode.org/orgmode/87czew3w5l.fsf@localhost/ )
Also, https://www.w3schools.com/TAgs/tag_object.asp explicitly
recommends against <object> for images in favor or <img>.

Finally, I can see that there are ways to use CSS on img+svg:
https://blog.union.io/code/2017/08/10/img-svg-fill/

> - For Org to extract and embed the SVG means more things that can break
>   (though I admit that it can be made a lot less fragile than the
>   #+INCLUDE hack) and when they do break, it's an Org problem. With
>   <object> Org just needs to properly format the tags; if it does, the
>   rest is the browser's responsibility.

May you elaborate?

> - If the external SVG file is modified, with embedding all files
>   referencing it need to be exported again for the change to take
>   effect. With <object> linking to the external file, all that is
>   needed is refreshing the browser.

That's why the proposed patch does not turn the embedding on by default.
But some people do want embedding to make html self-contained, if not
for CSS.

Note that I am inclined to accept the patch for reasons different
from the motivation of the patch author. Especially, if the patch gets
extended to allow embedding raster images as well.

> - Readable, uncluttered HTML is nice; huge, unreadable stretches of SVG
>   aren't.

Sure, if users want uncluttered HTML. Some users do. Some wants the
opposite.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2023-06-07 17:53 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05 13:23 [PATCH] ox-html.el: add option to embed SVG for CSS support in SVG gerard.vermeulen
2023-06-06  7:49 ` Ihor Radchenko
2023-06-06  9:57   ` Christian Moe
2023-06-06 13:37     ` gerard.vermeulen
2023-06-06 18:54       ` Christian Moe
2023-06-07  8:43         ` Ihor Radchenko
2023-06-07  8:41     ` Ihor Radchenko
2023-06-07 14:30       ` Christian Moe
2023-06-07 17:57         ` Ihor Radchenko [this message]
2023-06-15 13:09           ` gerard.vermeulen
2023-06-15 14:55             ` Max Nikulin
2023-06-15 20:42               ` Ihor Radchenko
2023-06-15 20:51             ` Ihor Radchenko
2023-06-16 18:39               ` gerard.vermeulen
2023-06-17 12:38                 ` Ihor Radchenko
2023-06-17 14:45                   ` gerard.vermeulen
2023-06-21 15:52               ` Max Nikulin
2023-06-21 16:02                 ` Ihor Radchenko
2023-06-21 16:27                   ` Max Nikulin
2023-06-21 16:38                     ` Ihor Radchenko
2023-06-22 16:25                       ` Max Nikulin
2023-06-23 11:02                         ` Ihor Radchenko
2023-06-06 12:58   ` gerard.vermeulen
2023-06-07  9:07     ` Ihor Radchenko
2023-06-06 14:14 ` Max Nikulin
2023-06-06 16:08   ` gerard.vermeulen
2023-06-07  9:10     ` Ihor Radchenko
2023-06-09 15:27     ` Max Nikulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8fznojo.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=gerard.vermeulen@posteo.net \
    --cc=mail@christianmoe.com \
    --cc=orgmode@tec.tecosaur.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).