haikuwebkit/LayoutTests/fast/shadow-dom/shadowroot-stylesheets-wrap...

14 lines
160 B
Plaintext
Raw Permalink Normal View History

ShadowRoot should have styleSheets property https://bugs.webkit.org/show_bug.cgi?id=191311 LayoutTests/imported/w3c: Reviewed by Antti Koivisto. Rebaselined the tests. * web-platform-tests/css/css-scoping/stylesheet-title-002-expected.txt: Rebaselined. The test now doesn't throw but fails with the actual check the test is intending to check. * web-platform-tests/css/cssom/selectorText-modification-restyle-002-expected.txt: Rebaselined now that all test cases pass. * web-platform-tests/shadow-dom/ShadowRoot-interface-expected.txt: Ditto. Source/WebCore: Reviewed by Antti Koivisto. Added the support for ShadowRoot.prototype.styleSheets by making StyleSheetList refer to either a document or a shadow root. We don't support the named getter in shadow root since that's not a standard feature: https://drafts.csswg.org/cssom/#the-stylesheetlist-interface Tests: fast/shadow-dom/shadowroot-stylesheets-wrapper-gc.html imported/w3c/web-platform-tests/shadow-dom/ShadowRoot-interface.html * css/StyleSheetList.cpp: (WebCore::StyleSheetList::StyleSheetList): Added a variant which takes ShadowRoot. (WebCore::StyleSheetList::styleSheets const): (WebCore::StyleSheetList::ownerNode): Added. The replacement for document() since now the opaque root could be either a Document or a ShadowRoot. (WebCore::StyleSheetList::detach): Renamed from detachFromDocument. (WebCore::StyleSheetList::namedItem const): Added a comment that the named getter is only supported for Document since it's not in the standard. * css/StyleSheetList.h: (WebCore::StyleSheetList::create): Added a variant which takes ShadowRoot. (WebCore::StyleSheetList::document): Deleted. Replaced by StyleSheetList::ownerNode in .cpp file. * css/StyleSheetList.idl: * dom/Document.cpp: (WebCore::Document::~Document): (WebCore::Document::styleSheets): * dom/Document.idl: * dom/DocumentOrShadowRoot.idl: Moved the declaration of styleSheets here from Document.idl. * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::~ShadowRoot): Call detach. (WebCore::ShadowRoot::styleSheets): * dom/ShadowRoot.h: LayoutTests: <rdar://problem/46333290> Reviewed by Antti Koivisto. Added a regression test for testing that the JS wrapper of a StyleSheetList does not get collected as long as its shadow root is alive. * fast/shadow-dom/shadowroot-stylesheets-wrapper-gc-expected.txt: Added. * fast/shadow-dom/shadowroot-stylesheets-wrapper-gc.html: Added. Canonical link: https://commits.webkit.org/206902@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-30 23:33:39 +00:00
This tests that StyleSheetList of a shadow root does not get collected as long as the shadow root is alive.
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS
PASS