-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
In components/style/selector_matching.rs, the set_device method of Stylist recursively finds @media rules inside stylesheets and checks if the evaluation of any media query has changed. But stylesheets can also have media queries (for example <style media="(min-width: 400px)">…</style>) and these are currently not checked. This MQ is stored in the media attribute of the Stylesheet struct.
Before fixing this, it would be best to write a test that is currently buggy. On way to do this might be to have an iframe whose width changes, and have JS code inside it that uses getComputedStyle before and after the change to observe the value of some property affected by a stylesheet media query. With selector_matching.rs as in current master, the value after should be the same as before because style has not be recomputed when it should have. Changing selector_matching.rs to check stylesheet.media should fix that bug and make the test pass.