Closed Bug 1420755 Opened 7 years ago Closed 7 years ago

Some dynamic changes to the stylesheet media list don't get reflected.

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

Details

Attachments

(1 file)

Testcase:

<!doctype html>
<style media="all">* { color: red }</style>
Should not be red.
<script>
  document.body.offsetTop;
  document.styleSheets[0].media.mediaText = "not all";
</script>
Comment on attachment 8931965 [details] [diff] [review]
Make the MediaList coming from the loader know about its stylesheet.

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

::: layout/style/StyleSheet.cpp
@@ +875,5 @@
>  void
>  StyleSheet::SetMedia(dom::MediaList* aMedia)
>  {
> +  if (aMedia) {
> +    aMedia->SetStyleSheet(this);

I don't really understand why we don't need this when stylo is disabled.  I guess the sheet gets set somewhere else?
Attachment #8931965 - Flags: review?(cam) → review+
(In reply to Cameron McCormack (:heycam) from comment #2)
> I don't really understand why we don't need this when stylo is disabled.  I
> guess the sheet gets set somewhere else?

This testcase also fails with stylo disabled.
Pushed by ecoal95@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/16908f919d28
Make the MediaList coming from the loader know about its stylesheet. r=heycam
https://hg.mozilla.org/mozilla-central/rev/16908f919d28
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: