Commit a735176e authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

CSS: transform-origin does not accept top <length>

Spec:
https://drafts.csswg.org/css-transforms/#propdef-transform-origin

Blink no longer accepts transform-origin 'top 1px'. We previously
parsed it as 'top center 1px'.

Edge/Firefox/WebKit already reject such values.

BUG=855787

Change-Id: I8ac8745d41c867a2ef659ce9afe17143d60a1806
Reviewed-on: https://chromium-review.googlesource.com/1112883Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570139}
parent 7dd7d795
......@@ -12,6 +12,8 @@
</head>
<body>
<script>
test_invalid_value("background-image", "radial-gradient(at top 0px, red, blue)");
// The following were supported in an earlier version of the spec.
// https://github.com/w3c/csswg-drafts/issues/2140
// Deprecated in Blink with support to be removed in M68, around July 2018.
......
......@@ -50,4 +50,6 @@ expect('10% 20% 30%').isInvalid();
expect('top 10%').isInvalid();
expect('bottom 10%').isInvalid();
expect('50% 50% 0px 0px').isInvalid();
expect('top 0px').isInvalid();
expect('bottom 0px').isInvalid();
</script>
......@@ -940,10 +940,13 @@ bool ConsumeOneOrTwoValuedPosition(CSSParserTokenRange& range,
if (!value1->IsIdentifierValue())
horizontal_edge = true;
CSSValue* value2 = nullptr;
if (!vertical_edge || range.Peek().GetType() == kIdentToken)
value2 = ConsumePositionComponent(range, css_parser_mode, unitless,
horizontal_edge, vertical_edge);
if (vertical_edge && ConsumeLengthOrPercent(range, css_parser_mode,
kValueRangeAll, unitless)) {
// <length-percentage> is not permitted after top | bottom.
return false;
}
CSSValue* value2 = ConsumePositionComponent(range, css_parser_mode, unitless,
horizontal_edge, vertical_edge);
if (!value2) {
PositionFromOneValue(value1, result_x, result_y);
return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment