[functions] Support @media within @function This adds support for "functional" media queries, which evaluate during value computation rather than during RuleSet building. Although it would probably be possible to also handle @media within @function on the rule level rather than value level, the value level approach was chosen since it will be required anyway for the if() notation in the future [1]. Since the existing invalidation path for @media is RuleSet based, this CL implements a new invalidation strategy: - ComputedStyles affected by functional media are marked as such. - Functional MQs are evaluated during StyleCascade, and the results are stored on StyleEngine. - When media values change, we check the stored results for changes. If there was a change in evaluation, we invalidate all elements marked as affected by functional media. It is possible invalidate even more narrowly, e.g. track which specific elements depend on which specific media queries, but for now this seems to strike a reasonable balance. StyleEngine must also keep track of some flags from the functional MQ evaluation, otherwise ParentLayoutUpgrade will not understand that there is a parent frame dependency. [1] https://drafts.csswg.org/css-values-5/#if-notation Bug: 325504770 Change-Id: I5ac00afc165826e9ce7789fba7fa6e4f0d6c0bf6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6234272 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/main@{#1417299}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.