RESOLVED FIXED 149187
Add ShadowRoot interface and Element.prototype.attachShadow
https://bugs.webkit.org/show_bug.cgi?id=149187
Summary Add ShadowRoot interface and Element.prototype.attachShadow
Ryosuke Niwa
Reported 2015-09-15 15:04:17 PDT
Add the new ShadowRoot interface and Element.prototype.attachShadow behind a build flag.
Attachments
Adds the interface and method (85.26 KB, patch)
2015-09-15 15:22 PDT, Ryosuke Niwa
no flags
Updated per Antti's comment (92.97 KB, patch)
2015-09-15 17:04 PDT, Ryosuke Niwa
no flags
Patch for landing (93.54 KB, patch)
2015-09-15 17:33 PDT, Ryosuke Niwa
buildbot: commit-queue-
Archive of layout-test-results from ews106 for mac-mavericks-wk2 (908.04 KB, application/zip)
2015-09-15 18:41 PDT, Build Bot
no flags
Archive of layout-test-results from ews101 for mac-mavericks (658.04 KB, application/zip)
2015-09-15 19:22 PDT, Build Bot
no flags
Ryosuke Niwa
Comment 1 2015-09-15 15:22:23 PDT
Created attachment 261248 [details] Adds the interface and method
Antti Koivisto
Comment 2 2015-09-15 15:36:19 PDT
Comment on attachment 261248 [details] Adds the interface and method View in context: https://bugs.webkit.org/attachment.cgi?id=261248&action=review > Source/WebCore/dom/Element.cpp:1665 > + ShadowRoot::EncapsulationMode encapsulationMode = ShadowRoot::EncapsulationMode::Closed; auto encapsulationMode = > Source/WebCore/dom/ShadowRoot.h:46 > enum ShadowRootType { > UserAgentShadowRoot = 0, > + AuthorShadowRoot = 1, > }; Enum class would be nice here too: enum class ShadowRootType : uint8_t { UserAgent, Author }; > Source/WebCore/dom/ShadowRoot.h:93 > unsigned m_resetStyleInheritance : 1; > unsigned m_type : 1; > + unsigned m_encapsulationMode : 1; We could just use enums instead of bitfields. If you make enum classes uint8_t there is no size difference and there is probably no need to super-optimize shadow root size anyway.
Antti Koivisto
Comment 3 2015-09-15 15:36:28 PDT
r=me
Antti Koivisto
Comment 4 2015-09-15 15:38:00 PDT
Comment on attachment 261248 [details] Adds the interface and method View in context: https://bugs.webkit.org/attachment.cgi?id=261248&action=review >> Source/WebCore/dom/ShadowRoot.h:46 >> }; > > Enum class would be nice here too: > > enum class ShadowRootType : uint8_t { UserAgent, Author }; Actually just enum class Type : uint8_t { UserAgent, Author }; since we are in ShadowRoot scope already.
Ryosuke Niwa
Comment 5 2015-09-15 17:04:07 PDT
Created attachment 261265 [details] Updated per Antti's comment
Antti Koivisto
Comment 6 2015-09-15 17:10:56 PDT
Comment on attachment 261265 [details] Updated per Antti's comment View in context: https://bugs.webkit.org/attachment.cgi?id=261265&action=review > Source/WebCore/dom/ShadowRoot.h:86 > unsigned m_resetStyleInheritance : 1; This could a bool.
Ryosuke Niwa
Comment 7 2015-09-15 17:33:27 PDT
Created attachment 261269 [details] Patch for landing
Ryosuke Niwa
Comment 8 2015-09-15 17:33:49 PDT
Comment on attachment 261269 [details] Patch for landing I'm gonna wait for EWS.
Build Bot
Comment 9 2015-09-15 18:41:45 PDT
Comment on attachment 261269 [details] Patch for landing Attachment 261269 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/174961 New failing tests: js/dom/constructor-length.html js/dom/dom-static-property-for-in-iteration.html js/dom/global-constructors-attributes.html
Build Bot
Comment 10 2015-09-15 18:41:49 PDT
Created attachment 261278 [details] Archive of layout-test-results from ews106 for mac-mavericks-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-mavericks-wk2 Platform: Mac OS X 10.9.5
Build Bot
Comment 11 2015-09-15 19:22:04 PDT
Comment on attachment 261269 [details] Patch for landing Attachment 261269 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/175023 New failing tests: js/dom/constructor-length.html js/dom/dom-static-property-for-in-iteration.html js/dom/global-constructors-attributes.html
Build Bot
Comment 12 2015-09-15 19:22:07 PDT
Created attachment 261282 [details] Archive of layout-test-results from ews101 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-mavericks Platform: Mac OS X 10.9.5
Ryosuke Niwa
Comment 13 2015-09-15 19:41:05 PDT
Alexey Proskuryakov
Comment 14 2015-09-15 23:53:42 PDT
Ryosuke Niwa
Comment 15 2015-09-16 00:14:51 PDT
(In reply to comment #14) > Could you please update Mavericks results for > js/dom/global-constructors-attributes.html ? > > https://build.webkit.org/results/Apple%20Mavericks%20Release%20WK2%20(Tests)/ > r189845%20(17187)/js/dom/global-constructors-attributes-diff.txt Oops, sorry. I missed that. Rebaselined it in http://trac.webkit.org/changeset/189852.
Alexey Proskuryakov
Comment 16 2015-09-16 09:02:13 PDT
More test result updating in r189865 (for El Capitan). I hate these mega-tests.
Jake Nielsen
Comment 17 2015-09-18 13:56:04 PDT
Updated iOS results expectations in r189980
Note You need to log in before you can comment on or make changes to this bug.