You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Most readers probably don't follow the MUST about the requiredExtensions attribute for SVG #1087
It MUST recognize the value "http://www.idpf.org/2007/ops" of the requiredExtensions attribute as representing the occurrence of XHTML Content Document fragments (e.g., when the attribute is included on the foreignObject element or children of the switch element).
Presumably there was a good historical reason for this that's lost on me, but I doubt most EPUB readers do anything with this MUST.
Since OPS is, by definition, supported in EPUB Reading Systems, the requiredExtension attribute on SVG elements with the value http://www.idpf.org/2007/ops must always evaluate to true.
But since we've deprecated out almost all epub-created extensions, I'm not sure if this is still necessary.
@rkwright should know infinitely more about this than me, but I chime in anyway...
If I look at the text purely from standard perspective then something like this URL is needed for the <switch> element to work to signal whether the SVG implementation does implement <foreignObject>. Strangely enough (@rkwright ?) there is no mention in the text on some form of a registry or whatever for what extensions means; I must admit I did not really understood from the SVG text how this thing should work.
In practice, however, it seems that the traditional example of combining switch and foreign object (with HTML) simply works in browser engines (I tried it in Safari, Chrome and Firefox; I do not have Edge on my mac but I would expect that to work, too). In other words, @BCWalters is right in the sense that the attribute is probably simply ignored by implementations, ie, a MUST in our standard sounds indeed superfluous...
I do not know if non-EPUB SVG often uses the svg:switch and svg:foreignObject elements as representing the occurrence of XHTML Content Document fragments. If this is the case, I think that we can lift the requirement that requiredExtensions shall be "http://www.idpf.org/2007/ops".
The goal seems to be to embed XHTML Content Document Fragments. But those exist in the XHTML namespace, not the OPS namespace (mostly). I'm struggling to find a reason we need this.
Ran it on three browsers (Safari, Chromium based Edge, and Firefox) as well as part of an EPUB on Thorium (on my Mac). The behaviour of all four was identical:
as it stands, the foreign object with the required extensions set was not displayed, the second one was as planned
removing the required extensions attribute means both foreign object displays properly.
2 years have passed since since the test of @dauwhe (#1087 (comment)) and we do have interop now on browsers. I could not test it on Apple Books because it does not seem to use a cover page set as an SVG file :-(
As everybody on this thread, it seems, I do not see any reason why this statement is in the spec; it may have a historical reason. With 3.3 on its way, I would think this statement should be deprecated from the spec (and possibly add a note advising not to use this because there may be issues displaying the content).
Activity
mattgarrish commentedon Aug 6, 2018
OPS 2.0.1 has this to say about it:
But since we've deprecated out almost all epub-created extensions, I'm not sure if this is still necessary.
@rkwright @iherman @murata2makoto any thoughts?
iherman commentedon Aug 7, 2018
@rkwright should know infinitely more about this than me, but I chime in anyway...
If I look at the text purely from standard perspective then something like this URL is needed for the
<switch>element to work to signal whether the SVG implementation does implement<foreignObject>. Strangely enough (@rkwright ?) there is no mention in the text on some form of a registry or whatever for what extensions means; I must admit I did not really understood from the SVG text how this thing should work.In practice, however, it seems that the traditional example of combining switch and foreign object (with HTML) simply works in browser engines (I tried it in Safari, Chrome and Firefox; I do not have Edge on my mac but I would expect that to work, too). In other words, @BCWalters is right in the sense that the attribute is probably simply ignored by implementations, ie, a MUST in our standard sounds indeed superfluous...
murata2makoto commentedon Aug 9, 2018
I do not know if non-EPUB SVG often uses the svg:switch and svg:foreignObject elements as representing the occurrence of XHTML Content Document fragments. If this is the case, I think that we can lift the requirement that requiredExtensions shall be "http://www.idpf.org/2007/ops".
dauwhe commentedon Sep 25, 2018
So what happens here? Note that browsers don't have interop on this—Chrome shows "baz" and Firefox/Safari show "bar".
The goal seems to be to embed XHTML Content Document Fragments. But those exist in the XHTML namespace, not the OPS namespace (mostly). I'm struggling to find a reason we need this.
iherman commentedon Oct 29, 2020
I have run into the statement in the spec earlier today.
Here is a test case I have (used as part of a cover image):
Ran it on three browsers (Safari, Chromium based Edge, and Firefox) as well as part of an EPUB on Thorium (on my Mac). The behaviour of all four was identical:
2 years have passed since since the test of @dauwhe (#1087 (comment)) and we do have interop now on browsers. I could not test it on Apple Books because it does not seem to use a cover page set as an SVG file :-(
As everybody on this thread, it seems, I do not see any reason why this statement is in the spec; it may have a historical reason. With 3.3 on its way, I would think this statement should be deprecated from the spec (and possibly add a note advising not to use this because there may be issues displaying the content).
cc @mattgarrish @wareid @shiestyle
dauwhe commentedon Nov 18, 2020
requiredExtensions="http://www.idpf.org/2007/ops".requiredExtensions="http://www.w3.org/1999/xhtml", but Firefox and Safari support it.I think we absolutely need to remove this from the spec.
remove requirement to support SVG requiredExtensions attribute per w3…
Merge pull request #1662 from dauwhe/issue-1087
dauwhe commentedon May 4, 2021
Closed via #1662
feat: do not check conformance of SVG content
feat: do not check conformance of SVG content