[Webkit-unassigned] [Bug 85863] [Shadow] Style elements in Shadow DOM should not be exposed by document.styleSheets attribute

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 28 05:59:01 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=85863





--- Comment #7 from Takashi Sakamoto <tasak at google.com>  2012-05-28 05:59:00 PST ---
(In reply to comment #4)
> (In reply to comment #3)
> > (From update of attachment 143440 [details] [details])
> > While I'm no shadow DOM expert, I feel that this patch needs more explanation of what's going on.
> > 
> > Why are we skipping over StyleElement::insertedIntoDocument/removedFromDocument? That will not only prevent document.styleSheets from exposing the sheet, but also prevent StyleElement from parsing the sheet, and StyleResolver from applying any of its style (since it gets its sheet data from there.)
> > 
> 
> > Maybe <style> elements are supposed to just hang dead inside a shadow subtree?
> It's going to be scoped by Shadow DOM, that is, the style is applied 
> only for shadow subtrees.
> dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles
> 
> I agree Kling's point though.
> This change could be done as a part of style scoping,
> instead of just doing a band-aid fix.

I agree. My old patch made any styles in shadow tree be disabled. For example,

  <div id='mydiv'></div>
...
<script>
  var div = document.getElementById('mydiv');
  var sr = new WebKitShadowRoot(div);
  sr.innerHTML = '<style>div { background-color: red; }</style><div>RED</div>';
  ...
</script>

The "RED"'s background color is not red.... So I think, I have to modify styleSheets method defined in class Document.
I created a new method allStyleSheets which does the same things the old styleSheets does, and modified styleSheets to return just style sheets that are not in shadow trees.

Best regards,
Takashi Sakamoto

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list