зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1383650 - Support AllowQuirks::Always option in helpers.mako.rs r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D29936 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
450fd61c0a
Коммит
19283c2c6c
|
@ -172,7 +172,7 @@ class Longhand(object):
|
|||
gecko_ffi_name=None,
|
||||
allowed_in_keyframe_block=True, cast_type='u8',
|
||||
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,
|
||||
vector=False, servo_restyle_damage="repaint"):
|
||||
self.name = name
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<%def name="predefined_type(name, type, initial_value, parse_method='parse',
|
||||
needs_context=True, vector=False,
|
||||
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)">
|
||||
#[allow(unused_imports)]
|
||||
use app_units::Au;
|
||||
|
@ -42,8 +42,8 @@
|
|||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<SpecifiedValue, ParseError<'i>> {
|
||||
% if allow_quirks:
|
||||
specified::${type}::${parse_method}_quirky(context, input, AllowQuirks::Yes)
|
||||
% if allow_quirks != "No":
|
||||
specified::${type}::${parse_method}_quirky(context, input, AllowQuirks::${allow_quirks})
|
||||
% elif needs_context:
|
||||
specified::${type}::${parse_method}(context, input)
|
||||
% else:
|
||||
|
@ -405,8 +405,8 @@
|
|||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<PropertyDeclaration, ParseError<'i>> {
|
||||
% if property.allow_quirks:
|
||||
parse_quirky(context, input, specified::AllowQuirks::Yes)
|
||||
% if property.allow_quirks != "No":
|
||||
parse_quirky(context, input, specified::AllowQuirks::${property.allow_quirks})
|
||||
% else:
|
||||
parse(context, input)
|
||||
% endif
|
||||
|
@ -868,7 +868,7 @@
|
|||
</%def>
|
||||
|
||||
<%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) %>
|
||||
<%call expr="self.shorthand(name, sub_properties=sub_properties, **kwargs)">
|
||||
#[allow(unused_imports)]
|
||||
|
@ -881,8 +881,8 @@
|
|||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Longhands, ParseError<'i>> {
|
||||
let rect = Rect::parse_with(context, input, |_c, i| {
|
||||
% if allow_quirks:
|
||||
${parser_function}_quirky(_c, i, specified::AllowQuirks::Yes)
|
||||
% if allow_quirks != "No":
|
||||
${parser_function}_quirky(_c, i, specified::AllowQuirks::${allow_quirks})
|
||||
% elif needs_context:
|
||||
${parser_function}(_c, i)
|
||||
% else:
|
||||
|
|
|
@ -14,7 +14,7 @@ ${helpers.predefined_type(
|
|||
spec="https://drafts.csswg.org/css-backgrounds/#background-color",
|
||||
animation_value_type="AnimatedColor",
|
||||
ignored_when_colors_disabled=True,
|
||||
allow_quirks=True,
|
||||
allow_quirks="Yes",
|
||||
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER \
|
||||
CAN_ANIMATE_ON_COMPOSITOR",
|
||||
)}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
animation_value_type="AnimatedColor",
|
||||
logical=is_logical,
|
||||
logical_group="border-color",
|
||||
allow_quirks=not is_logical,
|
||||
allow_quirks="No" if is_logical else "Yes",
|
||||
flags="APPLIES_TO_FIRST_LETTER",
|
||||
ignored_when_colors_disabled=True,
|
||||
)}
|
||||
|
@ -56,7 +56,7 @@
|
|||
logical=is_logical,
|
||||
logical_group="border-width",
|
||||
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"
|
||||
)}
|
||||
% endfor
|
||||
|
|
|
@ -37,7 +37,7 @@ ${helpers.predefined_type(
|
|||
"computed::ClipRectOrAuto::auto()",
|
||||
animation_value_type="ComputedValue",
|
||||
boxed=True,
|
||||
allow_quirks=True,
|
||||
allow_quirks="Yes",
|
||||
spec="https://drafts.fxtf.org/css-masking/#clip-property",
|
||||
)}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ ${helpers.predefined_type(
|
|||
initial_value="computed::FontSize::medium()",
|
||||
initial_specified_value="specified::FontSize::medium()",
|
||||
animation_value_type="NonNegativeLength",
|
||||
allow_quirks=True,
|
||||
allow_quirks="Yes",
|
||||
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
|
||||
spec="https://drafts.csswg.org/css-fonts/#propdef-font-size",
|
||||
servo_restyle_damage="rebuild_and_reflow",
|
||||
|
|
|
@ -56,7 +56,7 @@ ${helpers.predefined_type(
|
|||
"computed::LengthPercentage::zero()",
|
||||
animation_value_type="ComputedValue",
|
||||
spec="https://drafts.csswg.org/css-text/#propdef-text-indent",
|
||||
allow_quirks=True,
|
||||
allow_quirks="Yes",
|
||||
servo_restyle_damage = "reflow",
|
||||
)}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"LengthPercentageOrAuto",
|
||||
"computed::LengthPercentageOrAuto::zero()",
|
||||
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",
|
||||
logical=side[1],
|
||||
logical_group="margin",
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
logical_group="padding",
|
||||
spec=spec,
|
||||
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"
|
||||
)}
|
||||
% endfor
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
spec="https://www.w3.org/TR/CSS2/visuren.html#propdef-%s" % side,
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
animation_value_type="ComputedValue",
|
||||
allow_quirks=True,
|
||||
allow_quirks="Yes",
|
||||
servo_restyle_damage="reflow_out_of_flow",
|
||||
logical_group="inset",
|
||||
)}
|
||||
|
@ -253,7 +253,7 @@ ${helpers.predefined_type(
|
|||
"computed::Size::auto()",
|
||||
logical=logical,
|
||||
logical_group="size",
|
||||
allow_quirks=not logical,
|
||||
allow_quirks="No" if logical else "Yes",
|
||||
spec=spec % size,
|
||||
animation_value_type="Size",
|
||||
flags="GETCS_NEEDS_LAYOUT_FLUSH",
|
||||
|
@ -266,7 +266,7 @@ ${helpers.predefined_type(
|
|||
"computed::Size::auto()",
|
||||
logical=logical,
|
||||
logical_group="min-size",
|
||||
allow_quirks=not logical,
|
||||
allow_quirks="No" if logical else "Yes",
|
||||
spec=spec % size,
|
||||
animation_value_type="Size",
|
||||
servo_restyle_damage="reflow",
|
||||
|
@ -277,7 +277,7 @@ ${helpers.predefined_type(
|
|||
"computed::MaxSize::none()",
|
||||
logical=logical,
|
||||
logical_group="max-size",
|
||||
allow_quirks=not logical,
|
||||
allow_quirks="No" if logical else "Yes",
|
||||
spec=spec % size,
|
||||
animation_value_type="MaxSize",
|
||||
servo_restyle_damage="reflow",
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
${helpers.four_sides_shorthand("border-color", "border-%s-color", "specified::Color::parse",
|
||||
spec="https://drafts.csswg.org/css-backgrounds/#border-color",
|
||||
allow_quirks=True)}
|
||||
allow_quirks="Yes")}
|
||||
|
||||
${helpers.four_sides_shorthand(
|
||||
"border-style",
|
||||
|
|
|
@ -10,7 +10,7 @@ ${helpers.four_sides_shorthand(
|
|||
"specified::LengthPercentageOrAuto::parse",
|
||||
spec="https://drafts.csswg.org/css-box/#propdef-margin",
|
||||
allowed_in_page_rule=True,
|
||||
allow_quirks=True,
|
||||
allow_quirks="Yes",
|
||||
)}
|
||||
|
||||
${helpers.two_properties_shorthand(
|
||||
|
|
|
@ -9,7 +9,7 @@ ${helpers.four_sides_shorthand(
|
|||
"padding-%s",
|
||||
"specified::NonNegativeLengthPercentage::parse",
|
||||
spec="https://drafts.csswg.org/css-box-3/#propdef-padding",
|
||||
allow_quirks=True,
|
||||
allow_quirks="Yes",
|
||||
)}
|
||||
|
||||
${helpers.two_properties_shorthand(
|
||||
|
|
|
@ -768,7 +768,7 @@ ${helpers.four_sides_shorthand(
|
|||
"%s",
|
||||
"specified::LengthPercentageOrAuto::parse",
|
||||
spec="https://drafts.csswg.org/css-logical/#propdef-inset",
|
||||
allow_quirks=False,
|
||||
allow_quirks="No",
|
||||
)}
|
||||
|
||||
${helpers.two_properties_shorthand(
|
||||
|
|
Загрузка…
Ссылка в новой задаче