servo/components/style/stylesheets
Emilio Cobos Álvarez 8bb7d98f0c style: Add support for the revert-layer keyword
This patch looks bigger than it is, but it's mostly because
of plumbing.

To implement revert-layer we need not only the cascade origin of the
declaration, but the whole cascade level, plus also the layer order.

In order to do this, encapsulate these two things inside a 32-bit
`CascadePriority` struct and plumb it through the rule tree and so on.
This allows us to remove the packing and unpacking of CascadeLevel,
though I kept the ShadowCascadeOrder limit for now in case we need to
reintroduce it.

Fix `!important` behavior of layers while at it (implementing it in
`CascadeLevel::cmp`, spec quote included since it was tricky to find)
since some revert-layer tests were depending on it.

The style attribute test is failing now, but follow-up commit fixes
it, see spec issue.

In terms of the actual keyword implementation, it's sort of
straight-forward: We implement revert and revert-layer in a shared
way, by storing the cascade priority that reverted it.

Differential Revision: https://phabricator.services.mozilla.com/D133372
2023-06-09 10:22:22 +02:00
..
cascading_at_rule.rs style: Separate out some of the declaration precedence components from @viewport rules 2021-02-26 16:44:05 +01:00
counter_style_rule.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
document_rule.rs Rustfmt. 2021-02-26 16:44:05 +01:00
font_face_rule.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
font_feature_values_rule.rs style: Tweak at-rule parsing APIs to support cascade layers 2023-05-26 15:23:26 +02:00
import_rule.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
keyframes_rule.rs style: Update layer ordering to follow the spec 2023-05-31 00:50:33 +02:00
layer_rule.rs style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
loader.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
media_rule.rs style: Add derived ToShmem implementations. 2019-04-12 12:19:52 +02:00
mod.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
namespace_rule.rs style: Fix serialization of @namespace rule. 2019-12-16 14:23:56 +01:00
origin.rs style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
page_rule.rs style: Add derived ToShmem implementations. 2019-04-12 12:19:52 +02:00
rule_list.rs style: Reformat recent changes. 2020-04-16 17:50:17 +02:00
rule_parser.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
rules_iterator.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
scroll_timeline_rule.rs style: Part 10: Make source and scroll-offsets accept only default value 2023-06-09 10:22:22 +02:00
style_rule.rs style: Add derived ToShmem implementations. 2019-04-12 12:19:52 +02:00
stylesheet.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
supports_rule.rs style: Allow matches() / querySelector() / etc on chrome docs to access chrome-only selectors. r=boris 2023-06-09 10:22:18 +02:00
viewport_rule.rs Simplify our setup for font metric queries from style 2023-05-11 21:02:15 +02:00