WebKit Bugzilla
Attachment 346607 Details for
Bug 188336
: HTML parser should execute custom element reactions for setting attributes immediately after creating a custom element
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixes the bug
bug-188336-20180805185946.patch (text/plain), 4.20 KB, created by
Ryosuke Niwa
on 2018-08-05 18:59:47 PDT
(
hide
)
Description:
Fixes the bug
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2018-08-05 18:59:47 PDT
Size:
4.20 KB
patch
obsolete
>Subversion Revision: 234583 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3d89b3c517f5a554b3365a0b0beb63834827d535..09da9fd238a829a70f989a4a1a1e41fb94d94f48 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2018-08-05 Ryosuke Niwa <rniwa@webkit.org> >+ >+ 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 NOBODY (OOPS!). >+ >+ 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 precense 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. >+ > 2018-08-05 Ms2ger <Ms2ger@igalia.com> > > [GStreamer] Remove unsound assertions in MediaPlayerPrivateGStreamerBase. >diff --git a/Source/WebCore/html/parser/HTMLDocumentParser.cpp b/Source/WebCore/html/parser/HTMLDocumentParser.cpp >index c9cc3ac91e081fc4ab276c1aacefff40c72f3d90..3f3e7993ed9c735381c314e897a7b859e1e634b9 100644 >--- a/Source/WebCore/html/parser/HTMLDocumentParser.cpp >+++ b/Source/WebCore/html/parser/HTMLDocumentParser.cpp >@@ -27,6 +27,7 @@ > #include "config.h" > #include "HTMLDocumentParser.h" > >+#include "CustomElementReactionQueue.h" > #include "DocumentFragment.h" > #include "DocumentLoader.h" > #include "Frame.h" >@@ -208,9 +209,12 @@ void HTMLDocumentParser::runScriptsForPausedTreeBuilder() > ASSERT(!m_treeBuilder->hasParserBlockingScriptWork()); > > // https://html.spec.whatwg.org/#create-an-element-for-the-token >- auto& elementInterface = constructionData->elementInterface.get(); >- auto newElement = elementInterface.constructElementWithFallback(*document(), constructionData->name); >- m_treeBuilder->didCreateCustomOrFallbackElement(WTFMove(newElement), *constructionData); >+ { >+ CustomElementReactionStack reactionStack(document()->execState()); >+ auto& elementInterface = constructionData->elementInterface.get(); >+ auto newElement = elementInterface.constructElementWithFallback(*document(), constructionData->name); >+ m_treeBuilder->didCreateCustomOrFallbackElement(WTFMove(newElement), *constructionData); >+ } > return; > } > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children-expected.txt >index e2317aa63f7dcc560e2038f1dfae5d698ac89f42..bc0c300e768f5efc4b5aa6080097dfbf41b8e0ec 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children-expected.txt >@@ -3,5 +3,5 @@ PASS HTML parser must set the attributes > PASS HTML parser must append child nodes > PASS HTML parser must set the attributes or append children before calling constructor > FAIL HTML parser should call connectedCallback before appending child nodes. assert_equals: expected 0 but got 2 >-FAIL HTML parser must enqueue attributeChanged reactions assert_equals: attributeChangedCallback should be called before appending a child expected 0 but got 2 >+PASS HTML parser must enqueue attributeChanged reactions > hello world
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188336
:
346607
|
346608
|
346728
|
346730
|
346731