Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
b0d48a2
commit c3096fc
Showing
27 changed files
with
304 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
LayoutTests/fast/exclusions/script-tests/shape-margin-parsing.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
62
LayoutTests/fast/exclusions/script-tests/shape-padding-parsing.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
62
LayoutTests/fast/exclusions/script-tests/wrap-margin-parsing.js
This file was deleted.
Oops, something went wrong.
62 changes: 0 additions & 62 deletions
62
LayoutTests/fast/exclusions/script-tests/wrap-padding-parsing.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
LayoutTests/fast/exclusions/shape-margin-parsing-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
LayoutTests/fast/exclusions/shape-padding-parsing-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
Oops, something went wrong.