diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2020-02-11 23:05:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 23:05:37 -0500 |
commit | 6d6d16f7f492e6346f0391e352015226a4444806 (patch) | |
tree | d991c986a7f83be25157934e93c248ea86ee4b00 /components/style/properties/computed_value_flags.rs | |
parent | baac1e2c69d3b6e840ced2be4b5e03bb39bd40d5 (diff) | |
parent | d1f8d576f83714fe674a36c5b718341c236312e6 (diff) | |
download | servo-6d6d16f7f492e6346f0391e352015226a4444806.tar.gz servo-6d6d16f7f492e6346f0391e352015226a4444806.zip |
Auto merge of #25717 - emilio:gecko-sync, r=emilio,nox
style: Sync changes from mozilla-central.
See individual commits for details. https://bugzilla.mozilla.org/show_bug.cgi?id=1614394
Diffstat (limited to 'components/style/properties/computed_value_flags.rs')
-rw-r--r-- | components/style/properties/computed_value_flags.rs | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/components/style/properties/computed_value_flags.rs b/components/style/properties/computed_value_flags.rs index a86f8a4da3a..4363f3f36e9 100644 --- a/components/style/properties/computed_value_flags.rs +++ b/components/style/properties/computed_value_flags.rs @@ -11,6 +11,7 @@ bitflags! { /// anonymous boxes, see StyleBuilder::for_inheritance and its callsites. /// If we ever want to add some flags that shouldn't inherit for them, /// we might want to add a function to handle this. + #[repr(C)] pub struct ComputedValueFlags: u16 { /// Whether the style or any of the ancestors has a text-decoration-line /// property that should get propagated to descendants. @@ -63,6 +64,9 @@ bitflags! { /// /// Only used in Servo. const CAN_BE_FRAGMENTED = 1 << 10; + + /// Whether this style is the style of the document element. + const IS_ROOT_ELEMENT_STYLE = 1 << 11; } } @@ -71,9 +75,9 @@ impl ComputedValueFlags { #[inline] fn inherited_flags() -> Self { ComputedValueFlags::IS_RELEVANT_LINK_VISITED | - ComputedValueFlags::CAN_BE_FRAGMENTED | - ComputedValueFlags::IS_IN_PSEUDO_ELEMENT_SUBTREE | - ComputedValueFlags::HAS_TEXT_DECORATION_LINES + ComputedValueFlags::CAN_BE_FRAGMENTED | + ComputedValueFlags::IS_IN_PSEUDO_ELEMENT_SUBTREE | + ComputedValueFlags::HAS_TEXT_DECORATION_LINES } /// Flags that may be propagated to descendants. @@ -97,22 +101,3 @@ impl ComputedValueFlags { self & Self::maybe_inherited_flags() } } - -/// Asserts that the relevant servo and Gecko representations match. -#[cfg(feature = "gecko")] -#[inline] -pub fn assert_match() { - use crate::gecko_bindings::structs; - macro_rules! assert_bit { - ($rust:ident, $cpp:ident) => { - debug_assert_eq!(ComputedValueFlags::$rust.bits, structs::$cpp); - } - } - - assert_bit!(HAS_TEXT_DECORATION_LINES, ComputedStyleBit_HasTextDecorationLines); - assert_bit!(IS_IN_PSEUDO_ELEMENT_SUBTREE, ComputedStyleBit_HasPseudoElementData); - assert_bit!(SHOULD_SUPPRESS_LINEBREAK, ComputedStyleBit_SuppressLineBreak); - assert_bit!(IS_TEXT_COMBINED, ComputedStyleBit_IsTextCombined); - assert_bit!(IS_RELEVANT_LINK_VISITED, ComputedStyleBit_RelevantLinkVisited); - assert_bit!(DEPENDS_ON_FONT_METRICS, ComputedStyleBit_DependsOnFontMetrics); -} |