From 387868bb70b674dcc64d73bc1c2545c13bab165e Mon Sep 17 00:00:00 2001 From: Greg Grothaus Date: Wed, 27 Feb 2019 11:33:04 -0800 Subject: [PATCH 1/6] cl/234896906 Revision bump for #20969 --- validator/validator-main.protoascii | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii index 96f5122e3c9d..8bac4b462951 100644 --- a/validator/validator-main.protoascii +++ b/validator/validator-main.protoascii @@ -26,7 +26,7 @@ min_validator_revision_required: 375 # newer versions of the spec file. This is currently a Google internal # mechanism, validator.js does not use this facility. However, any # change to this file (validator-main.js) requires updating this revision id. -spec_file_revision: 829 +spec_file_revision: 830 styles_spec_url: "https://www.ampproject.org/docs/guides/author-develop/responsive/style_pages" script_spec_url: "https://www.ampproject.org/docs/reference/spec#html-tags" From f6c5fccf40612c24259c96da40fb8a684e9ea1e3 Mon Sep 17 00:00:00 2001 From: honeybadgerdontcare Date: Wed, 27 Feb 2019 11:33:33 -0800 Subject: [PATCH 2/6] cl/235090073 Allow i-amphtml-layout on AMP elements only for Transformed AMP --- validator/validator-main.protoascii | 34 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii index 8bac4b462951..96d4caee0681 100644 --- a/validator/validator-main.protoascii +++ b/validator/validator-main.protoascii @@ -26,7 +26,7 @@ min_validator_revision_required: 375 # newer versions of the spec file. This is currently a Google internal # mechanism, validator.js does not use this facility. However, any # change to this file (validator-main.js) requires updating this revision id. -spec_file_revision: 830 +spec_file_revision: 831 styles_spec_url: "https://www.ampproject.org/docs/guides/author-develop/responsive/style_pages" script_spec_url: "https://www.ampproject.org/docs/reference/spec#html-tags" @@ -4988,8 +4988,24 @@ attr_lists: { # Extended AMP globally optional tags. attr_lists: { name: "extended-amp-global" + attrs: { + enabled_by: "transformed" + name: "i-amphtml-layout" + value_casei: "container" + value_casei: "fill" + value_casei: "fixed" + value_casei: "fixed-height" + value_casei: "flex-item" + value_casei: "fluid" + value_casei: "intrinsic" + value_casei: "nodisplay" + value_casei: "responsive" + } attrs: { name: "media" } - attrs: { name: "noloading" value: "" } + attrs: { + name: "noloading" + value: "" + } } tags: { # html_format: AMP @@ -6145,20 +6161,6 @@ attr_lists: { marker: AUTOSCROLL } } - # Transformed AMP - attrs: { - enabled_by: "transformed" - name: "i-amphtml-layout" - value_casei: "container" - value_casei: "fill" - value_casei: "fixed" - value_casei: "fixed-height" - value_casei: "flex-item" - value_casei: "fluid" - value_casei: "intrinsic" - value_casei: "nodisplay" - value_casei: "responsive" - } } # Error Specificity: Used in the verbose validator to select between multiple From 064a19e1b98172e4aa48d7989de178f1cbfa0359 Mon Sep 17 00:00:00 2001 From: honeybadgerdontcare Date: Wed, 27 Feb 2019 11:33:56 -0800 Subject: [PATCH 3/6] cl/235216325 Disallow document properties in
attribute name. --- validator/validator-main.protoascii | 364 +++++++++++++++++++++++++++- 1 file changed, 358 insertions(+), 6 deletions(-) diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii index 96d4caee0681..780c7aafb5e9 100644 --- a/validator/validator-main.protoascii +++ b/validator/validator-main.protoascii @@ -26,7 +26,7 @@ min_validator_revision_required: 375 # newer versions of the spec file. This is currently a Google internal # mechanism, validator.js does not use this facility. However, any # change to this file (validator-main.js) requires updating this revision id. -spec_file_revision: 831 +spec_file_revision: 832 styles_spec_url: "https://www.ampproject.org/docs/guides/author-develop/responsive/style_pages" script_spec_url: "https://www.ampproject.org/docs/reference/spec#html-tags" @@ -3937,7 +3937,7 @@ tags { # } blacklisted_value_regex: "__amp_source_origin" } - attr_lists: "name-attr" + attr_lists: "form-name-attr" } tags { # html_format: AMP @@ -3988,7 +3988,7 @@ tags { # } blacklisted_value_regex: "__amp_source_origin" } - attr_lists: "name-attr" + attr_lists: "form-name-attr" } # ACTIONS for POST identity token tags: { # @@ -4048,7 +4048,7 @@ tags: { # } blacklisted_value_regex: "__amp_source_origin" } - attr_lists: "name-attr" + attr_lists: "form-name-attr" } # AMP4EMAIL allows action-xhr and disallows action attribute. It also disallows # the use of mustache templates in action-xhr. The only allowed @@ -4085,7 +4085,7 @@ tags { # value_casei: "get" } attrs: { name: "novalidate" } - attr_lists: "name-attr" + attr_lists: "form-name-attr" } tags { # html_format: AMP4EMAIL @@ -4121,7 +4121,7 @@ tags { # dispatch_key: NAME_VALUE_DISPATCH } attrs: { name: "novalidate" } - attr_lists: "name-attr" + attr_lists: "form-name-attr" } # Will add verify state template if requested by users tags { @@ -5290,6 +5290,358 @@ attr_lists: { } } +# Disallows document properties on "name" attribute for use on . +attr_lists: { + name: "form-name-attr" + attrs: { + name: "name" + blacklisted_value_regex: "(^|\\s)(" + "ATTRIBUTE_NODE|" + "CDATA_SECTION_NODE|" + "COMMENT_NODE|" + "DOCUMENT_FRAGMENT_NODE|" + "DOCUMENT_NODE|" + "DOCUMENT_POSITION_CONTAINED_BY|" + "DOCUMENT_POSITION_CONTAINS|" + "DOCUMENT_POSITION_DISCONNECTED|" + "DOCUMENT_POSITION_FOLLOWING|" + "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|" + "DOCUMENT_POSITION_PRECEDING|" + "DOCUMENT_TYPE_NODE|" + "ELEMENT_NODE|" + "ENTITY_NODE|" + "ENTITY_REFERENCE_NODE|" + "NOTATION_NODE|" + "PROCESSING_INSTRUCTION_NODE|" + "TEXT_NODE|" + "URL|" + "URLUnencoded|" + "__amp_\\S*|" + "__count__|" + "__defineGetter__|" + "__defineSetter__|" + "__lookupGetter__|" + "__lookupSetter__|" + "__noSuchMethod__|" + "__parent__|" + "__proto__|" + "__AMP_\\S*|" + "activeElement|" + "addEventListener|" + "adoptNode|" + "alinkColor|" + "all|" + "anchors|" + "append|" + "appendChild|" + "applets|" + "baseURI|" + "bgColor|" + "body|" + "captureEvents|" + "caretPositionFromPoint|" + "caretRangeFromPoint|" + "characterSet|" + "charset|" + "childElementCount|" + "childNodes|" + "children|" + "clear|" + "cloneNode|" + "close|" + "compareDocumentPosition|" + "compatMode|" + "constructor|" + "contains|" + "contentType|" + "cookie|" + "createAttribute|" + "createAttributeNS|" + "createCDATASection|" + "createComment|" + "createDocumentFragment|" + "createElement|" + "createElementNS|" + "createEvent|" + "createExpression|" + "createNSResolver|" + "createNodeIterator|" + "createProcessingInstruction|" + "createRange|" + "createTextNode|" + "createTreeWalker|" + "currentScript|" + "defaultView|" + "designMode|" + "dir|" + "dispatchEvent|" + "doctype|" + "documentElement|" + "documentURI|" + "domain|" + "elementFromPoint|" + "elementsFromPoint|" + "embeds|" + "enableStyleSheetsForSet|" + "evaluate|" + "execCommand|" + "execCommandShowHelp|" + "exitFullscreen|" + "exitPictureInPicture|" + "exitPointerLock|" + "fgColor|" + "firstChild|" + "firstElementChild|" + "focus|" + "fonts|" + "forms|" + "fullscreen|" + "fullscreenElement|" + "fullscreenEnabled|" + "getCSSCanvasContext|" + "getElementById|" + "getElementsByClassName|" + "getElementsByName|" + "getElementsByTagName|" + "getElementsByTagNameNS|" + "getOverrideStyle|" + "getRootNode|" + "getSelection|" + "hasChildNodes|" + "hasFocus|" + "hasOwnProperty|" + "hasStorageAccess|" + "head|" + "hidden|" + "images|" + "implementation|" + "importNode|" + "inputEncoding|" + "insertBefore|" + "isConnected|" + "isDefaultNamespace|" + "isEqualNode|" + "isPrototypeOf|" + "isSameNode|" + "l10n|" + "lastChild|" + "lastElementChild|" + "lastModified|" + "lastStyleSheetSet|" + "linkColor|" + "links|" + "location|" + "lookupNamespaceURI|" + "lookupPrefix|" + "mozCancelFullScreen|" + "mozFullScreen|" + "mozFullScreenElement|" + "mozFullScreenEnabled|" + "mozSetImageElement|" + "msCSSOMElementFloatMetrics|" + "msCapsLockWarningOff|" + "msElementsFromPoint|" + "msElementsFromRect|" + "nextSibling|" + "nodeName|" + "nodeType|" + "nodeValue|" + "normalize|" + "onabort|" + "onactivate|" + "onafterscriptexecute|" + "onanimationcancel|" + "onanimationend|" + "onanimationiteration|" + "onanimationstart|" + "onauxclick|" + "onbeforeactivate|" + "onbeforecopy|" + "onbeforecut|" + "onbeforedeactivate|" + "onbeforeinput|" + "onbeforepaste|" + "onbeforescriptexecute|" + "onblur|" + "oncancel|" + "oncanplay|" + "oncanplaythrough|" + "onchange|" + "onclick|" + "onclose|" + "oncontextmenu|" + "oncopy|" + "oncuechange|" + "oncut|" + "ondblclick|" + "ondeactivate|" + "ondrag|" + "ondragend|" + "ondragenter|" + "ondragexit|" + "ondragleave|" + "ondragover|" + "ondragstart|" + "ondrop|" + "ondurationchange|" + "onemptied|" + "onended|" + "onerror|" + "onfocus|" + "onfreeze|" + "onfullscreenchange|" + "onfullscreenerror|" + "ongotpointercapture|" + "oninput|" + "oninvalid|" + "onkeydown|" + "onkeypress|" + "onkeyup|" + "onload|" + "onloadeddata|" + "onloadedmetadata|" + "onloadend|" + "onloadstart|" + "onlostpointercapture|" + "onmousedown|" + "onmouseenter|" + "onmouseleave|" + "onmousemove|" + "onmouseout|" + "onmouseover|" + "onmouseup|" + "onmousewheel|" + "onmozfullscreenchange|" + "onmozfullscreenerror|" + "onmscontentzoom|" + "onmsgesturechange|" + "onmsgesturedoubletap|" + "onmsgestureend|" + "onmsgesturehold|" + "onmsgesturestart|" + "onmsgesturetap|" + "onmsinertiastart|" + "onmsmanipulationstatechanged|" + "onmssitemodejumplistitemremoved|" + "onmsthumbnailclick|" + "onpaste|" + "onpause|" + "onplay|" + "onplaying|" + "onpointercancel|" + "onpointerdown|" + "onpointerenter|" + "onpointerleave|" + "onpointerlockchange|" + "onpointerlockerror|" + "onpointermove|" + "onpointerout|" + "onpointerover|" + "onpointerup|" + "onprogress|" + "onratechange|" + "onreadystatechange|" + "onrejectionhandled|" + "onreset|" + "onresize|" + "onresume|" + "onscroll|" + "onsearch|" + "onseeked|" + "onseeking|" + "onselect|" + "onselectionchange|" + "onselectstart|" + "onshow|" + "onstalled|" + "onstop|" + "onsubmit|" + "onsuspend|" + "ontimeupdate|" + "ontoggle|" + "ontransitioncancel|" + "ontransitionend|" + "ontransitionrun|" + "ontransitionstart|" + "onunhandledrejection|" + "onvisibilitychange|" + "onvolumechange|" + "onwaiting|" + "onwebkitanimationend|" + "onwebkitanimationiteration|" + "onwebkitanimationstart|" + "onwebkitfullscreenchange|" + "onwebkitfullscreenerror|" + "onwebkitmouseforcechanged|" + "onwebkitmouseforcedown|" + "onwebkitmouseforceup|" + "onwebkitmouseforcewillbegin|" + "onwebkittransitionend|" + "onwheel|" + "open|" + "origin|" + "ownerDocument|" + "parentElement|" + "parentNode|" + "pictureInPictureElement|" + "pictureInPictureEnabled|" + "plugins|" + "pointerLockElement|" + "preferredStyleSheetSet|" + "prepend|" + "previousSibling|" + "propertyIsEnumerable|" + "queryCommandEnabled|" + "queryCommandIndeterm|" + "queryCommandState|" + "queryCommandSupported|" + "queryCommandText|" + "queryCommandValue|" + "querySelector|" + "querySelectorAll|" + "readyState|" + "referrer|" + "registerElement|" + "releaseCapture|" + "releaseEvents|" + "removeChild|" + "removeEventListener|" + "replaceChild|" + "requestStorageAccess|" + "rootElement|" + "scripts|" + "scrollingElement|" + "selectedStyleSheetSet|" + "styleSheetSets|" + "styleSheets|" + "textContent|" + "title|" + "toLocaleString|" + "toSource|" + "toString|" + "updateSettings|" + "valueOf|" + "visibilityState|" + "vlinkColor|" + "wasDiscarded|" + "webkitCancelFullScreen|" + "webkitCurrentFullScreenElement|" + "webkitExitFullscreen|" + "webkitFullScreenKeyboardInputAllowed|" + "webkitFullscreenElement|" + "webkitFullscreenEnabled|" + "webkitHidden|" + "webkitIsFullScreen|" + "webkitVisibilityState|" + "write|" + "writeln|" + "xmlEncoding|" + "xmlStandalone|" + "xmlVersion" + ")(\\s|$)" + } +} + # Not mandatory "name" attribute. attr_lists: { name: "name-attr" From c019fd03e9d57993ead9616a1960a18168290faf Mon Sep 17 00:00:00 2001 From: Greg Grothaus Date: Wed, 27 Feb 2019 11:34:06 -0800 Subject: [PATCH 4/6] cl/235271919 Revision bump for #20989 --- validator/validator-main.protoascii | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii index 780c7aafb5e9..f945fb9910d4 100644 --- a/validator/validator-main.protoascii +++ b/validator/validator-main.protoascii @@ -26,7 +26,7 @@ min_validator_revision_required: 375 # newer versions of the spec file. This is currently a Google internal # mechanism, validator.js does not use this facility. However, any # change to this file (validator-main.js) requires updating this revision id. -spec_file_revision: 832 +spec_file_revision: 833 styles_spec_url: "https://www.ampproject.org/docs/guides/author-develop/responsive/style_pages" script_spec_url: "https://www.ampproject.org/docs/reference/spec#html-tags" From 391ac00a764b796b095864aca5634c9a855a42aa Mon Sep 17 00:00:00 2001 From: Greg Grothaus Date: Wed, 27 Feb 2019 11:38:02 -0800 Subject: [PATCH 5/6] cl/235833553 Revision bump for #20928 --- validator/testdata/feature_tests/amp-action-macro.out | 1 - validator/validator-main.protoascii | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/validator/testdata/feature_tests/amp-action-macro.out b/validator/testdata/feature_tests/amp-action-macro.out index de8256791e48..e0e4809b733c 100644 --- a/validator/testdata/feature_tests/amp-action-macro.out +++ b/validator/testdata/feature_tests/amp-action-macro.out @@ -57,4 +57,3 @@ feature_tests/amp-action-macro.html:50:2 The mandatory attribute 'execute' is mi | | | - diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii index f945fb9910d4..fa9399ab2367 100644 --- a/validator/validator-main.protoascii +++ b/validator/validator-main.protoascii @@ -26,7 +26,7 @@ min_validator_revision_required: 375 # newer versions of the spec file. This is currently a Google internal # mechanism, validator.js does not use this facility. However, any # change to this file (validator-main.js) requires updating this revision id. -spec_file_revision: 833 +spec_file_revision: 834 styles_spec_url: "https://www.ampproject.org/docs/guides/author-develop/responsive/style_pages" script_spec_url: "https://www.ampproject.org/docs/reference/spec#html-tags" From 7bdc0962abb5e353e4c0830fd15b427ab250d45e Mon Sep 17 00:00:00 2001 From: Greg Grothaus Date: Wed, 27 Feb 2019 11:40:05 -0800 Subject: [PATCH 6/6] cl/235843207 Revision bump for #20905 --- .../amp-fx-collection/0.1/test/validator-amp-fx-collection.out | 2 +- validator/validator-main.protoascii | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/amp-fx-collection/0.1/test/validator-amp-fx-collection.out b/extensions/amp-fx-collection/0.1/test/validator-amp-fx-collection.out index 7fbd407c0754..c4d7cb593d8b 100644 --- a/extensions/amp-fx-collection/0.1/test/validator-amp-fx-collection.out +++ b/extensions/amp-fx-collection/0.1/test/validator-amp-fx-collection.out @@ -95,4 +95,4 @@ PASS |

| | -| \ No newline at end of file +| diff --git a/validator/validator-main.protoascii b/validator/validator-main.protoascii index fa9399ab2367..d1bf0be67dd1 100644 --- a/validator/validator-main.protoascii +++ b/validator/validator-main.protoascii @@ -26,7 +26,7 @@ min_validator_revision_required: 375 # newer versions of the spec file. This is currently a Google internal # mechanism, validator.js does not use this facility. However, any # change to this file (validator-main.js) requires updating this revision id. -spec_file_revision: 834 +spec_file_revision: 835 styles_spec_url: "https://www.ampproject.org/docs/guides/author-develop/responsive/style_pages" script_spec_url: "https://www.ampproject.org/docs/reference/spec#html-tags"