servo/components/style
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
..
counter_style style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
gecko style: Use titlebar radius on Linux and make titlebar set-up work for lightweight themes 2023-06-09 10:22:22 +02:00
gecko_bindings style: Unify font-family storage 2023-05-24 18:32:35 +02:00
gecko_string_cache Miscellaneous build / tidy fixes. 2021-02-26 17:53:55 +01:00
invalidation style: Part 8: Hook scroll-timeline rule into Cascade data and use it for CSS animations 2023-06-09 10:22:22 +02:00
media_queries style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
properties style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
rule_tree style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
servo Further changes required by Servo 2023-06-09 10:22:21 +02:00
sharing style: Add attributes to the rule hash 2023-05-26 21:49:57 +02:00
stylesheets style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
use_counters style: Support css use counters for unimplemented properties. 2019-09-12 22:34:16 +02:00
values style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
animation.rs style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
applicable_declarations.rs style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
attr.rs Miscellaneous build / tidy fixes. 2021-02-26 17:53:55 +01:00
author_styles.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
bezier.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
bloom.rs Further changes required by Servo 2023-05-27 05:59:01 +02:00
build.rs Add build github actions workflows for mac/windows/linux. 2021-02-26 04:20:22 -05:00
build_gecko.rs style: Setup bindgen flags for servo similarly to cranelift and neqo 2023-05-24 18:32:40 +02:00
Cargo.toml style: Remove the unused "gecko_profiler" feature from servo 2023-05-24 18:32:41 +02:00
context.rs style: Paper over a crash in non-nightly 2023-05-16 12:55:42 +02:00
custom_properties.rs style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
data.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
dom.rs Further changes required by Servo 2023-05-27 05:59:01 +02:00
dom_apis.rs Miscellaneous build / tidy fixes. 2021-02-26 17:53:55 +01:00
driver.rs Further changes required by Servo 2023-05-24 18:32:40 +02:00
element_state.rs style: Add a Show Password button to <input type=password> controls 2023-06-09 10:22:21 +02:00
encoding_support.rs style: Remove some unused extern crate declarations now that style is in rust 2018. 2020-06-18 23:51:18 +02:00
error_reporting.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
font_face.rs Further changes required by Servo 2023-05-16 22:58:48 +02:00
font_metrics.rs style: Add support for the 'ic' font-relative unit 2023-06-09 10:22:22 +02:00
global_style_data.rs Layout-2020: Serialize access to stylo thread pool. 2023-05-26 20:09:50 +05:30
hash.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
lib.rs Further changes required by Servo 2023-05-24 18:32:40 +02:00
logical_geometry.rs Rustfmt recent changes. 2019-12-16 14:23:56 +01:00
macros.rs style: Remove the old profiler label frames code in the servo codebase and replace it with the new API 2023-05-24 18:32:40 +02:00
matching.rs style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
parallel.rs Layout-2020: Fix debug mode crash for servo.org 2023-05-26 20:09:50 +05:30
parser.rs Rustfmt. 2021-02-26 16:44:05 +01:00
README.md Update link 2020-04-28 09:09:54 -07:00
rule_cache.rs style: Undo minor debugging change. 2019-11-30 20:45:07 +01:00
rule_collector.rs style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
rustfmt.toml Disable formatting for components/style/ 2023-05-15 17:45:25 +02:00
scoped_tls.rs Replace ScopedTLS::unsafe_get by ScopedTLS::into_slots 2020-04-05 01:20:39 +02:00
selector_map.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
selector_parser.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
shared_lock.rs style: Run rustfmt on servo/components/style and servo/ports/geckolib 2023-06-09 10:22:19 +02:00
str.rs Miscellaneous build / tidy fixes. 2021-02-26 17:53:55 +01:00
style_adjuster.rs style: Top layer elements that are display:contents should be display: block 2023-06-09 10:22:20 +02:00
style_resolver.rs Simplify our setup for font metric queries from style 2023-05-11 21:02:15 +02:00
stylesheet_set.rs style: Share CascadeData instances across ShadowRoots 2023-05-16 13:00:08 +02:00
stylist.rs style: Add support for the revert-layer keyword 2023-06-09 10:22:22 +02:00
thread_state.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
traversal.rs style: Use Option::as_deref() in style code. 2021-02-26 16:44:05 +01:00
traversal_flags.rs style: Cleanup unused style traversal flags. 2019-04-12 12:20:07 +02:00

servo-style

Style system for Servo, using rust-cssparser for parsing.