Skip to content

Commit

Permalink
Not having cached style data doesn't guarantee we don't need to updat…
Browse files Browse the repository at this point in the history
…e media query stuff.

In particular,  even when there are no frames, we may have used the rule
cascades / stylist data (for different stuff, like font-feature-values, thus the
regressing bug).

Using the old rule cascades / stylist data without knowing it has changed is
wrong, thus the bug.

Now that media query change stuff is async and has a well-defined processing
point, we should be able to just call it without too much worry.

Also note that at the point the extra hints are passed, if there's no root frame
/ elements are not styled / etc, we'll optimize away the change hint.

The test-case intermittently fails without this patch, but I didn't manage to
make a better one, unfortunately :(
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1424878
gecko-commit: 88b42bd5847abac58a62c4d6b33c1509bfce5f3d
gecko-integration-branch: autoland
gecko-reviewers: bz
  • Loading branch information
emilio authored and moz-wptsync-bot committed Feb 13, 2018
1 parent 54c8d71 commit a076c3e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions css/mediaqueries/viewport-script-dynamic-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test Reference</title>
<link rel="author" href="mailto:emilio@crisal.io">
<meta name="viewport" content="width=300">
<style>
p { color: green; }
</style>
<p>Should be green</p>
20 changes: 20 additions & 0 deletions css/mediaqueries/viewport-script-dynamic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: Meta viewport after a script and stylesheets</title>
<link rel="author" href="mailto:emilio@crisal.io">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1424878">
<link rel="help" href="https://drafts.csswg.org/mediaqueries/#mf-dimensions">
<link rel="match" href="viewport-script-dynamic-ref.html">
<style>
p { color: green; }
/* Ensure that we initially match it, and stop matching it afterwards */
@media (min-width: 310px) {
p {
color: red;
}
}
</style>
<!-- The broken script below is the point of the test, see the bugzilla bug. -->
<script src="intentionally-broken-url.js"></script>
<meta name="viewport" content="width=300">
<p>Should be green</p>

0 comments on commit a076c3e

Please sign in to comment.