Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[CSS Exclusions] Update wrap-margin/padding to shape-margin/padding
https://bugs.webkit.org/show_bug.cgi?id=97736

Patch by Bem Jones-Bey <bjonesbe@adobe.com> on 2012-11-13
Reviewed by Andreas Kling.

Rename properties to match updated spec.

Source/WebCore:

Tests: fast/exclusions/shape-margin-parsing.html
       fast/exclusions/shape-padding-parsing.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::isSimpleLengthPropertyID):
(WebCore::CSSParser::parseValue):
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in:
* css/StyleBuilder.cpp:
(WebCore::StyleBuilder::StyleBuilder):
* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::asText):
* css/StylePropertyShorthand.cpp:
(WebCore::webkitWrapShorthand):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
(StyleRareNonInheritedData):

LayoutTests:

* fast/exclusions/css-exclusions-disabled-expected.txt:
* fast/exclusions/css-exclusions-disabled.html:
* fast/exclusions/script-tests/shape-margin-parsing.js: Added.
(test):
(testComputedStyle):
(testNotInherited):
* fast/exclusions/script-tests/shape-padding-parsing.js: Added.
(test):
(testComputedStyle):
(testNotInherited):
* fast/exclusions/script-tests/wrap-margin-parsing.js: Removed.
* fast/exclusions/script-tests/wrap-padding-parsing.js: Removed.
* fast/exclusions/script-tests/wrap-parsing.js:
(testComputedStyle):
* fast/exclusions/shape-margin-parsing-expected.txt: Added.
* fast/exclusions/shape-margin-parsing.html: Renamed from LayoutTests/fast/exclusions/wrap-padding-parsing.html.
* fast/exclusions/shape-padding-parsing-expected.txt: Added.
* fast/exclusions/shape-padding-parsing.html: Renamed from LayoutTests/fast/exclusions/wrap-margin-parsing.html.
* fast/exclusions/wrap-margin-parsing-expected.txt: Removed.
* fast/exclusions/wrap-padding-parsing-expected.txt: Removed.

Canonical link: https://commits.webkit.org/120170@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@134433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
bemjb authored and webkit-commit-queue committed Nov 13, 2012
1 parent b0d48a2 commit c3096fc
Show file tree
Hide file tree
Showing 27 changed files with 304 additions and 236 deletions.
30 changes: 30 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,33 @@
2012-11-13 Bem Jones-Bey <bjonesbe@adobe.com>

[CSS Exclusions] Update wrap-margin/padding to shape-margin/padding
https://bugs.webkit.org/show_bug.cgi?id=97736

Reviewed by Andreas Kling.

Rename properties to match updated spec.

* fast/exclusions/css-exclusions-disabled-expected.txt:
* fast/exclusions/css-exclusions-disabled.html:
* fast/exclusions/script-tests/shape-margin-parsing.js: Added.
(test):
(testComputedStyle):
(testNotInherited):
* fast/exclusions/script-tests/shape-padding-parsing.js: Added.
(test):
(testComputedStyle):
(testNotInherited):
* fast/exclusions/script-tests/wrap-margin-parsing.js: Removed.
* fast/exclusions/script-tests/wrap-padding-parsing.js: Removed.
* fast/exclusions/script-tests/wrap-parsing.js:
(testComputedStyle):
* fast/exclusions/shape-margin-parsing-expected.txt: Added.
* fast/exclusions/shape-margin-parsing.html: Renamed from LayoutTests/fast/exclusions/wrap-padding-parsing.html.
* fast/exclusions/shape-padding-parsing-expected.txt: Added.
* fast/exclusions/shape-padding-parsing.html: Renamed from LayoutTests/fast/exclusions/wrap-margin-parsing.html.
* fast/exclusions/wrap-margin-parsing-expected.txt: Removed.
* fast/exclusions/wrap-padding-parsing-expected.txt: Removed.

2012-11-13 Dimitri Glazkov <dglazkov@chromium.org>

Unreviewed, rolling out r134418.
Expand Down
Expand Up @@ -5,10 +5,10 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE

PASS testInlineStyle("-webkit-wrap-flow", "both") is null
PASS testComputedStyle("-webkit-wrap-flow", "both") is "auto"
PASS testInlineStyle("-webkit-wrap-margin", "10px") is null
PASS testComputedStyle("-webkit-wrap-margin", "10px") is "0px"
PASS testInlineStyle("-webkit-wrap-padding", "10px") is null
PASS testComputedStyle("-webkit-wrap-padding", "10px") is "0px"
PASS testInlineStyle("-webkit-shape-margin", "10px") is null
PASS testComputedStyle("-webkit-shape-margin", "10px") is "0px"
PASS testInlineStyle("-webkit-shape-padding", "10px") is null
PASS testComputedStyle("-webkit-shape-padding", "10px") is "0px"
PASS testInlineStyle("-webkit-wrap-through", "none") is null
PASS testComputedStyle("-webkit-wrap-through", "none") is "wrap"
PASS testInlineStyle("-webkit-shape-outside", "circle(10px, 10px, 10px)") is null
Expand Down
4 changes: 2 additions & 2 deletions LayoutTests/fast/exclusions/css-exclusions-disabled.html
Expand Up @@ -31,8 +31,8 @@

testStyle("-webkit-wrap-flow", "both", "auto");

testStyle("-webkit-wrap-margin", "10px", "0px");
testStyle("-webkit-wrap-padding", "10px", "0px");
testStyle("-webkit-shape-margin", "10px", "0px");
testStyle("-webkit-shape-padding", "10px", "0px");

testStyle("-webkit-wrap-through", "none", "wrap");

Expand Down
62 changes: 62 additions & 0 deletions LayoutTests/fast/exclusions/script-tests/shape-margin-parsing.js
@@ -0,0 +1,62 @@
description('Test parsing of the CSS shape-margin property.');

if (window.internals)
window.internals.settings.setCSSExclusionsEnabled(true);

function test(declaration) {
var div = document.createElement("div");
div.setAttribute("style", declaration);
return div.style.webkitShapeMargin;
}

function testComputedStyle(value) {
var div = document.createElement("div");
document.body.appendChild(div);
div.style.setProperty("-webkit-shape-margin", value);
var webkitShapeMarginComputedValue = getComputedStyle(div).getPropertyValue("-webkit-shape-margin");
document.body.removeChild(div);
return webkitShapeMarginComputedValue;
}

function testNotInherited(parentValue, childValue) {
var parentDiv = document.createElement("div");
document.body.appendChild(parentDiv);
parentDiv.style.setProperty("-webkit-shape-margin", parentValue);

var childDiv = document.createElement("div");
parentDiv.appendChild(childDiv);
childDiv.style.setProperty("-webkit-shape-margin", childValue);

var childWebKitShapeMarginComputedValue = getComputedStyle(childDiv).getPropertyValue("-webkit-shape-margin");

parentDiv.removeChild(childDiv);
document.body.removeChild(parentDiv);

return childWebKitShapeMarginComputedValue;
}

shouldBeEqualToString('test("-webkit-shape-margin: 0")', "0px");
shouldBeEqualToString('test("-webkit-shape-margin: 1.5ex")', "1.5ex");
shouldBeEqualToString('test("-webkit-shape-margin: 2em")', "2em");
shouldBeEqualToString('test("-webkit-shape-margin: 2.5in")', "2.5in");
shouldBeEqualToString('test("-webkit-shape-margin: 3cm")', "3cm");
shouldBeEqualToString('test("-webkit-shape-margin: 3.5mm")', "3.5mm");
shouldBeEqualToString('test("-webkit-shape-margin: 4pt")', "4pt");
shouldBeEqualToString('test("-webkit-shape-margin: 4.5pc")', "4.5pc");
shouldBeEqualToString('test("-webkit-shape-margin: 5px")', "5px");

shouldBeEqualToString('test("-webkit-shape-margin: -5px")', "");
shouldBeEqualToString('test("-webkit-shape-margin: auto")', "");
shouldBeEqualToString('test("-webkit-shape-margin: \'string\'")', "");
shouldBeEqualToString('test("-webkit-shape-margin: 120%")', "");

shouldBeEqualToString('testComputedStyle("0")', "0px");
shouldBeEqualToString('testComputedStyle("1px")', "1px");
shouldBeEqualToString('testComputedStyle("-5em")', "0px");
shouldBeEqualToString('testComputedStyle("identifier")', "0px");
shouldBeEqualToString('testComputedStyle("\'string\'")', "0px");

shouldBeEqualToString('testNotInherited("0", "0")', "0px");
shouldBeEqualToString('testNotInherited("0", "1px")', "1px");
shouldBeEqualToString('testNotInherited("1px", "-1em")', "0px");
shouldBeEqualToString('testNotInherited("2px", "1px")', "1px");
62 changes: 62 additions & 0 deletions LayoutTests/fast/exclusions/script-tests/shape-padding-parsing.js
@@ -0,0 +1,62 @@
description('Test parsing of the CSS shape-padding property.');

if (window.internals)
window.internals.settings.setCSSExclusionsEnabled(true);

function test(declaration) {
var div = document.createElement("div");
div.setAttribute("style", declaration);
return div.style.webkitShapePadding;
}

function testComputedStyle(value) {
var div = document.createElement("div");
document.body.appendChild(div);
div.style.setProperty("-webkit-shape-padding", value);
var webkitShapePaddingComputedValue = getComputedStyle(div).getPropertyValue("-webkit-shape-padding");
document.body.removeChild(div);
return webkitShapePaddingComputedValue;
}

function testNotInherited(parentValue, childValue) {
var parentDiv = document.createElement("div");
document.body.appendChild(parentDiv);
parentDiv.style.setProperty("-webkit-shape-padding", parentValue);

var childDiv = document.createElement("div");
parentDiv.appendChild(childDiv);
childDiv.style.setProperty("-webkit-shape-padding", childValue);

var childWebKitShapePaddingComputedValue = getComputedStyle(childDiv).getPropertyValue("-webkit-shape-padding");

parentDiv.removeChild(childDiv);
document.body.removeChild(parentDiv);

return childWebKitShapePaddingComputedValue;
}

shouldBeEqualToString('test("-webkit-shape-padding: 0")', "0px");
shouldBeEqualToString('test("-webkit-shape-padding: 1.5ex")', "1.5ex");
shouldBeEqualToString('test("-webkit-shape-padding: 2em")', "2em");
shouldBeEqualToString('test("-webkit-shape-padding: 2.5in")', "2.5in");
shouldBeEqualToString('test("-webkit-shape-padding: 3cm")', "3cm");
shouldBeEqualToString('test("-webkit-shape-padding: 3.5mm")', "3.5mm");
shouldBeEqualToString('test("-webkit-shape-padding: 4pt")', "4pt");
shouldBeEqualToString('test("-webkit-shape-padding: 4.5pc")', "4.5pc");
shouldBeEqualToString('test("-webkit-shape-padding: 5px")', "5px");

shouldBeEqualToString('test("-webkit-shape-padding: -5px")', "");
shouldBeEqualToString('test("-webkit-shape-padding: auto")', "");
shouldBeEqualToString('test("-webkit-shape-padding: \'string\'")', "");
shouldBeEqualToString('test("-webkit-shape-padding: 120%")', "");

shouldBeEqualToString('testComputedStyle("0")', "0px");
shouldBeEqualToString('testComputedStyle("1px")', "1px");
shouldBeEqualToString('testComputedStyle("-5em")', "0px");
shouldBeEqualToString('testComputedStyle("identifier")', "0px");
shouldBeEqualToString('testComputedStyle("\'string\'")', "0px");

shouldBeEqualToString('testNotInherited("0", "0")', "0px");
shouldBeEqualToString('testNotInherited("0", "1px")', "1px");
shouldBeEqualToString('testNotInherited("1px", "-1em")', "0px");
shouldBeEqualToString('testNotInherited("2px", "1px")', "1px");
62 changes: 0 additions & 62 deletions LayoutTests/fast/exclusions/script-tests/wrap-margin-parsing.js

This file was deleted.

62 changes: 0 additions & 62 deletions LayoutTests/fast/exclusions/script-tests/wrap-padding-parsing.js

This file was deleted.

6 changes: 3 additions & 3 deletions LayoutTests/fast/exclusions/script-tests/wrap-parsing.js
Expand Up @@ -14,10 +14,10 @@ function testComputedStyle(value) {
document.body.appendChild(div);
div.style.setProperty("-webkit-wrap", value);
var webkitWrapFlowComputedValue = getComputedStyle(div).getPropertyValue("-webkit-wrap-flow");
var webkitWrapMarginComputedValue = getComputedStyle(div).getPropertyValue("-webkit-wrap-margin");
var webkitWrapPaddingComputedValue = getComputedStyle(div).getPropertyValue("-webkit-wrap-padding");
var webkitShapeMarginComputedValue = getComputedStyle(div).getPropertyValue("-webkit-shape-margin");
var webkitShapePaddingComputedValue = getComputedStyle(div).getPropertyValue("-webkit-shape-padding");
document.body.removeChild(div);
return webkitWrapFlowComputedValue + " " + webkitWrapMarginComputedValue + " " + webkitWrapPaddingComputedValue;
return webkitWrapFlowComputedValue + " " + webkitShapeMarginComputedValue + " " + webkitShapePaddingComputedValue;
}

shouldBeEqualToString('test("-webkit-wrap: auto")', "auto");
Expand Down
31 changes: 31 additions & 0 deletions LayoutTests/fast/exclusions/shape-margin-parsing-expected.txt
@@ -0,0 +1,31 @@
Test parsing of the CSS shape-margin property.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS test("-webkit-shape-margin: 0") is "0px"
PASS test("-webkit-shape-margin: 1.5ex") is "1.5ex"
PASS test("-webkit-shape-margin: 2em") is "2em"
PASS test("-webkit-shape-margin: 2.5in") is "2.5in"
PASS test("-webkit-shape-margin: 3cm") is "3cm"
PASS test("-webkit-shape-margin: 3.5mm") is "3.5mm"
PASS test("-webkit-shape-margin: 4pt") is "4pt"
PASS test("-webkit-shape-margin: 4.5pc") is "4.5pc"
PASS test("-webkit-shape-margin: 5px") is "5px"
PASS test("-webkit-shape-margin: -5px") is ""
PASS test("-webkit-shape-margin: auto") is ""
PASS test("-webkit-shape-margin: 'string'") is ""
PASS test("-webkit-shape-margin: 120%") is ""
PASS testComputedStyle("0") is "0px"
PASS testComputedStyle("1px") is "1px"
PASS testComputedStyle("-5em") is "0px"
PASS testComputedStyle("identifier") is "0px"
PASS testComputedStyle("'string'") is "0px"
PASS testNotInherited("0", "0") is "0px"
PASS testNotInherited("0", "1px") is "1px"
PASS testNotInherited("1px", "-1em") is "0px"
PASS testNotInherited("2px", "1px") is "1px"
PASS successfullyParsed is true

TEST COMPLETE

Expand Up @@ -4,7 +4,7 @@
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<script src="script-tests/wrap-padding-parsing.js"></script>
<script src="script-tests/shape-margin-parsing.js"></script>
<script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
31 changes: 31 additions & 0 deletions LayoutTests/fast/exclusions/shape-padding-parsing-expected.txt
@@ -0,0 +1,31 @@
Test parsing of the CSS shape-padding property.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS test("-webkit-shape-padding: 0") is "0px"
PASS test("-webkit-shape-padding: 1.5ex") is "1.5ex"
PASS test("-webkit-shape-padding: 2em") is "2em"
PASS test("-webkit-shape-padding: 2.5in") is "2.5in"
PASS test("-webkit-shape-padding: 3cm") is "3cm"
PASS test("-webkit-shape-padding: 3.5mm") is "3.5mm"
PASS test("-webkit-shape-padding: 4pt") is "4pt"
PASS test("-webkit-shape-padding: 4.5pc") is "4.5pc"
PASS test("-webkit-shape-padding: 5px") is "5px"
PASS test("-webkit-shape-padding: -5px") is ""
PASS test("-webkit-shape-padding: auto") is ""
PASS test("-webkit-shape-padding: 'string'") is ""
PASS test("-webkit-shape-padding: 120%") is ""
PASS testComputedStyle("0") is "0px"
PASS testComputedStyle("1px") is "1px"
PASS testComputedStyle("-5em") is "0px"
PASS testComputedStyle("identifier") is "0px"
PASS testComputedStyle("'string'") is "0px"
PASS testNotInherited("0", "0") is "0px"
PASS testNotInherited("0", "1px") is "1px"
PASS testNotInherited("1px", "-1em") is "0px"
PASS testNotInherited("2px", "1px") is "1px"
PASS successfullyParsed is true

TEST COMPLETE

0 comments on commit c3096fc

Please sign in to comment.