WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
100332
[ShadowDOM]: Styles in shadow element presents in document.styleSheets collection
https://bugs.webkit.org/show_bug.cgi?id=100332
Summary
[ShadowDOM]: Styles in shadow element presents in document.styleSheets collec...
Sergey G. Grekhov
Reported
2012-10-24 23:04:24 PDT
Found in Chrome 22.0.1229.94 m According Shadow DOM spacification styles added to the shadow element shouldn't be exposed via document.styleSheet collection (
http://www.w3.org/TR/shadow-dom/#upper-boundary-encapsulation
) but in fact these styles are visible. The following test fails: var SR = window.ShadowRoot || window.WebKitShadowRoot; var iframe = document.createElement('iframe'); iframe.src = 'resources/blank.html'; document.body.appendChild(iframe); iframe.onload = function () { try { var d = iframe.contentDocument; var s = new SR(d.head); var style = d.createElement('style'); s.appendChild(style); assert_equals(d.styleSheets.length, 0, 'style elements in shadow DOM must not be exposed via ' + 'the document.styleSheets collection'); } finally { iframe.parentNode.removeChild(iframe); } }; blank.html in the test above is the simple page with the following HTML: <!DOCTYPE html> <html> <head></head> <body></body> </html> Please note that the similar tests for links (instead of style link to the css file is being created) works well. Exact code is: var link = d.createElement('link'); link.setAttribute('rel', 'stylesheet'); link.setAttribute('href', 'testharness.css'); s.appendChild(link); The link from the above is not visible via document.styleSheets collection
Attachments
Add attachment
proposed patch, testcase, etc.
Hajime Morrita
Comment 1
2013-03-14 21:59:11 PDT
***
Bug 105274
has been marked as a duplicate of this bug. ***
Ryosuke Niwa
Comment 2
2019-10-04 22:21:28 PDT
This has been fixed for v1 API.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug