Implement web components ShadowRoot style sheet behavior.

RESOLVED FIXED in mozilla28

Status

()

Core
DOM
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: wchen, Assigned: wchen)

Tracking

(Blocks: 1 bug)

unspecified
mozilla28
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles
(Assignee)

Comment 1

4 years ago
Created attachment 820828 [details] [diff] [review]
Implement web components ShadowRoot style sheet behavior.
Attachment #820828 - Flags: review?(mrbkap)
Comment on attachment 820828 [details] [diff] [review]
Implement web components ShadowRoot style sheet behavior.

Review of attachment 820828 [details] [diff] [review]:
-----------------------------------------------------------------

This looks really good. Just a couple of small comments.

::: content/base/src/ShadowRoot.cpp
@@ +139,5 @@
> +
> +  mProtoBinding->FlushSkinSheets();
> +
> +  nsIPresShell* shell = OwnerDoc()->GetShell();
> +  if (shell) {

I think it's worth making a helper function for this (RestyleShadowRoot()) and sharing it between Insert/RemoveSheet.

::: content/html/content/src/HTMLStyleElement.cpp
@@ +161,2 @@
>    nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
> +  UpdateStyleSheetInternal(oldDoc, oldShadow);

Nit: no need for single-use |oldShadow|.

::: content/svg/content/src/SVGStyleElement.cpp
@@ +86,2 @@
>    SVGStyleElementBase::UnbindFromTree(aDeep, aNullParent);
> +  UpdateStyleSheetInternal(oldDoc, nullptr);

I asked you about this on IRC and you said that it's probably OK to pass null for the oldShadowRoot. Please add a comment why or simply pass in the shadow root as you said that'd also work and should be harmless.
Attachment #820828 - Flags: review?(mrbkap) → review+
(Assignee)

Comment 3

4 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/1ac0576fa66f
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/1ac0576fa66f
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
You need to log in before you can comment on or make changes to this bug.