diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-mathml3-inc.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-mathml3-inc.rnc index 018b46df3..87bcd75d4 100644 --- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-mathml3-inc.rnc +++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-mathml3-inc.rnc @@ -3,6 +3,7 @@ namespace local = "" namespace x = "http://www.w3.org/1999/xhtml" namespace ev = "http://www.w3.org/2001/xml-events" namespace ssml = "http://www.w3.org/2001/10/synthesis" +namespace epub = "http://www.idpf.org/2007/ops" # ##################################################################### # @@ -19,7 +20,7 @@ include "mathml/mathml3-inc.rnc" { # extend to circumvent datatype collisions NonMathMLAtt = - attribute * - (local:* | m:* | xml:* | x:* | ev:* | ssml:*) { + attribute * - (local:* | m:* | xml:* | x:* | ev:* | ssml:* | epub:*) { datatype.string } @@ -30,6 +31,8 @@ include "mathml/mathml3-inc.rnc" { annotation-xml = epub.annotation-xml } # Common attribute extensions +# - epub:type +CommonAtt &= epub.type.attr? # - SSML attributes CommonAtt &= epub.ssml.ph.attr? # - xml:base diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-xhtml-integration.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-xhtml-integration.rnc index 3cce84789..f2a328a29 100644 --- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-xhtml-integration.rnc +++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-xhtml-integration.rnc @@ -7,89 +7,141 @@ ## combine `epub:type` - # Allow `epub:type` on the `body` element (even though - # it is not defined as palpable content) - body.attrs &= epub.type.attr? - - # Allow `epub:type` on palpable content + # Allow `epub:type` on all elements except: + # - the `head` element + # - metadata content (base, link, meta, noscript, script, style, template, title) # # Note: # We can't use a common category since none is defined - # for palpable content. So we add it for each element. - # - # Some elements are only considered palpable under some - # conditions; we do not support that at the moment. - # - a.attrs &= epub.type.attr? - abbr.attrs &= epub.type.attr? - address.attrs &= epub.type.attr? - article.attrs &= epub.type.attr? - aside.attrs &= epub.type.attr? - audio.attrs &= epub.type.attr? - b.attrs &= epub.type.attr? - bdi.attrs &= epub.type.attr? - bdo.attrs &= epub.type.attr? - blockquote.attrs &= epub.type.attr? - button.attrs &= epub.type.attr? + # for non-metadata content. So we add it for each element. + + # from applications.rnc + progress.attrs &= epub.type.attr? + dialog.attrs &= epub.type.attr? + menu.attrs &= epub.type.attr? + mli.attrs &= epub.type.attr? canvas.attrs &= epub.type.attr? - cite.attrs &= epub.type.attr? - code.attrs &= epub.type.attr? - data.attrs &= epub.type.attr? details.attrs &= epub.type.attr? - dfn.attrs &= epub.type.attr? - div.attrs &= epub.type.attr? + summary.attrs &= epub.type.attr? + + # from block.rnc + p.attrs &= epub.type.attr? + hr.attrs &= epub.type.attr? + pre.attrs &= epub.type.attr? + ul.attrs &= epub.type.attr? + li.attrs &= epub.type.attr? + ol.attrs &= epub.type.attr? + oli.attrs &= epub.type.attr? dl.attrs &= epub.type.attr? - emembed.attrs &= epub.type.attr? - fieldset.attrs &= epub.type.attr? + dt.attrs &= epub.type.attr? + dd.attrs &= epub.type.attr? + div.attrs &= epub.type.attr? + legend.attrs &= epub.type.attr? + + # from data.rnc + time.attrs &= epub.type.attr? + time.datetime.attrs &= epub.type.attr? + data.attrs &= epub.type.attr? + meter.attrs &= epub.type.attr? + + # from embed.rnc + img.attrs &= epub.type.attr? + picture.attrs &= epub.type.attr? + embed.attrs &= epub.type.attr? + object.attrs &= epub.type.attr? + param.attrs &= epub.type.attr? + iframe.attrs &= epub.type.attr? + map.attrs &= epub.type.attr? + area.attrs &= epub.type.attr? + + # from media.rnc + source.attrs &= epub.type.attr? + video.attrs &= epub.type.attr? + audio.attrs &= epub.type.attr? + track.attrs &= epub.type.attr? figure.attrs &= epub.type.attr? - footer.attrs &= epub.type.attr? - form.attrs &= epub.type.attr? + figcaption.attrs &= epub.type.attr? + + # from meta.rnc + html.attrs &= epub.type.attr? + body.attrs &= epub.type.attr? + + # from phrase.rnc + a.href.attrs &= epub.type.attr? + a.nohref.attrs &= epub.type.attr? + em.attrs &= epub.type.attr? + strong.attrs &= epub.type.attr? + small.attrs &= epub.type.attr? + mark.attrs &= epub.type.attr? + abbr.attrs &= epub.type.attr? + dfn.attrs &= epub.type.attr? + i.attrs &= epub.type.attr? + b.attrs &= epub.type.attr? + s.attrs &= epub.type.attr? + u.attrs &= epub.type.attr? + code.attrs &= epub.type.attr? + var.attrs &= epub.type.attr? + samp.attrs &= epub.type.attr? + kbd.attrs &= epub.type.attr? + sup.attrs &= epub.type.attr? + sub.attrs &= epub.type.attr? + q.attrs &= epub.type.attr? + cite.attrs &= epub.type.attr? + span.attrs &= epub.type.attr? + bdo.attrs &= epub.type.attr? + bdi.attrs &= epub.type.attr? + br.attrs &= epub.type.attr? + wbr.attrs &= epub.type.attr? + + # from revision.rnc + ins.attrs &= epub.type.attr? + del.attrs &= epub.type.attr? + + # from ruby.rnc + ruby.attrs &= epub.type.attr? + rt.attrs &= epub.type.attr? + rp.attrs &= epub.type.attr? + + # from sectional.rnc h1.attrs &= epub.type.attr? h2.attrs &= epub.type.attr? h3.attrs &= epub.type.attr? h4.attrs &= epub.type.attr? h5.attrs &= epub.type.attr? h6.attrs &= epub.type.attr? - header.attrs &= epub.type.attr? hgroup.attrs &= epub.type.attr? - i.attrs &= epub.type.attr? - iframe.attrs &= epub.type.attr? - img.attrs &= epub.type.attr? - input.attrs &= epub.type.attr? - ins.attrs &= epub.type.attr? - kbd.attrs &= epub.type.attr? - label.attrs &= epub.type.attr? - main.attrs &= epub.type.attr? - map.attrs &= epub.type.attr? - mark.attrs &= epub.type.attr? - menu.attrs &= epub.type.attr? - meter.attrs &= epub.type.attr? - nav.attrs &= epub.type.attr? - object.attrs &= epub.type.attr? - ol.attrs &= epub.type.attr? - output.attrs &= epub.type.attr? - p.attrs &= epub.type.attr? - pre.attrs &= epub.type.attr? - progress.attrs &= epub.type.attr? - q.attrs &= epub.type.attr? - ruby.attrs &= epub.type.attr? - s.attrs &= epub.type.attr? - samp.attrs &= epub.type.attr? + address.attrs &= epub.type.attr? + blockquote.attrs &= epub.type.attr? + + # from structural.rnc section.attrs &= epub.type.attr? - select.attrs &= epub.type.attr? - small.attrs &= epub.type.attr? - span.attrs &= epub.type.attr? - strong.attrs &= epub.type.attr? - sub.attrs &= epub.type.attr? - sup.attrs &= epub.type.attr? + nav.attrs &= epub.type.attr? + article.attrs &= epub.type.attr? + aside.attrs &= epub.type.attr? + header.attrs &= epub.type.attr? + footer.attrs &= epub.type.attr? + main.attrs &= epub.type.attr? + + # from tables.rnc table.attrs &= epub.type.attr? - text.attrs &= epub.type.attr? - area.attrs &= epub.type.attr? - time.attrs &= epub.type.attr? - u.attrs &= epub.type.attr? - ul.attrs &= epub.type.attr? - var.attrs &= epub.type.attr? - video.attrs &= epub.type.attr? + caption.attrs &= epub.type.attr? + colgroup.attrs &= epub.type.attr? + thead.attrs &= epub.type.attr? + tfoot.attrs &= epub.type.attr? + tbody.attrs &= epub.type.attr? + tr.attrs &= epub.type.attr? + td.attrs &= epub.type.attr? + th.attrs &= epub.type.attr? + + # from web-forms.rnc and web-forms2.rnc + common-form.attrs &= epub.type.attr? + option.attrs &= epub.type.attr? + optgroup.attrs &= epub.type.attr? + form.attrs &= epub.type.attr? + label.attrs &= epub.type.attr? + output.attrs &= epub.type.attr? + datalist.attrs &= epub.type.attr? + ## combine prefix attributes diff --git a/src/test/resources/epub-region-nav/region-nav-publication.feature b/src/test/resources/epub-region-nav/region-nav-publication.feature index 374049baa..9432cc9d0 100644 --- a/src/test/resources/epub-region-nav/region-nav-publication.feature +++ b/src/test/resources/epub-region-nav/region-nav-publication.feature @@ -91,5 +91,4 @@ Feature: EPUB Region-Based Navigation ▸ Full Publication Checks Scenario: Verify subregion navigation using comics semantics When checking EPUB 'region-based-nav-comics-valid' - Then error RSC-005 is reported 4 times (non-palpable content) Then no errors or warnings are reported diff --git a/src/test/resources/epub3/06-content-document/content-document-xhtml.feature b/src/test/resources/epub3/06-content-document/content-document-xhtml.feature index b88bfca21..70026ee76 100644 --- a/src/test/resources/epub3/06-content-document/content-document-xhtml.feature +++ b/src/test/resources/epub3/06-content-document/content-document-xhtml.feature @@ -645,14 +645,15 @@ Feature: EPUB 3 — Content Documents — XHTML #### 6.1.3.1 Structural semantics - Scenario: Verify `epub:type` attribute with valid semantic + @spec @xref:sec-xhtml-structural-semantics + Scenario: Verify `epub:type` attribute on allowed content When checking document 'epubtype-valid.xhtml' Then no errors or warnings are reported @spec @xref:sec-xhtml-structural-semantics - Scenario: Report `epub:type` attribute on non-palpable content - When checking document 'epubtype-on-non-palpable-content-error.xhtml' - Then error RSC-005 is reported 2 times + Scenario: Report `epub:type` attribute on 'head' or metadata content + When checking document 'epubtype-disallowed-error.xhtml' + Then error RSC-005 is reported 8 times And no other errors or warnings are reported Scenario: Verify `epub:type` attribute with reserved vocabulary @@ -678,8 +679,7 @@ Feature: EPUB 3 — Content Documents — XHTML Scenario: Verify `epub:type` attribute that does not follow usage suggestions Given the reporting level set to usage - When checking document 'epubtype-disallowed-usage.xhtml' - Then error RSC-005 is reported 3 times (non-palpable content) + When checking document 'epubtype-misuse-usage.xhtml' Then usage OPF-087 is reported 7 times And no other errors or warnings are reported diff --git a/src/test/resources/epub3/06-content-document/files/epubtype-disallowed-error.xhtml b/src/test/resources/epub3/06-content-document/files/epubtype-disallowed-error.xhtml new file mode 100644 index 000000000..48fdbba9f --- /dev/null +++ b/src/test/resources/epub3/06-content-document/files/epubtype-disallowed-error.xhtml @@ -0,0 +1,17 @@ + + +
+ +