From 1c11a56fc072cba7c1251b1e02811d93bb1a3d66 Mon Sep 17 00:00:00 2001 From: "Michael[tm] Smith" Date: Sat, 26 Dec 2015 03:13:43 +0900 Subject: [PATCH] Add the "integrity" attribute Fixes https://github.com/validator/validator/issues/151 --- common.rnc | 4 ++++ core-scripting.rnc | 6 ++++++ meta.rnc | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/common.rnc b/common.rnc index e87d49bd2..b105ad785 100644 --- a/common.rnc +++ b/common.rnc @@ -390,6 +390,10 @@ common.attrs.other = common.data.source.size.list = w:source-size-list +## Subresource Integrity + common.data.integrity = + string + ## Microdata Properties common.data.microdata-properties = list { w:microdata-property+ } diff --git a/core-scripting.rnc b/core-scripting.rnc index ff64969e1..0569d0e58 100644 --- a/core-scripting.rnc +++ b/core-scripting.rnc @@ -15,6 +15,7 @@ datatypes w = "http://whattf.org/datatype-draft" ( common.attrs & script.attrs.type? & script.attrs.language? # restricted in Schematron + & script.attrs.integrity? & embedded.content.attrs.crossorigin? & ( common.attrs.aria.role.presentation | common.attrs.aria.role.menuitem @@ -30,6 +31,7 @@ datatypes w = "http://whattf.org/datatype-draft" & script.attrs.type? & script.attrs.charset? & script.attrs.language? # restricted in Schematron + & script.attrs.integrity? & embedded.content.attrs.crossorigin? & ( common.attrs.aria.role.presentation | common.attrs.aria.role.menuitem @@ -59,6 +61,10 @@ datatypes w = "http://whattf.org/datatype-draft" attribute language { string } + script.attrs.integrity = + attribute integrity { + common.data.integrity + } script.inner.embedded = ( common.inner.anything ) script.inner.imported = diff --git a/meta.rnc b/meta.rnc index 92aaf5e09..bbb67b445 100644 --- a/meta.rnc +++ b/meta.rnc @@ -159,6 +159,7 @@ datatypes w = "http://whattf.org/datatype-draft" & common.attrs.other & link.attrs.href & link.attrs.rel + & link.attrs.integrity? & shared-hyperlink.attrs.hreflang? & shared-hyperlink.attrs.media? & shared-hyperlink.attrs.type? @@ -178,6 +179,10 @@ datatypes w = "http://whattf.org/datatype-draft" attribute rel { w:link-rel } + link.attrs.integrity = + attribute integrity { + common.data.integrity + } link.attrs.sizes = attribute sizes { w:string "any" | common.data.sizes -- 2.39.2