mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Support AllowQuirks::Always option in helpers.mako.rs
Differential Revision: https://phabricator.services.mozilla.com/D29936
This commit is contained in:
parent
f8a2172d42
commit
d552969ca1
14 changed files with 25 additions and 25 deletions
|
@ -172,7 +172,7 @@ class Longhand(object):
|
||||||
gecko_ffi_name=None,
|
gecko_ffi_name=None,
|
||||||
allowed_in_keyframe_block=True, cast_type='u8',
|
allowed_in_keyframe_block=True, cast_type='u8',
|
||||||
logical=False, logical_group=None, alias=None, extra_prefixes=None, boxed=False,
|
logical=False, logical_group=None, alias=None, extra_prefixes=None, boxed=False,
|
||||||
flags=None, allowed_in_page_rule=False, allow_quirks=False,
|
flags=None, allowed_in_page_rule=False, allow_quirks="No",
|
||||||
ignored_when_colors_disabled=False,
|
ignored_when_colors_disabled=False,
|
||||||
simple_vector_bindings=False,
|
simple_vector_bindings=False,
|
||||||
vector=False, servo_restyle_damage="repaint"):
|
vector=False, servo_restyle_damage="repaint"):
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<%def name="predefined_type(name, type, initial_value, parse_method='parse',
|
<%def name="predefined_type(name, type, initial_value, parse_method='parse',
|
||||||
needs_context=True, vector=False,
|
needs_context=True, vector=False,
|
||||||
computed_type=None, initial_specified_value=None,
|
computed_type=None, initial_specified_value=None,
|
||||||
allow_quirks=False, allow_empty=False, **kwargs)">
|
allow_quirks='No', allow_empty=False, **kwargs)">
|
||||||
<%def name="predefined_type_inner(name, type, initial_value, parse_method)">
|
<%def name="predefined_type_inner(name, type, initial_value, parse_method)">
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
use app_units::Au;
|
use app_units::Au;
|
||||||
|
@ -42,8 +42,8 @@
|
||||||
context: &ParserContext,
|
context: &ParserContext,
|
||||||
input: &mut Parser<'i, 't>,
|
input: &mut Parser<'i, 't>,
|
||||||
) -> Result<SpecifiedValue, ParseError<'i>> {
|
) -> Result<SpecifiedValue, ParseError<'i>> {
|
||||||
% if allow_quirks:
|
% if allow_quirks != "No":
|
||||||
specified::${type}::${parse_method}_quirky(context, input, AllowQuirks::Yes)
|
specified::${type}::${parse_method}_quirky(context, input, AllowQuirks::${allow_quirks})
|
||||||
% elif needs_context:
|
% elif needs_context:
|
||||||
specified::${type}::${parse_method}(context, input)
|
specified::${type}::${parse_method}(context, input)
|
||||||
% else:
|
% else:
|
||||||
|
@ -523,8 +523,8 @@
|
||||||
context: &ParserContext,
|
context: &ParserContext,
|
||||||
input: &mut Parser<'i, 't>,
|
input: &mut Parser<'i, 't>,
|
||||||
) -> Result<PropertyDeclaration, ParseError<'i>> {
|
) -> Result<PropertyDeclaration, ParseError<'i>> {
|
||||||
% if property.allow_quirks:
|
% if property.allow_quirks != "No":
|
||||||
parse_quirky(context, input, specified::AllowQuirks::Yes)
|
parse_quirky(context, input, specified::AllowQuirks::${property.allow_quirks})
|
||||||
% else:
|
% else:
|
||||||
parse(context, input)
|
parse(context, input)
|
||||||
% endif
|
% endif
|
||||||
|
@ -986,7 +986,7 @@
|
||||||
</%def>
|
</%def>
|
||||||
|
|
||||||
<%def name="four_sides_shorthand(name, sub_property_pattern, parser_function,
|
<%def name="four_sides_shorthand(name, sub_property_pattern, parser_function,
|
||||||
needs_context=True, allow_quirks=False, **kwargs)">
|
needs_context=True, allow_quirks='No', **kwargs)">
|
||||||
<% sub_properties=' '.join(sub_property_pattern % side for side in PHYSICAL_SIDES) %>
|
<% sub_properties=' '.join(sub_property_pattern % side for side in PHYSICAL_SIDES) %>
|
||||||
<%call expr="self.shorthand(name, sub_properties=sub_properties, **kwargs)">
|
<%call expr="self.shorthand(name, sub_properties=sub_properties, **kwargs)">
|
||||||
#[allow(unused_imports)]
|
#[allow(unused_imports)]
|
||||||
|
@ -999,8 +999,8 @@
|
||||||
input: &mut Parser<'i, 't>,
|
input: &mut Parser<'i, 't>,
|
||||||
) -> Result<Longhands, ParseError<'i>> {
|
) -> Result<Longhands, ParseError<'i>> {
|
||||||
let rect = Rect::parse_with(context, input, |_c, i| {
|
let rect = Rect::parse_with(context, input, |_c, i| {
|
||||||
% if allow_quirks:
|
% if allow_quirks != "No":
|
||||||
${parser_function}_quirky(_c, i, specified::AllowQuirks::Yes)
|
${parser_function}_quirky(_c, i, specified::AllowQuirks::${allow_quirks})
|
||||||
% elif needs_context:
|
% elif needs_context:
|
||||||
${parser_function}(_c, i)
|
${parser_function}(_c, i)
|
||||||
% else:
|
% else:
|
||||||
|
|
|
@ -14,7 +14,7 @@ ${helpers.predefined_type(
|
||||||
spec="https://drafts.csswg.org/css-backgrounds/#background-color",
|
spec="https://drafts.csswg.org/css-backgrounds/#background-color",
|
||||||
animation_value_type="AnimatedColor",
|
animation_value_type="AnimatedColor",
|
||||||
ignored_when_colors_disabled=True,
|
ignored_when_colors_disabled=True,
|
||||||
allow_quirks=True,
|
allow_quirks="Yes",
|
||||||
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER \
|
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER \
|
||||||
CAN_ANIMATE_ON_COMPOSITOR",
|
CAN_ANIMATE_ON_COMPOSITOR",
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
animation_value_type="AnimatedColor",
|
animation_value_type="AnimatedColor",
|
||||||
logical=is_logical,
|
logical=is_logical,
|
||||||
logical_group="border-color",
|
logical_group="border-color",
|
||||||
allow_quirks=not is_logical,
|
allow_quirks="No" if is_logical else "Yes",
|
||||||
flags="APPLIES_TO_FIRST_LETTER",
|
flags="APPLIES_TO_FIRST_LETTER",
|
||||||
ignored_when_colors_disabled=True,
|
ignored_when_colors_disabled=True,
|
||||||
)}
|
)}
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
logical=is_logical,
|
logical=is_logical,
|
||||||
logical_group="border-width",
|
logical_group="border-width",
|
||||||
flags="APPLIES_TO_FIRST_LETTER GETCS_NEEDS_LAYOUT_FLUSH",
|
flags="APPLIES_TO_FIRST_LETTER GETCS_NEEDS_LAYOUT_FLUSH",
|
||||||
allow_quirks=not is_logical,
|
allow_quirks="No" if is_logical else "Yes",
|
||||||
servo_restyle_damage="reflow rebuild_and_reflow_inline"
|
servo_restyle_damage="reflow rebuild_and_reflow_inline"
|
||||||
)}
|
)}
|
||||||
% endfor
|
% endfor
|
||||||
|
|
|
@ -38,7 +38,7 @@ ${helpers.predefined_type(
|
||||||
"computed::ClipRectOrAuto::auto()",
|
"computed::ClipRectOrAuto::auto()",
|
||||||
animation_value_type="ComputedValue",
|
animation_value_type="ComputedValue",
|
||||||
boxed=True,
|
boxed=True,
|
||||||
allow_quirks=True,
|
allow_quirks="Yes",
|
||||||
spec="https://drafts.fxtf.org/css-masking/#clip-property",
|
spec="https://drafts.fxtf.org/css-masking/#clip-property",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ ${helpers.predefined_type(
|
||||||
initial_value="computed::FontSize::medium()",
|
initial_value="computed::FontSize::medium()",
|
||||||
initial_specified_value="specified::FontSize::medium()",
|
initial_specified_value="specified::FontSize::medium()",
|
||||||
animation_value_type="NonNegativeLength",
|
animation_value_type="NonNegativeLength",
|
||||||
allow_quirks=True,
|
allow_quirks="Yes",
|
||||||
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-size",
|
spec="https://drafts.csswg.org/css-fonts/#propdef-font-size",
|
||||||
servo_restyle_damage="rebuild_and_reflow",
|
servo_restyle_damage="rebuild_and_reflow",
|
||||||
|
|
|
@ -56,7 +56,7 @@ ${helpers.predefined_type(
|
||||||
"computed::LengthPercentage::zero()",
|
"computed::LengthPercentage::zero()",
|
||||||
animation_value_type="ComputedValue",
|
animation_value_type="ComputedValue",
|
||||||
spec="https://drafts.csswg.org/css-text/#propdef-text-indent",
|
spec="https://drafts.csswg.org/css-text/#propdef-text-indent",
|
||||||
allow_quirks=True,
|
allow_quirks="Yes",
|
||||||
servo_restyle_damage = "reflow",
|
servo_restyle_damage = "reflow",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
"LengthPercentageOrAuto",
|
"LengthPercentageOrAuto",
|
||||||
"computed::LengthPercentageOrAuto::zero()",
|
"computed::LengthPercentageOrAuto::zero()",
|
||||||
alias=maybe_moz_logical_alias(product, side, "-moz-margin-%s"),
|
alias=maybe_moz_logical_alias(product, side, "-moz-margin-%s"),
|
||||||
allow_quirks=not side[1],
|
allow_quirks="No" if side[1] else "Yes",
|
||||||
animation_value_type="ComputedValue",
|
animation_value_type="ComputedValue",
|
||||||
logical=side[1],
|
logical=side[1],
|
||||||
logical_group="margin",
|
logical_group="margin",
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
logical_group="padding",
|
logical_group="padding",
|
||||||
spec=spec,
|
spec=spec,
|
||||||
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_PLACEHOLDER GETCS_NEEDS_LAYOUT_FLUSH",
|
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_PLACEHOLDER GETCS_NEEDS_LAYOUT_FLUSH",
|
||||||
allow_quirks=not side[1],
|
allow_quirks="No" if side[1] else "Yes",
|
||||||
servo_restyle_damage="reflow rebuild_and_reflow_inline"
|
servo_restyle_damage="reflow rebuild_and_reflow_inline"
|
||||||
)}
|
)}
|
||||||
% endfor
|
% endfor
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
spec="https://www.w3.org/TR/CSS2/visuren.html#propdef-%s" % side,
|
spec="https://www.w3.org/TR/CSS2/visuren.html#propdef-%s" % side,
|
||||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||||
animation_value_type="ComputedValue",
|
animation_value_type="ComputedValue",
|
||||||
allow_quirks=True,
|
allow_quirks="Yes",
|
||||||
servo_restyle_damage="reflow_out_of_flow",
|
servo_restyle_damage="reflow_out_of_flow",
|
||||||
logical_group="inset",
|
logical_group="inset",
|
||||||
)}
|
)}
|
||||||
|
@ -253,7 +253,7 @@ ${helpers.predefined_type(
|
||||||
"computed::Size::auto()",
|
"computed::Size::auto()",
|
||||||
logical=logical,
|
logical=logical,
|
||||||
logical_group="size",
|
logical_group="size",
|
||||||
allow_quirks=not logical,
|
allow_quirks="No" if logical else "Yes",
|
||||||
spec=spec % size,
|
spec=spec % size,
|
||||||
animation_value_type="Size",
|
animation_value_type="Size",
|
||||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||||
|
@ -266,7 +266,7 @@ ${helpers.predefined_type(
|
||||||
"computed::Size::auto()",
|
"computed::Size::auto()",
|
||||||
logical=logical,
|
logical=logical,
|
||||||
logical_group="min-size",
|
logical_group="min-size",
|
||||||
allow_quirks=not logical,
|
allow_quirks="No" if logical else "Yes",
|
||||||
spec=spec % size,
|
spec=spec % size,
|
||||||
animation_value_type="Size",
|
animation_value_type="Size",
|
||||||
servo_restyle_damage="reflow",
|
servo_restyle_damage="reflow",
|
||||||
|
@ -277,7 +277,7 @@ ${helpers.predefined_type(
|
||||||
"computed::MaxSize::none()",
|
"computed::MaxSize::none()",
|
||||||
logical=logical,
|
logical=logical,
|
||||||
logical_group="max-size",
|
logical_group="max-size",
|
||||||
allow_quirks=not logical,
|
allow_quirks="No" if logical else "Yes",
|
||||||
spec=spec % size,
|
spec=spec % size,
|
||||||
animation_value_type="MaxSize",
|
animation_value_type="MaxSize",
|
||||||
servo_restyle_damage="reflow",
|
servo_restyle_damage="reflow",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
${helpers.four_sides_shorthand("border-color", "border-%s-color", "specified::Color::parse",
|
${helpers.four_sides_shorthand("border-color", "border-%s-color", "specified::Color::parse",
|
||||||
spec="https://drafts.csswg.org/css-backgrounds/#border-color",
|
spec="https://drafts.csswg.org/css-backgrounds/#border-color",
|
||||||
allow_quirks=True)}
|
allow_quirks="Yes")}
|
||||||
|
|
||||||
${helpers.four_sides_shorthand(
|
${helpers.four_sides_shorthand(
|
||||||
"border-style",
|
"border-style",
|
||||||
|
|
|
@ -10,7 +10,7 @@ ${helpers.four_sides_shorthand(
|
||||||
"specified::LengthPercentageOrAuto::parse",
|
"specified::LengthPercentageOrAuto::parse",
|
||||||
spec="https://drafts.csswg.org/css-box/#propdef-margin",
|
spec="https://drafts.csswg.org/css-box/#propdef-margin",
|
||||||
allowed_in_page_rule=True,
|
allowed_in_page_rule=True,
|
||||||
allow_quirks=True,
|
allow_quirks="Yes",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${helpers.two_properties_shorthand(
|
${helpers.two_properties_shorthand(
|
||||||
|
|
|
@ -9,7 +9,7 @@ ${helpers.four_sides_shorthand(
|
||||||
"padding-%s",
|
"padding-%s",
|
||||||
"specified::NonNegativeLengthPercentage::parse",
|
"specified::NonNegativeLengthPercentage::parse",
|
||||||
spec="https://drafts.csswg.org/css-box-3/#propdef-padding",
|
spec="https://drafts.csswg.org/css-box-3/#propdef-padding",
|
||||||
allow_quirks=True,
|
allow_quirks="Yes",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${helpers.two_properties_shorthand(
|
${helpers.two_properties_shorthand(
|
||||||
|
|
|
@ -768,7 +768,7 @@ ${helpers.four_sides_shorthand(
|
||||||
"%s",
|
"%s",
|
||||||
"specified::LengthPercentageOrAuto::parse",
|
"specified::LengthPercentageOrAuto::parse",
|
||||||
spec="https://drafts.csswg.org/css-logical/#propdef-inset",
|
spec="https://drafts.csswg.org/css-logical/#propdef-inset",
|
||||||
allow_quirks=False,
|
allow_quirks="No",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
${helpers.two_properties_shorthand(
|
${helpers.two_properties_shorthand(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue