Closed
Bug 1447009
Opened 7 years ago
Closed 7 years ago
Stylesheets in shadow DOM with title attribute shouldn't affect the preferred stylesheet of the document.
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla62
Tracking | Status | |
---|---|---|
firefox62 | --- | fixed |
People
(Reporter: emilio, Assigned: emilio)
References
Details
Attachments
(2 files)
Comment hidden (mozreview-request) |
Comment 3•7 years ago
|
||
Why don't alternate style sheets in shadow trees make sense, given we still have UI in the browser for selecting which set of alternate style sheets to apply?
Flags: needinfo?(emilio)
Assignee | ||
Comment 4•7 years ago
|
||
Replied on IRC: https://mozilla.logbot.info/layout/20180507#c14718452
Assignee: nobody → emilio
Flags: needinfo?(emilio)
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8973541 [details]
Bug 1447009: Fix StyleSheet title getter to comply with the spec.
https://reviewboard.mozilla.org/r/241896/#review247798
::: layout/reftests/webcomponents/stylesheet-title-ref.html:6
(Diff revision 1)
> +/*
> + * NOTE(emilio): Test not upstreamed pending resolution for
> + * https://github.com/w3c/csswg-drafts/issues/2646
> + */
Put this comment in the main test file too (or instead of here)?
Attachment #8973541 -
Flags: review?(cam) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 8•7 years ago
|
||
Comment on attachment 8973541 [details]
Bug 1447009: Fix StyleSheet title getter to comply with the spec.
Turns out this was well spec'd after all, see the discussion in the issue.
This is on top of bug 1459844.
Attachment #8973541 -
Flags: review+ → review?(cam)
Comment 9•7 years ago
|
||
mozreview-review |
Comment on attachment 8973541 [details]
Bug 1447009: Fix StyleSheet title getter to comply with the spec.
https://reviewboard.mozilla.org/r/241896/#review248410
Attachment #8973541 -
Flags: review?(cam) → review+
Comment 10•7 years ago
|
||
mozreview-review |
Comment on attachment 8974098 [details]
Bug 1447009: Ignore title if the element is not in the document.
https://reviewboard.mozilla.org/r/242396/#review248408
::: dom/base/nsStyleLinkElement.cpp:99
(Diff revision 1)
> + if (aSelf.IsInUncomposedDoc()) {
> - aSelf.GetAttr(kNameSpaceID_None, nsGkAtoms::title, aTitle);
> + aSelf.GetAttr(kNameSpaceID_None, nsGkAtoms::title, aTitle);
> - aTitle.CompressWhitespace();
> + aTitle.CompressWhitespace();
> + }
Maybe do aTitle.Truncate() in an else block, so that this function always sets aTitle and doesn't rely on it already being empty.
::: testing/web-platform/tests/css/css-scoping/stylesheet-title-002.html:26
(Diff revision 1)
> + for (let sheet of host.shadowRoot.styleSheets)
> + assert_equals(sheet.title, null);
Can you also test that assigning to .title has no effect?
Also, is it worth having similar tests using <link>, or do we already have tests for that?
Attachment #8974098 -
Flags: review?(cam) → review+
Comment 11•7 years ago
|
||
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cdca6257abb6
Fix StyleSheet title getter to comply with the spec. r=heycam
https://hg.mozilla.org/integration/mozilla-inbound/rev/2dca44947bff
Ignore title if the element is not in the document. r=heycam
Assignee | ||
Comment 12•7 years ago
|
||
(In reply to Cameron McCormack (:heycam) from comment #10)
> Comment on attachment 8974098 [details]
> Bug 1447009: Ignore title if the element is not in the document.
>
> https://reviewboard.mozilla.org/r/242396/#review248408
>
> ::: dom/base/nsStyleLinkElement.cpp:99
> (Diff revision 1)
> > + if (aSelf.IsInUncomposedDoc()) {
> > - aSelf.GetAttr(kNameSpaceID_None, nsGkAtoms::title, aTitle);
> > + aSelf.GetAttr(kNameSpaceID_None, nsGkAtoms::title, aTitle);
> > - aTitle.CompressWhitespace();
> > + aTitle.CompressWhitespace();
> > + }
>
> Maybe do aTitle.Truncate() in an else block, so that this function always
> sets aTitle and doesn't rely on it already being empty.
I left it as-is because GetHref was already relying on the same.
> ::: testing/web-platform/tests/css/css-scoping/stylesheet-title-002.html:26
> (Diff revision 1)
> > + for (let sheet of host.shadowRoot.styleSheets)
> > + assert_equals(sheet.title, null);
>
> Can you also test that assigning to .title has no effect?
Done, also that title attribute mutation didn't have an effect.
> Also, is it worth having similar tests using <link>, or do we already have
> tests for that?
We don't support link on Shadow DOM yet, so probably not (yet?). Though the test would be pretty similar I expect.
Assignee | ||
Comment 13•7 years ago
|
||
Oh, also SetIsVoid already truncates: https://searchfox.org/mozilla-central/rev/eb6c5214a63e20a3fff455e92c876287a8d2e188/xpcom/string/nsTSubstring.cpp#835
Comment 14•7 years ago
|
||
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9dfde358e826
followup: Rename a test to appease wptlint. r=me
Created web-platform-tests PR https://github.com/w3c/web-platform-tests/pull/10945 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Comment 17•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cdca6257abb6
https://hg.mozilla.org/mozilla-central/rev/2dca44947bff
https://hg.mozilla.org/mozilla-central/rev/9dfde358e826
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox62:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Upstream PR merged
You need to log in
before you can comment on or make changes to this bug.
Description
•