WebKit Bugzilla
Attachment 347286 Details for
Bug 188637
: Custom element doesn't invalidate its style when :defined rule starts to apply
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-188637-20180816123233.patch (text/plain), 6.43 KB, created by
Ryosuke Niwa
on 2018-08-16 12:32:34 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2018-08-16 12:32:34 PDT
Size:
6.43 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 234947) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,17 @@ >+2018-08-16 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Custom element doesn't invalidate its style when :defined rule starts to apply >+ https://bugs.webkit.org/show_bug.cgi?id=188637 >+ >+ Reviewed by Antti Koivisto. >+ >+ Fixed the bug by invalidating the subtree when a custom element gets defined. >+ >+ Test: fast/custom-elements/defined-update-style.html >+ >+ * dom/Element.cpp: >+ (WebCore::Element::setIsDefinedCustomElement): >+ > 2018-08-16 Ryosuke Niwa <rniwa@webkit.org> > > Perform a microtask checkpoint before creating a custom element >Index: Source/WebCore/dom/Element.cpp >=================================================================== >--- Source/WebCore/dom/Element.cpp (revision 234947) >+++ Source/WebCore/dom/Element.cpp (working copy) >@@ -1978,6 +1978,7 @@ void Element::setIsDefinedCustomElement( > auto& data = ensureElementRareData(); > if (!data.customElementReactionQueue()) > data.setCustomElementReactionQueue(std::make_unique<CustomElementReactionQueue>(elementInterface)); >+ invalidateStyleForSubtree(); > InspectorInstrumentation::didChangeCustomElementState(*this); > } > >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 234947) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2018-08-16 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Custom element doesn't invalidate its style when :defined rule starts to apply >+ https://bugs.webkit.org/show_bug.cgi?id=188637 >+ >+ Reviewed by Antti Koivisto. >+ >+ Added a regression test. >+ >+ * fast/custom-elements/defined-update-style-expected.html: Added. >+ * fast/custom-elements/defined-update-style.html: Added. >+ > 2018-08-16 Per Arne Vollan <pvollan@apple.com> > > [Win] The layout test editing/pasteboard/drag-and-drop-color-input-events.html is timing out. >Index: LayoutTests/fast/custom-elements/defined-update-style-expected.html >=================================================================== >--- LayoutTests/fast/custom-elements/defined-update-style-expected.html (nonexistent) >+++ LayoutTests/fast/custom-elements/defined-update-style-expected.html (working copy) >@@ -0,0 +1,7 @@ >+<!DOCTYPE html> >+<html> >+<body> >+ <p>Test passes if you see a single 100px by 100px green box below.</p> >+ <div style="width: 100px; height: 100px; background: green;"></div> >+</body> >+</html> >Index: LayoutTests/fast/custom-elements/defined-update-style.html >=================================================================== >--- LayoutTests/fast/custom-elements/defined-update-style.html (nonexistent) >+++ LayoutTests/fast/custom-elements/defined-update-style.html (working copy) >@@ -0,0 +1,45 @@ >+<!DOCTYPE html> >+<html> >+<body> >+<style> >+.box { >+ display: block; >+ width: 100px; >+ height: 25px; >+} >+defined-element { background: red; color: green; } >+defined-element:defined { background: green; } >+defined-element:not(:defined) { color: red; } >+ >+defined-element div { background: red; color: green; } >+defined-element:defined div { background: green; } >+defined-element:not(:defined) div { color: red; } >+ >+defined-element + .sibling { background: red; color: green; } >+defined-element:defined + .sibling { background: green; } >+defined-element:not(:defined) + .sibling { color: red; } >+ >+defined-element#foo { background: red; color: green; } >+defined-element#foo:defined { background: green; } >+defined-element#foo:not(:defined) { color: red; } >+ >+</style> >+<p>Test passes if you see a single 100px by 100px green box below.</p> >+<defined-element class="box">FAIL</defined-element> >+<defined-element class="box"><div>FAIL</div></defined-element> >+<div class="sibling box">FAIL</div> >+<defined-element id="foo" class="box">FAIL</defined-element> >+<script> >+ >+if (window.testRunner) >+ testRunner.waitUntilDone(); >+ >+setTimeout(() => { >+ customElements.define('defined-element', class extends HTMLElement {}); >+ if (window.testRunner) >+ testRunner.notifyDone(); >+}, 0); >+ >+</script> >+</body> >+</html> >Index: LayoutTests/imported/w3c/ChangeLog >=================================================================== >--- LayoutTests/imported/w3c/ChangeLog (revision 234947) >+++ LayoutTests/imported/w3c/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2018-08-16 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Custom element doesn't invalidate its style when :defined rule starts to apply >+ https://bugs.webkit.org/show_bug.cgi?id=188637 >+ >+ Reviewed by Antti Koivisto. >+ >+ Rebaselined the test now that all relevant test cases pass. The only remaining test failures >+ are for customized builtins which we do not and shall not implement. >+ >+ * web-platform-tests/custom-elements/pseudo-class-defined-expected.txt: >+ > 2018-08-15 Jer Noble <jer.noble@apple.com> > > Add Experimental Feature support for SourceBuffer.changeType() >Index: LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined-expected.txt >=================================================================== >--- LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined-expected.txt (revision 234947) >+++ LayoutTests/imported/w3c/web-platform-tests/custom-elements/pseudo-class-defined-expected.txt (working copy) >@@ -11,8 +11,8 @@ PASS <a-a> should not be :defined > PASS createElement("a-a") should not be :defined > PASS createElementNS("http://www.w3.org/1999/xhtml", "a-a") should not be :defined > PASS createElementNS("http://www.w3.org/2000/svg", "a-a") should be :defined >-FAIL Upgraded createElement("a-a") should be :defined assert_equals: getComputedStyle expected "rgb(255, 165, 0)" but got "rgb(0, 0, 255)" >-FAIL Upgraded createElementNS("http://www.w3.org/1999/xhtml", "a-a") should be :defined assert_equals: getComputedStyle expected "rgb(255, 165, 0)" but got "rgb(0, 0, 255)" >+PASS Upgraded createElement("a-a") should be :defined >+PASS Upgraded createElementNS("http://www.w3.org/1999/xhtml", "a-a") should be :defined > PASS Without browsing context: createElement("a-a") should not be :defined > PASS Without browsing context: createElementNS("http://www.w3.org/1999/xhtml", "a-a") should not be :defined > PASS Without browsing context: createElementNS("http://www.w3.org/2000/svg", "a-a") should be :defined
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 188637
:
347247
|
347249
| 347286