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

CSS: Deprecate support for position values with 3 parts

For context see
https://github.com/w3c/csswg-drafts/issues/2140

Intent:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/oBKMVCOX1sY/BLsXXiukAgAJ

Bug: 804187
Change-Id: I8a430943a5d873a55055654bcef2365d40dd71e3
Reviewed-on: https://chromium-review.googlesource.com/892838
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: default avatarnainar <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533102}
parent 60cd6325
CONSOLE WARNING: Expressing a position using 3 parts is deprecated and will be removed in M68, around July 2018. Please use <position> syntax instead. See https://www.chromestatus.com/features/5116559680864256 for more details.
CONSOLE WARNING: Expressing a position using 3 parts is deprecated and will be removed in M68, around July 2018. Please use <position> syntax instead. See https://www.chromestatus.com/features/5116559680864256 for more details.
CONSOLE WARNING: Expressing a position using 3 parts is deprecated and will be removed in M68, around July 2018. Please use <position> syntax instead. See https://www.chromestatus.com/features/5116559680864256 for more details.
CONSOLE WARNING: Expressing a position using 3 parts is deprecated and will be removed in M68, around July 2018. Please use <position> syntax instead. See https://www.chromestatus.com/features/5116559680864256 for more details.
<!DOCTYPE html>
<style>
#a {
/* Each of the four <position> contexts generates a warning. */
object-position: center left 1px;
perspective-origin: center top 2px;
background-image: conic-gradient(at right 3% center, black, red);
clip-path: circle(at left 4px top);
}
#b {
/* These <position> contexts have already been counted.
No additional warnings are generated.*/
object-position: right top 5px;
perspective-origin: bottom 6% center;
background-image: conic-gradient(at bottom 7% left, black, red);
clip-path: circle(at bottom right 8%);
}
#c {
/* Valid <bg-position>, so no warning generated. */
background-position: center left 1px;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
}
</script>
CONSOLE WARNING: line 24: Expressing a position using 3 parts is deprecated and will be removed in M68, around July 2018. Please use <position> syntax instead. See https://www.chromestatus.com/features/5116559680864256 for more details.
This tests checks that all of the input values for object-position parse correctly. This tests checks that all of the input values for object-position parse correctly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
shouldBeEqualToString('testComputedStyle("object-position: 10px 10px;")', '10px 10px'); shouldBeEqualToString('testComputedStyle("object-position: 10px 10px;")', '10px 10px');
shouldBeEqualToString('testComputedStyle("object-position: right top;")', '100% 0%'); shouldBeEqualToString('testComputedStyle("object-position: right top;")', '100% 0%');
shouldBeEqualToString('testComputedStyle("object-position: top right;")', '100% 0%'); shouldBeEqualToString('testComputedStyle("object-position: top right;")', '100% 0%');
shouldBeEqualToString('testComputedStyle("object-position: left 20px center;")', '20px 50%'); shouldBeEqualToString('testComputedStyle("object-position: left 20px center;")', '20px 50%'); // Deprecated
shouldBeEqualToString('testComputedStyle("object-position: center bottom 25%;")', '50% 75%'); shouldBeEqualToString('testComputedStyle("object-position: center bottom 25%;")', '50% 75%');
shouldBeEqualToString('testComputedStyle("object-position: bottom 20px right 12px;")', 'calc(-12px + 100%) calc(-20px + 100%)'); shouldBeEqualToString('testComputedStyle("object-position: bottom 20px right 12px;")', 'calc(-12px + 100%) calc(-20px + 100%)');
......
CONSOLE WARNING: line 199: Expressing a position using 3 parts is deprecated and will be removed in M68, around July 2018. Please use <position> syntax instead. See https://www.chromestatus.com/features/5116559680864256 for more details.
Testing parsing of the shape-outside property. Testing parsing of the shape-outside property.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
......
...@@ -900,7 +900,10 @@ bool ConsumePosition(CSSParserTokenRange& range, ...@@ -900,7 +900,10 @@ bool ConsumePosition(CSSParserTokenRange& range,
PositionFromTwoValues(value1, value2, result_x, result_y); PositionFromTwoValues(value1, value2, result_x, result_y);
return true; return true;
} }
context.Count(*threeValuePosition); if (*threeValuePosition == WebFeature::kThreeValuedPositionBackground)
context.Count(*threeValuePosition);
else
context.CountDeprecation(*threeValuePosition);
} }
CSSValue* values[5]; CSSValue* values[5];
......
...@@ -608,6 +608,15 @@ DeprecationInfo GetDeprecationInfo(WebFeature feature) { ...@@ -608,6 +608,15 @@ DeprecationInfo GetDeprecationInfo(WebFeature feature) {
return {"ChromeLoadTimesWasAlternateProtocolAvailable", Unknown, return {"ChromeLoadTimesWasAlternateProtocolAvailable", Unknown,
chromeLoadTimesNextHopProtocol}; chromeLoadTimesNextHopProtocol};
case WebFeature::kThreeValuedPositionBasicShape:
case WebFeature::kThreeValuedPositionGradient:
case WebFeature::kThreeValuedPositionObjectPosition:
case WebFeature::kThreeValuedPositionPerspectiveOrigin:
return {
"ThreeValuedPosition", M68,
replacedWillBeRemoved("Expressing a position using 3 parts",
"<position> syntax", M68, "5116559680864256")};
// Features that aren't deprecated don't have a deprecation message. // Features that aren't deprecated don't have a deprecation message.
default: default:
return {"NotDeprecated", Unknown, ""}; return {"NotDeprecated", Unknown, ""};
......
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