mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Implement the unitless length quirk for margin
This commit is contained in:
parent
bcc6d4580d
commit
2aea6d8907
3 changed files with 7 additions and 33 deletions
|
@ -809,7 +809,8 @@
|
|||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="four_sides_shorthand(name, sub_property_pattern, parser_function, needs_context=True, **kwargs)">
|
||||
<%def name="four_sides_shorthand(name, sub_property_pattern, parser_function,
|
||||
needs_context=True, allow_quirks=False, **kwargs)">
|
||||
<% sub_properties=' '.join(sub_property_pattern % side for side in ['top', 'right', 'bottom', 'left']) %>
|
||||
<%call expr="self.shorthand(name, sub_properties=sub_properties, **kwargs)">
|
||||
#[allow(unused_imports)]
|
||||
|
@ -819,7 +820,9 @@
|
|||
|
||||
pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result<Longhands, ()> {
|
||||
let (top, right, bottom, left) =
|
||||
% if needs_context:
|
||||
% if allow_quirks:
|
||||
try!(parse_four_sides(input, |i| ${parser_function}_quirky(context, i, specified::AllowQuirks::Yes)));
|
||||
% elif needs_context:
|
||||
try!(parse_four_sides(input, |i| ${parser_function}(context, i)));
|
||||
% else:
|
||||
try!(parse_four_sides(input, ${parser_function}));
|
||||
|
|
|
@ -6,4 +6,5 @@
|
|||
|
||||
${helpers.four_sides_shorthand("margin", "margin-%s", "specified::LengthOrPercentageOrAuto::parse",
|
||||
spec="https://drafts.csswg.org/css-box/#propdef-margin",
|
||||
allowed_in_page_rule=True)}
|
||||
allowed_in_page_rule=True,
|
||||
allow_quirks=True)}
|
||||
|
|
|
@ -12,9 +12,6 @@
|
|||
expected:
|
||||
if os == "mac": FAIL
|
||||
|
||||
[margin: 1 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[max-height: 1 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -75,9 +72,6 @@
|
|||
expected:
|
||||
if os == "mac": FAIL
|
||||
|
||||
[margin: +1 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[max-height: +1 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -138,9 +132,6 @@
|
|||
expected:
|
||||
if os == "mac": FAIL
|
||||
|
||||
[margin: -1 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[padding: -1 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -177,9 +168,6 @@
|
|||
expected:
|
||||
if os == "mac": FAIL
|
||||
|
||||
[margin: 1.5 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[max-height: 1.5 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -240,9 +228,6 @@
|
|||
expected:
|
||||
if os == "mac": FAIL
|
||||
|
||||
[margin: +1.5 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[max-height: +1.5 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -303,9 +288,6 @@
|
|||
expected:
|
||||
if os == "mac": FAIL
|
||||
|
||||
[margin: -1.5 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[padding: -1.5 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -1314,27 +1296,15 @@
|
|||
expected:
|
||||
if os == "mac": FAIL
|
||||
|
||||
[margin: 1px 2 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[padding: 1px 2 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[margin: 1 2px (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[padding: 1 2px (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[margin: 1 +2 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[padding: 1 +2 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[margin: 1 -2 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
[padding: 1 -2 (quirks)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue