DescriptionMake sure media query results are re-collected.
When media attributes change on style elements, we need to re-append
all sheets in the scope in order to collect the viewport and device
dependent media results correctly. This already done forced by the
FullStyleUpdate in parseAttribute, but we want to minimize the changes
here with async style update and ruleset based invalidations by marking
the treeScope dirty, and if nothing changed, invalidate no style.
However, we need to re-add global rule data, or at least the media
query results.
Example: say that we have a window width of 800px below. After the
media attribute has been changed, we don't need to recalculate any
styles, but we need to make sure we detect style changes crossing the
width of 2000px instead of 1000px.
<style media="(min-width: 1000px)"> ... </style>
<script>
styleElement.setAttribute("media", "(min-width: 2000px");
</script>
R=meade@chromium.org
BUG=567021
Committed: https://crrev.com/f46992525f72e0bdf4331f8cf6fcc31602f307e7
Cr-Commit-Position: refs/heads/master@{#437213}
Patch Set 1 #Patch Set 2 : TreeScope should always be dirty. #Patch Set 3 : Rebased #
Depends on Patchset: Dependent Patchsets: Messages
Total messages: 12 (7 generated)
|