HTML parser should execute custom element reactions for setting attributes immediatel...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Aug 2018 17:45:41 +0000 (17:45 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Aug 2018 17:45:41 +0000 (17:45 +0000)
commita5e163458553d6263d233cdc789be22625db6c7b
tree0816abe9415afcfb3ee9c23a37238542dd217c5f
parentde047583b7048fa4b076a2f3566384eded838b31
HTML parser should execute custom element reactions for setting attributes immediately after creating a custom element
https://bugs.webkit.org/show_bug.cgi?id=188336

Reviewed by Frédéric Wang.

LayoutTests/imported/w3c:

Rebaseline the test now that the relevant test case is passing.

* web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children-expected.txt:

Source/WebCore:

Push and pop an element queue from the custom element reactions stack when constructing a custom element:
https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token

To do this, we instantiate CustomElementReactionStack in HTMLDocumentParser::runScriptsForPausedTreeBuilder
where we synchronously construct a custom element. We don't have to worry about whether *will execute script*
is set or not since the presence of an element queue should not be observable in the case where we're constructing
a fallback element (since it would not enqueue any new custom element reaction).

Tests: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate CustomElementReactionStack. Note that we
don't insert the custom element into the parser until we finish processing the custom element reactions.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/html/parser/HTMLDocumentParser.cpp