Skip to content

Clarify epub:type use with embedded SVG #2555

Closed

Description

@mattgarrish

As reported in w3c/epubcheck#1497 (comment), the specification is not clear that the restriction on where epub:type can be used with svg content documents also applies to embedded svg. The restriction should either be in the referenced restrictions section or there should be a separate section for semantics that embedded svg definition can reference.

Activity

  1. added
    ErratumRaisedRaise an erratum, not yet accepted by the maintainers.
    on Apr 24, 2023
  2. iherman commented on Jul 11, 2023

    @iherman
    Member

    A valid erratum, I believe, and it should be marked as such. Clearly a class 2...

    @shiestyle @TzviyaSiegman @dauwhe @wareid

  3. mattgarrish commented on Jul 11, 2023

    @mattgarrish
    MemberAuthor

    I'm starting to think the embedded SVG definition is muddled in other ways than this issue has gotten into.

    For one, the XHTML content document definition already allows the use of epub:type and the vocabulary association mechanisms. Since embedded SVG are part of the XHTML grammar, wouldn't it be redundant to say that the same is true for them?

    But why are SVG files referenced by img and object even considered embedded? If you use those elements, you're referencing SVG documents (i.e., standalone SVGs in a separate file). That requires them to be valid SVG core media types which in turn means they have to meet the definition of an SVG content document.

    I was going to say this is a class 3 change, since we'd be allowing epub:type and the vocabulary mechanisms where they technically weren't before, but I don't think anything normative needs changing. We probably just need to make clear that embedded SVG refers to the svg element in an XHTML file and that the same content restrictions apply to them.

  4. mattgarrish commented on Jul 11, 2023

    @mattgarrish
    MemberAuthor

    Or if it helps, when you embed an XHTML document via an iframe that document doesn't become exempt from the xhtml content document rules, so there's no reason why referencing SVGs from img or object would require a different definition of SVG.

    The only unique case is when an svg element is directly embedded in the HTML. The restrictions need to be the same as standalone SVGs, but the vocabulary stuff is already handled by the HTML requirements (e.g., the prefix attribute should only be on the root html element, while epub:type is still allowed anywhere).

  5. iherman commented on Jul 11, 2023

    @iherman
    Member

    I'm starting to think the embedded SVG definition is muddled in other ways than this issue has gotten into.
    […]

    But why are SVG files referenced by img and object even considered embedded? If you use those elements, you're referencing SVG documents (i.e., standalone SVGs in a separate file). That requires them to be valid SVG core media types which in turn means they have to meet the definition of an SVG content document.

    To be honest... for me, "embedded" meant the case when the <svg> element is within the HTML markup. In other words, img or object is not really "embedded", at least to me. However... if one looks at the HTML standard, then the <img> element specification is part of a section entitled… "4.8 Embedded content". (The same terminology is used on MDN, b.t.w.)

    I.e., if we want to keep to the official terminology then yes, these are "embedded" content (in spite of my expectations...)

    I was going to say this is a class 3 change, since we'd be allowing epub:type and the vocabulary mechanisms where they technically weren't before, but I don't think anything normative needs changing. We probably just need to make clear that embedded SVG refers to the svg element in an XHTML file and that the same content restrictions apply to them.

    I am fine with the underlying technical intention, but then the word "embedded" should be changed. Not sure whether this becomes an editorial nightmare, though...

  6. mattgarrish commented on Jul 11, 2023

    @mattgarrish
    MemberAuthor

    if one looks at the HTML standard, then the <img> element specification is part of a section entitled… "4.8 Embedded content"

    Right, this is why the section makes the distinction between embedded by reference and by direct inclusion, but then we lump both together and say that the svg content restrictions apply to both without clarifying any of the other details.

    I'd like to see the section changed along these lines:

    XHTML content documents support the embedding of SVG by reference (embedding via reference, for example, from an img or object element) and by inclusion (embedding via direct inclusion of the svg element in the XHTML content document).

    SVGs embedded by reference are SVG core media types so their requirements are already defined in 6.2 SVG content documents.

    SVGs embedded by inclusion MUST meet the content conformance constraints for SVG content documents in 6.2.3 Restrictions on SVG. Although the epub:type attribute is allowed on [HTML] embedded content, its use is restricted in the same way as for SVG content documents.

    NOTE:
    The prefix attribute is only allowed on the root html element for SVG embedded by inclusion.

  7. iherman commented on Jul 12, 2023

    @iherman
    Member

    I think I agree this means class 2 changes.

  8. added
    ErrataItem accepted as an official errata for one or several specs
    and removed
    ErratumRaisedRaise an erratum, not yet accepted by the maintainers.
    on Aug 4, 2023
  9. added
    Type-EditorialThe issue does not affect conformance
    EditorialFor classifying errata only. Use Type-Editorial for issues
    EPUB33Issues fixed in the EPUB 3.3 revision
    and removed
    EditorialFor classifying errata only. Use Type-Editorial for issues
    Type-EditorialThe issue does not affect conformance
    on Aug 9, 2023
  10. added
    Change-Class-3Requested changes are of class 3 (per process)
    and removed
    Change-Class-2Requested changes are of class 2 (per process)
    on Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Change-Class-3Requested changes are of class 3 (per process)EPUB33Issues fixed in the EPUB 3.3 revisionEditorialFor classifying errata only. Use Type-Editorial for issuesErrataItem accepted as an official errata for one or several specsSpec-EPUB3The issue affects the core EPUB 3.X Recommendation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions