mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Restrict properties that apply to ::marker for now.
Differential Revision: https://phabricator.services.mozilla.com/D31680
This commit is contained in:
parent
b8873f44aa
commit
3530ea9862
7 changed files with 40 additions and 30 deletions
|
@ -182,13 +182,18 @@ impl PseudoElement {
|
|||
/// Property flag that properties must have to apply to this pseudo-element.
|
||||
#[inline]
|
||||
pub fn property_restriction(&self) -> Option<PropertyFlags> {
|
||||
match *self {
|
||||
PseudoElement::FirstLetter => Some(PropertyFlags::APPLIES_TO_FIRST_LETTER),
|
||||
PseudoElement::FirstLine => Some(PropertyFlags::APPLIES_TO_FIRST_LINE),
|
||||
PseudoElement::Placeholder => Some(PropertyFlags::APPLIES_TO_PLACEHOLDER),
|
||||
PseudoElement::Cue => Some(PropertyFlags::APPLIES_TO_CUE),
|
||||
_ => None,
|
||||
}
|
||||
Some(match *self {
|
||||
PseudoElement::FirstLetter => PropertyFlags::APPLIES_TO_FIRST_LETTER,
|
||||
PseudoElement::FirstLine => PropertyFlags::APPLIES_TO_FIRST_LINE,
|
||||
PseudoElement::Placeholder => PropertyFlags::APPLIES_TO_PLACEHOLDER,
|
||||
PseudoElement::Cue => PropertyFlags::APPLIES_TO_CUE,
|
||||
PseudoElement::Marker
|
||||
if unsafe { structs::StaticPrefs::sVarCache_layout_css_marker_restricted } =>
|
||||
{
|
||||
PropertyFlags::APPLIES_TO_MARKER
|
||||
},
|
||||
_ => return None,
|
||||
})
|
||||
}
|
||||
|
||||
/// Whether this pseudo-element should actually exist if it has
|
||||
|
|
|
@ -13,6 +13,7 @@ ${helpers.predefined_type(
|
|||
initial_specified_value="specified::Content::normal()",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-content/#propdef-content",
|
||||
flags="APPLIES_TO_MARKER",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
)}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ ${helpers.predefined_type(
|
|||
"FontFamily",
|
||||
initial_value="computed::FontFamily::serif()",
|
||||
animation_value_type="discrete",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-family",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
)}
|
||||
|
@ -23,7 +23,7 @@ ${helpers.predefined_type(
|
|||
initial_value="computed::FontStyle::normal()",
|
||||
initial_specified_value="specified::FontStyle::normal()",
|
||||
animation_value_type="FontStyle",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-style",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
)}
|
||||
|
@ -42,7 +42,7 @@ ${helpers.single_keyword_system(
|
|||
gecko_ffi_name="mFont.variantCaps",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-caps",
|
||||
custom_consts=font_variant_caps_custom_consts,
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
animation_value_type="discrete",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
)}
|
||||
|
@ -53,7 +53,7 @@ ${helpers.predefined_type(
|
|||
initial_value="computed::FontWeight::normal()",
|
||||
initial_specified_value="specified::FontWeight::normal()",
|
||||
animation_value_type="Number",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-weight",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
)}
|
||||
|
@ -65,7 +65,7 @@ ${helpers.predefined_type(
|
|||
initial_specified_value="specified::FontSize::medium()",
|
||||
animation_value_type="NonNegativeLength",
|
||||
allow_quirks="Yes",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-size",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
)}
|
||||
|
@ -77,7 +77,7 @@ ${helpers.predefined_type(
|
|||
initial_value="computed::FontSizeAdjust::none()",
|
||||
initial_specified_value="specified::FontSizeAdjust::none()",
|
||||
animation_value_type="ComputedValue",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-size-adjust",
|
||||
)}
|
||||
|
||||
|
@ -87,7 +87,7 @@ ${helpers.predefined_type(
|
|||
products="gecko",
|
||||
initial_value="specified::FontSynthesis::get_initial_value()",
|
||||
animation_value_type="discrete",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-synthesis",
|
||||
)}
|
||||
|
||||
|
@ -97,7 +97,7 @@ ${helpers.predefined_type(
|
|||
initial_value="computed::FontStretch::hundred()",
|
||||
initial_specified_value="specified::FontStretch::normal()",
|
||||
animation_value_type="Percentage",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-stretch",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
)}
|
||||
|
@ -109,7 +109,7 @@ ${helpers.single_keyword_system(
|
|||
gecko_ffi_name="mFont.kerning",
|
||||
gecko_constant_prefix="NS_FONT_KERNING",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-kerning",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
animation_value_type="discrete",
|
||||
)}
|
||||
|
||||
|
@ -120,7 +120,7 @@ ${helpers.predefined_type(
|
|||
initial_value="computed::FontVariantAlternates::get_initial_value()",
|
||||
initial_specified_value="specified::FontVariantAlternates::get_initial_specified_value()",
|
||||
animation_value_type="discrete",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-alternates",
|
||||
)}
|
||||
|
||||
|
@ -131,7 +131,7 @@ ${helpers.predefined_type(
|
|||
initial_value="computed::FontVariantEastAsian::empty()",
|
||||
initial_specified_value="specified::FontVariantEastAsian::empty()",
|
||||
animation_value_type="discrete",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-east-asian",
|
||||
)}
|
||||
|
||||
|
@ -142,7 +142,7 @@ ${helpers.predefined_type(
|
|||
initial_value="computed::FontVariantLigatures::empty()",
|
||||
initial_specified_value="specified::FontVariantLigatures::empty()",
|
||||
animation_value_type="discrete",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-ligatures",
|
||||
)}
|
||||
|
||||
|
@ -153,7 +153,7 @@ ${helpers.predefined_type(
|
|||
initial_value="computed::FontVariantNumeric::empty()",
|
||||
initial_specified_value="specified::FontVariantNumeric::empty()",
|
||||
animation_value_type="discrete",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-numeric",
|
||||
)}
|
||||
|
||||
|
@ -164,7 +164,7 @@ ${helpers.single_keyword_system(
|
|||
gecko_ffi_name="mFont.variantPosition",
|
||||
gecko_constant_prefix="NS_FONT_VARIANT_POSITION",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-variant-position",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
animation_value_type="discrete",
|
||||
)}
|
||||
|
||||
|
@ -176,7 +176,7 @@ ${helpers.predefined_type(
|
|||
initial_specified_value="specified::FontFeatureSettings::normal()",
|
||||
extra_prefixes="moz:layout.css.prefixes.font-features",
|
||||
animation_value_type="discrete",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-feature-settings",
|
||||
)}
|
||||
|
||||
|
@ -195,7 +195,7 @@ ${helpers.predefined_type(
|
|||
initial_value="computed::FontVariationSettings::normal()",
|
||||
initial_specified_value="specified::FontVariationSettings::normal()",
|
||||
animation_value_type="ComputedValue",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="${variation_spec}",
|
||||
)}
|
||||
|
||||
|
@ -207,7 +207,7 @@ ${helpers.predefined_type(
|
|||
initial_specified_value="specified::FontLanguageOverride::normal()",
|
||||
animation_value_type="discrete",
|
||||
extra_prefixes="moz:layout.css.prefixes.font-features",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://drafts.csswg.org/css-fonts-3/#propdef-font-language-override",
|
||||
)}
|
||||
|
||||
|
@ -219,7 +219,7 @@ ${helpers.single_keyword_system(
|
|||
gecko_ffi_name="mFont.opticalSizing",
|
||||
gecko_constant_prefix="NS_FONT_OPTICAL_SIZING",
|
||||
animation_value_type="discrete",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
spec="https://www.w3.org/TR/css-fonts-4/#font-optical-sizing-def",
|
||||
)}
|
||||
|
||||
|
@ -514,7 +514,7 @@ ${helpers.single_keyword(
|
|||
gecko_pref="layout.css.osx-font-smoothing.enabled",
|
||||
products="gecko",
|
||||
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth)",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
animation_value_type="discrete",
|
||||
)}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ ${helpers.single_keyword(
|
|||
animation_value_type="none",
|
||||
spec="https://drafts.csswg.org/css-writing-modes/#propdef-direction",
|
||||
needs_conversion=True,
|
||||
flags="APPLIES_TO_MARKER",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
)}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ ${helpers.predefined_type(
|
|||
"ColorPropertyValue",
|
||||
"::cssparser::RGBA::new(0, 0, 0, 255)",
|
||||
animation_value_type="AnimatedRGBA",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER APPLIES_TO_MARKER",
|
||||
ignored_when_colors_disabled="True",
|
||||
spec="https://drafts.csswg.org/css-color/#color",
|
||||
)}
|
||||
|
@ -349,7 +349,7 @@ ${helpers.single_keyword(
|
|||
products="gecko",
|
||||
animation_value_type="discrete",
|
||||
spec="https://drafts.csswg.org/css-writing-modes-3/#text-combine-upright",
|
||||
flags="APPLIES_TO_CUE",
|
||||
flags="APPLIES_TO_CUE APPLIES_TO_MARKER",
|
||||
)}
|
||||
|
||||
// SVG 1.1: Section 11 - Painting: Filling, Stroking and Marker Symbols
|
||||
|
|
|
@ -23,6 +23,7 @@ ${helpers.single_keyword(
|
|||
"normal embed isolate bidi-override isolate-override plaintext",
|
||||
animation_value_type="none",
|
||||
spec="https://drafts.csswg.org/css-writing-modes/#propdef-unicode-bidi",
|
||||
flags="APPLIES_TO_MARKER",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
)}
|
||||
|
||||
|
|
|
@ -956,13 +956,15 @@ bitflags! {
|
|||
const APPLIES_TO_PLACEHOLDER = 1 << 5;
|
||||
/// This longhand property applies to ::cue.
|
||||
const APPLIES_TO_CUE = 1 << 6;
|
||||
/// This longhand property applies to ::marker.
|
||||
const APPLIES_TO_MARKER = 1 << 7;
|
||||
/// This property's getComputedStyle implementation requires layout
|
||||
/// to be flushed.
|
||||
const GETCS_NEEDS_LAYOUT_FLUSH = 1 << 7;
|
||||
const GETCS_NEEDS_LAYOUT_FLUSH = 1 << 8;
|
||||
/// This property is a legacy shorthand.
|
||||
///
|
||||
/// https://drafts.csswg.org/css-cascade/#legacy-shorthand
|
||||
const IS_LEGACY_SHORTHAND = 1 << 8;
|
||||
const IS_LEGACY_SHORTHAND = 1 << 9;
|
||||
|
||||
/* The following flags are currently not used in Rust code, they
|
||||
* only need to be listed in corresponding properties so that
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue