From e6555ee90e5411bd0bdf19ced51bc3cf1a62ec3d Mon Sep 17 00:00:00 2001 From: Allan Banaag Date: Thu, 9 Jan 2025 11:38:05 -0800 Subject: [PATCH] Validator rollup (#40223) * cl/610820873 Fix validation for unexpected attribute name starting with = * cl/614818595 Fix validation for duplicate attribute names * cl/713373388 Two-way sync for PR #40094. No-op, or fixes merge conflicts, if any. * Update some files that failed validator test * Update some files that failed validator test --- .../duplicate_attribute.out.cpponly | 2 +- validator/testdata/feature_tests/leaks.html | 5 + validator/testdata/feature_tests/leaks.out | 9 +- .../testdata/feature_tests/leaks.out.cpponly | 149 +++++++++--------- 4 files changed, 91 insertions(+), 74 deletions(-) diff --git a/validator/testdata/feature_tests/duplicate_attribute.out.cpponly b/validator/testdata/feature_tests/duplicate_attribute.out.cpponly index 77fb6e2ad6d3..860440c36a11 100644 --- a/validator/testdata/feature_tests/duplicate_attribute.out.cpponly +++ b/validator/testdata/feature_tests/duplicate_attribute.out.cpponly @@ -46,4 +46,4 @@ feature_tests/duplicate_attribute.html:27:3 The tag 'script' contains the attrib feature_tests/duplicate_attribute.html:27:3 The attribute 'type' in tag 'script type=application/ld+json' is set to the invalid value 'text/javascript'. | | -| +| \ No newline at end of file diff --git a/validator/testdata/feature_tests/leaks.html b/validator/testdata/feature_tests/leaks.html index f6253c954e94..099891bf71af 100644 --- a/validator/testdata/feature_tests/leaks.html +++ b/validator/testdata/feature_tests/leaks.html @@ -35,6 +35,11 @@ --> + + + diff --git a/validator/testdata/feature_tests/leaks.out b/validator/testdata/feature_tests/leaks.out index 1821f9f3b2b1..1ad91364da13 100644 --- a/validator/testdata/feature_tests/leaks.out +++ b/validator/testdata/feature_tests/leaks.out @@ -53,6 +53,13 @@ feature_tests/leaks.html:30:4 CSS syntax error in tag 'style amp-custom' - saw i feature_tests/leaks.html:36:0 The attribute 'http-equiv' may not appear in tag 'meta'. | | +| +>> ^~~~~~~~~ +feature_tests/leaks.html:41:0 The attribute 'http-equiv' may not appear in tag 'meta'. +| +| | @@ -364,4 +371,4 @@ feature_tests/leaks.html:203:0 The tag 'vmlframe' is disallowed. | | | -| \ No newline at end of file +| diff --git a/validator/testdata/feature_tests/leaks.out.cpponly b/validator/testdata/feature_tests/leaks.out.cpponly index d85e0b0dd510..1db6fa16c687 100644 --- a/validator/testdata/feature_tests/leaks.out.cpponly +++ b/validator/testdata/feature_tests/leaks.out.cpponly @@ -51,39 +51,44 @@ feature_tests/leaks.html:30:4 CSS syntax error in tag 'style amp-custom' - saw i feature_tests/leaks.html:36:0 The attribute 'http-equiv' may not appear in tag 'meta'. | | +| +| +| | >> ^~~~~~~~~ -feature_tests/leaks.html:41:0 The attribute 'http-equiv' may not appear in tag 'meta'. +feature_tests/leaks.html:46:0 The attribute 'http-equiv' may not appear in tag 'meta'. | >> ^~~~~~~~~ -feature_tests/leaks.html:42:0 The attribute 'http-equiv' may not appear in tag 'meta'. +feature_tests/leaks.html:47:0 The attribute 'http-equiv' may not appear in tag 'meta'. | | | >> ^~~~~~~~~ -feature_tests/leaks.html:47:0 The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value 'https://leaking.via/link-stylesheet'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#custom-fonts) +feature_tests/leaks.html:52:0 The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value 'https://leaking.via/link-stylesheet'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#custom-fonts) | >> ^~~~~~~~~ -feature_tests/leaks.html:48:0 The attribute 'rel' in tag 'link' is set to the invalid value 'alternate stylesheet'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#html-tags) +feature_tests/leaks.html:53:0 The attribute 'rel' in tag 'link' is set to the invalid value 'alternate stylesheet'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#html-tags) | >> ^~~~~~~~~ -feature_tests/leaks.html:49:0 The attribute 'rel' in tag 'link' is set to the invalid value 'import'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#html-tags) +feature_tests/leaks.html:54:0 The attribute 'rel' in tag 'link' is set to the invalid value 'import'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#html-tags) | >> ^~~~~~~~~ -feature_tests/leaks.html:50:0 The attribute 'rel' in tag 'link' is set to the invalid value 'subresource'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#html-tags) +feature_tests/leaks.html:55:0 The attribute 'rel' in tag 'link' is set to the invalid value 'subresource'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#html-tags) | | | >> ^~~~~~~~~ -feature_tests/leaks.html:55:0 Tag or text which is only allowed inside the body section found outside of the body section. +feature_tests/leaks.html:60:0 Tag or text which is only allowed inside the body section found outside of the body section. >> ^~~~~~~~~ -feature_tests/leaks.html:55:0 The tag 'import' is disallowed. +feature_tests/leaks.html:60:0 The tag 'import' is disallowed. | | | @@ -93,11 +98,11 @@ feature_tests/leaks.html:55:0 The tag 'import' is disallowed. | --> | >> ^~~~~~~~~ -feature_tests/leaks.html:63:0 The attribute 'background' may not appear in tag 'table'. +feature_tests/leaks.html:68:0 The attribute 'background' may not appear in tag 'table'. | | >> ^~~~~~~~~ -feature_tests/leaks.html:65:8 The attribute 'background' may not appear in tag 'td'. +feature_tests/leaks.html:70:8 The attribute 'background' may not appear in tag 'td'. | |
| @@ -107,36 +112,36 @@ feature_tests/leaks.html:65:8 The attribute 'background' may not appear in tag ' | | >> ^~~~~~~~~ -feature_tests/leaks.html:73:0 The attribute 'dynsrc' may not appear in tag 'img'. +feature_tests/leaks.html:78:0 The attribute 'dynsrc' may not appear in tag 'img'. | >> ^~~~~~~~~ -feature_tests/leaks.html:74:0 The attribute 'lowsrc' may not appear in tag 'img'. +feature_tests/leaks.html:79:0 The attribute 'lowsrc' may not appear in tag 'img'. | | | | >> ^~~~~~~~~ -feature_tests/leaks.html:78:0 The attribute 'href' may not appear in tag 'img'. +feature_tests/leaks.html:83:0 The attribute 'href' may not appear in tag 'img'. | | >> ^~~~~~~~~ -feature_tests/leaks.html:80:0 The parent tag of tag 'picture' is 'body', but it can only be 'noscript'. (see https://amp.dev/documentation/components/amp-img/) +feature_tests/leaks.html:85:0 The parent tag of tag 'picture' is 'body', but it can only be 'noscript'. (see https://amp.dev/documentation/components/amp-img/) | | | >> ^~~~~~~~~ -feature_tests/leaks.html:83:0 The parent tag of tag 'picture' is 'body', but it can only be 'noscript'. (see https://amp.dev/documentation/components/amp-img/) +feature_tests/leaks.html:88:0 The parent tag of tag 'picture' is 'body', but it can only be 'noscript'. (see https://amp.dev/documentation/components/amp-img/) | | | | | >> ^~~~~~~~~ -feature_tests/leaks.html:88:0 The attribute 'srcset' in tag 'img' is set to the invalid value ',,,,,https://leaking.via/img-srcset'. +feature_tests/leaks.html:93:0 The attribute 'srcset' in tag 'img' is set to the invalid value ',,,,,https://leaking.via/img-srcset'. | | >> ^~~~~~~~~ -feature_tests/leaks.html:90:0 The attribute 'longdesc' may not appear in tag 'img'. +feature_tests/leaks.html:95:0 The attribute 'longdesc' may not appear in tag 'img'. | | | | >> ^~~~~~~~~ -feature_tests/leaks.html:96:0 The tag 'input' may only appear as a descendant of tag 'form [method=post]'. (see https://amp.dev/documentation/components/amp-form/) +feature_tests/leaks.html:101:0 The tag 'input' may only appear as a descendant of tag 'form [method=post]'. (see https://amp.dev/documentation/components/amp-form/) | >> ^~~~~~~~~ -feature_tests/leaks.html:97:0 The tag 'isindex' is disallowed. +feature_tests/leaks.html:102:0 The tag 'isindex' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:98:0 The tag 'isindex' is disallowed. +feature_tests/leaks.html:103:0 The tag 'isindex' is disallowed. |
>> ^~~~~~~~~ -feature_tests/leaks.html:99:0 The mandatory attribute 'action' is missing in tag 'form'. (see https://amp.dev/documentation/components/amp-form) +feature_tests/leaks.html:104:0 The mandatory attribute 'action' is missing in tag 'form'. (see https://amp.dev/documentation/components/amp-form) >> ^~~~~~~~~ -feature_tests/leaks.html:99:0 The mandatory attribute 'target' is missing in tag 'form'. (see https://amp.dev/documentation/components/amp-form) +feature_tests/leaks.html:104:0 The mandatory attribute 'target' is missing in tag 'form'. (see https://amp.dev/documentation/components/amp-form) >> ^~~~~~~~~ -feature_tests/leaks.html:99:0 The tag 'form' requires including the 'amp-form' extension JavaScript. (see https://amp.dev/documentation/components/amp-form) +feature_tests/leaks.html:104:0 The tag 'form' requires including the 'amp-form' extension JavaScript. (see https://amp.dev/documentation/components/amp-form) >> ^~~~~~~~~ -feature_tests/leaks.html:99:24 The tag 'isindex' is disallowed. +feature_tests/leaks.html:104:24 The tag 'isindex' is disallowed. | | | >> ^~~~~~~~~ -feature_tests/leaks.html:104:0 The tag 'bgsound' is disallowed. +feature_tests/leaks.html:109:0 The tag 'bgsound' is disallowed. | | | >> ^~~~~~~~~ -feature_tests/leaks.html:111:0 The tag 'audio' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-audio'? (see https://amp.dev/documentation/components/amp-audio/) +feature_tests/leaks.html:116:0 The tag 'audio' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-audio'? (see https://amp.dev/documentation/components/amp-audio/) | | >> ^~~~~~~~~ -feature_tests/leaks.html:115:0 The tag 'video' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-video'? (see https://amp.dev/documentation/components/amp-video/) +feature_tests/leaks.html:120:0 The tag 'video' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-video'? (see https://amp.dev/documentation/components/amp-video/) | | | >> ^~~~~~~~~ -feature_tests/leaks.html:120:0 The tag 'object' is disallowed. +feature_tests/leaks.html:125:0 The tag 'object' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:121:0 The tag 'object' is disallowed. +feature_tests/leaks.html:126:0 The tag 'object' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:122:0 The tag 'object' is disallowed. +feature_tests/leaks.html:127:0 The tag 'object' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:123:0 The tag 'object' is disallowed. +feature_tests/leaks.html:128:0 The tag 'object' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:124:4 The tag 'param' is disallowed. +feature_tests/leaks.html:129:4 The tag 'param' is disallowed. | | >> ^~~~~~~~~ -feature_tests/leaks.html:126:0 The tag 'object' is disallowed. +feature_tests/leaks.html:131:0 The tag 'object' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:127:0 The tag 'embed' is disallowed. +feature_tests/leaks.html:132:0 The tag 'embed' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:128:0 The tag 'embed' is disallowed. +feature_tests/leaks.html:133:0 The tag 'embed' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:129:0 The tag 'object' is disallowed. +feature_tests/leaks.html:134:0 The tag 'object' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:130:4 The tag 'param' is disallowed. +feature_tests/leaks.html:135:4 The tag 'param' is disallowed. | | >> ^~~~~~~~~ -feature_tests/leaks.html:132:0 The tag 'object' is disallowed. +feature_tests/leaks.html:137:0 The tag 'object' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:133:4 The tag 'param' is disallowed. +feature_tests/leaks.html:138:4 The tag 'param' is disallowed. | | | @@ -238,16 +243,16 @@ feature_tests/leaks.html:133:4 The tag 'param' is disallowed. | --> | >> ^~~~~~~~~ -feature_tests/leaks.html:140:0 The parent tag of tag 'amphtml engine script' is 'isindex', but it can only be 'head'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup) +feature_tests/leaks.html:145:0 The parent tag of tag 'amphtml engine script' is 'isindex', but it can only be 'head'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup) | >> ^~~~~~~~~ -feature_tests/leaks.html:141:5 The parent tag of tag 'amphtml engine script' is 'svg', but it can only be 'head'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup) +feature_tests/leaks.html:146:5 The parent tag of tag 'amphtml engine script' is 'svg', but it can only be 'head'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup) | >> ^~~~~~~~~ -feature_tests/leaks.html:142:5 The parent tag of tag 'amphtml engine script' is 'svg', but it can only be 'head'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup) +feature_tests/leaks.html:147:5 The parent tag of tag 'amphtml engine script' is 'svg', but it can only be 'head'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#required-markup) | | @@ -256,38 +261,38 @@ feature_tests/leaks.html:143:0 The parent tag of tag 'amphtml engine script' is | --> | >> ^~~~~~~~~ -feature_tests/leaks.html:150:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) +feature_tests/leaks.html:155:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) | >> ^~~~~~~~~ -feature_tests/leaks.html:151:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) +feature_tests/leaks.html:156:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) | >> ^~~~~~~~~ -feature_tests/leaks.html:152:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) +feature_tests/leaks.html:157:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) | >> ^~~~~~~~~ -feature_tests/leaks.html:153:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) +feature_tests/leaks.html:158:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) | >> ^~~~~~~~~ -feature_tests/leaks.html:154:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) +feature_tests/leaks.html:159:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) | >> ^~~~~~~~~ -feature_tests/leaks.html:155:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) +feature_tests/leaks.html:160:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) | >> ^~~~~~~~~ -feature_tests/leaks.html:156:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) +feature_tests/leaks.html:161:0 The tag 'iframe' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-iframe'? (see https://amp.dev/documentation/components/amp-iframe/) | | |

Right Click

>> ^~~~~~~~~ -feature_tests/leaks.html:161:0 The attribute 'contextmenu' may not appear in tag 'p'. +feature_tests/leaks.html:166:0 The attribute 'contextmenu' may not appear in tag 'p'. | >> ^~~~~~~~~ -feature_tests/leaks.html:162:0 The tag 'menu' is disallowed. +feature_tests/leaks.html:167:0 The tag 'menu' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:163:4 The tag 'menuitem' is disallowed. +feature_tests/leaks.html:168:4 The tag 'menuitem' is disallowed. | | | @@ -296,26 +301,26 @@ feature_tests/leaks.html:163:4 The tag 'menuitem' is disallowed. | --> | >> ^~~~~~~~~ -feature_tests/leaks.html:170:0 The tag 'applet' is disallowed. +feature_tests/leaks.html:175:0 The tag 'applet' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:171:0 The tag 'applet' is disallowed. +feature_tests/leaks.html:176:0 The tag 'applet' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:172:0 The tag 'applet' is disallowed. +feature_tests/leaks.html:177:0 The tag 'applet' is disallowed. | | | | >> ^~~~~~~~~ -feature_tests/leaks.html:176:8 The tag 'animate' is disallowed. +feature_tests/leaks.html:181:8 The tag 'animate' is disallowed. | | | | | >> ^~~~~~~~~ -feature_tests/leaks.html:181:4 The tag 'feimage' is disallowed. +feature_tests/leaks.html:186:4 The tag 'feimage' is disallowed. | | | | >> ^~~~~~~~~ -feature_tests/leaks.html:192:0 The tag 'xml' is disallowed. +feature_tests/leaks.html:197:0 The tag 'xml' is disallowed. |
>> ^~~~~~~~~ -feature_tests/leaks.html:193:0 The attribute 'datafld' may not appear in tag 'div'. +feature_tests/leaks.html:198:0 The attribute 'datafld' may not appear in tag 'div'. >> ^~~~~~~~~ -feature_tests/leaks.html:193:0 The attribute 'dataformatas' may not appear in tag 'div'. +feature_tests/leaks.html:198:0 The attribute 'dataformatas' may not appear in tag 'div'. >> ^~~~~~~~~ -feature_tests/leaks.html:193:0 The attribute 'datasrc' may not appear in tag 'div'. +feature_tests/leaks.html:198:0 The attribute 'datasrc' may not appear in tag 'div'. | | | >> ^~~~~~~~~ -feature_tests/leaks.html:198:0 The tag 'line' may only appear as a descendant of tag 'svg'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#svg) +feature_tests/leaks.html:203:0 The tag 'line' may only appear as a descendant of tag 'svg'. (see https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/#svg) | >> ^~~~~~~~~ -feature_tests/leaks.html:199:4 The tag 'fill' is disallowed. +feature_tests/leaks.html:204:4 The tag 'fill' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:200:4 The tag 'stroke' is disallowed. +feature_tests/leaks.html:205:4 The tag 'stroke' is disallowed. | >> ^~~~~~~~~ -feature_tests/leaks.html:201:4 The tag 'imagedata' is disallowed. +feature_tests/leaks.html:206:4 The tag 'imagedata' is disallowed. | | > ^~~~~~~~~ -feature_tests/leaks.html:203:0 The tag 'vmlframe' is disallowed. +feature_tests/leaks.html:208:0 The tag 'vmlframe' is disallowed. | xmlns="urn:schemas-microsoft-com:vml" | style="behavior:url(#default#vml);position:absolute;width:100%;height:100%" | src="https://leaking.via/vmlframe-src#xss"> | | | -| +| \ No newline at end of file