Commit 7a61ba57 authored by rob.buis@samsung.com's avatar rob.buis@samsung.com

border-radius cssText always outputs to longhand properties

Prefer to keep the border-radius for cssText output if it is
explictly used.

Matches FireFox behavior.

BUG=407012

Review URL: https://codereview.chromium.org/547043002

git-svn-id: svn://svn.chromium.org/blink/trunk@181942 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 021a90a5
Test for Bug 407012: border-radius shorthand is always splitted to longhand properties in CSSStyleRule.cssText.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS document.styleSheets[0].rules[0].cssText is '#target { border-radius: 5px; }'
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML>
<html>
<style>
#target {
border-radius: 5px;
}
</style>
<div id="target"></div>
<script src="../../resources/js-test.js"></script>
<script>
if (window.testRunner)
testRunner.dumpAsText();
description("Test for Bug 407012: border-radius shorthand is always splitted to longhand properties in CSSStyleRule.cssText.");
var element = document.getElementById("target");
shouldBe("document.styleSheets[0].rules[0].cssText","'#target { border-radius: 5px; }'");
</script>
</html>
...@@ -33,10 +33,10 @@ Removing border-width ...@@ -33,10 +33,10 @@ Removing border-width
removes "border" removes "border"
and adds "border-style, border-color". and adds "border-style, border-color".
Removing border-radius Removing border-radius
removes "border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius" removes "border-radius"
and adds "". and adds "".
Removing -webkit-border-radius Removing -webkit-border-radius
removes "border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius" removes "border-radius"
and adds "". and adds "".
Removing border-spacing Removing border-spacing
removes "border-spacing" removes "border-spacing"
......
...@@ -123,6 +123,12 @@ String StylePropertySerializer::asText() const ...@@ -123,6 +123,12 @@ String StylePropertySerializer::asText() const
if (!shorthandPropertyID) if (!shorthandPropertyID)
shorthandPropertyID = borderFallbackShorthandProperty; shorthandPropertyID = borderFallbackShorthandProperty;
break; break;
case CSSPropertyBorderTopLeftRadius:
case CSSPropertyBorderTopRightRadius:
case CSSPropertyBorderBottomLeftRadius:
case CSSPropertyBorderBottomRightRadius:
shorthandPropertyID = CSSPropertyBorderRadius;
break;
case CSSPropertyWebkitBorderHorizontalSpacing: case CSSPropertyWebkitBorderHorizontalSpacing:
case CSSPropertyWebkitBorderVerticalSpacing: case CSSPropertyWebkitBorderVerticalSpacing:
shorthandPropertyID = CSSPropertyBorderSpacing; shorthandPropertyID = CSSPropertyBorderSpacing;
......
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