CSS Exclusions: update the name of the shape CSS properties
authormihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Nov 2011 08:42:10 +0000 (08:42 +0000)
committermihnea@adobe.com <mihnea@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Nov 2011 08:42:10 +0000 (08:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=71898
Instead of a single wrap-shape property, we have wrap-shape-inside and wrap-shape-outside.

Reviewed by Dean Jackson.

Source/WebCore:

Tests: fast/exclusions/parsing-wrap-shape-inside.html
       fast/exclusions/parsing-wrap-shape-outside.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseWrapShape):
* css/CSSParser.h:
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::setWrapShapeInside):
(WebCore::InheritedFlags::wrapShapeInside):
(WebCore::InheritedFlags::setWrapShapeOutside):
(WebCore::InheritedFlags::wrapShapeOutside):
(WebCore::InheritedFlags::initialWrapShapeInside):
(WebCore::InheritedFlags::initialWrapShapeOutside):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

* fast/exclusions/parsing-wrap-shape-inside-expected.txt: Copied from LayoutTests/fast/exclusions/parsing-wrap-shape-expected.txt.
* fast/exclusions/parsing-wrap-shape-inside.html: Copied from LayoutTests/fast/exclusions/parsing-wrap-shape.html.
* fast/exclusions/parsing-wrap-shape-outside-expected.txt: Renamed from LayoutTests/fast/exclusions/parsing-wrap-shape-expected.txt.
* fast/exclusions/parsing-wrap-shape-outside.html: Renamed from LayoutTests/fast/exclusions/parsing-wrap-shape.html.
* fast/exclusions/script-tests/parsing-wrap-shape-inside.js: Copied from LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape.js.
* fast/exclusions/script-tests/parsing-wrap-shape-outside.js: Renamed from LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape.js.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101048 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/exclusions/parsing-wrap-shape-inside-expected.txt [moved from LayoutTests/fast/exclusions/parsing-wrap-shape-expected.txt with 98% similarity]
LayoutTests/fast/exclusions/parsing-wrap-shape-inside.html [moved from LayoutTests/fast/exclusions/parsing-wrap-shape.html with 75% similarity]
LayoutTests/fast/exclusions/parsing-wrap-shape-outside-expected.txt [new file with mode: 0644]
LayoutTests/fast/exclusions/parsing-wrap-shape-outside.html [new file with mode: 0644]
LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js [moved from LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape.js with 89% similarity]
LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-outside.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParser.h
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h

index b951ca8e42bd6799da04a463c3f04f7457cd7d97..a153b29a6e4685f6209920b20f509b1958bd20f4 100644 (file)
@@ -1,3 +1,18 @@
+2011-11-23  Mihnea Ovidenie  <mihnea@adobe.com>
+
+        CSS Exclusions: update the name of the shape CSS properties
+        https://bugs.webkit.org/show_bug.cgi?id=71898
+        Instead of a single wrap-shape property, we have wrap-shape-inside and wrap-shape-outside.
+
+        Reviewed by Dean Jackson.
+
+        * fast/exclusions/parsing-wrap-shape-inside-expected.txt: Copied from LayoutTests/fast/exclusions/parsing-wrap-shape-expected.txt.
+        * fast/exclusions/parsing-wrap-shape-inside.html: Copied from LayoutTests/fast/exclusions/parsing-wrap-shape.html.
+        * fast/exclusions/parsing-wrap-shape-outside-expected.txt: Renamed from LayoutTests/fast/exclusions/parsing-wrap-shape-expected.txt.
+        * fast/exclusions/parsing-wrap-shape-outside.html: Renamed from LayoutTests/fast/exclusions/parsing-wrap-shape.html.
+        * fast/exclusions/script-tests/parsing-wrap-shape-inside.js: Copied from LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape.js.
+        * fast/exclusions/script-tests/parsing-wrap-shape-outside.js: Renamed from LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape.js.
+
 2011-11-22  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         [Qt][GTK] editing/spelling/spellcheck-async.html fails
similarity index 98%
rename from LayoutTests/fast/exclusions/parsing-wrap-shape-expected.txt
rename to LayoutTests/fast/exclusions/parsing-wrap-shape-inside-expected.txt
index 6bc974e71eb5d86b80d7b4fadce8c1d5854fcbe4..1b7051969d5b161a899848e189960425177b24e5 100644 (file)
@@ -1,4 +1,4 @@
-Testing the parsing of the -webkit-wrap-shape property.
+Testing the parsing of the -webkit-wrap-shape-inside property.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
similarity index 75%
rename from LayoutTests/fast/exclusions/parsing-wrap-shape.html
rename to LayoutTests/fast/exclusions/parsing-wrap-shape-inside.html
index 8e911629234c0ae9f407dde35434695705ce819b..5af397bd708d4bff478b71e55e80f065a4649013 100644 (file)
@@ -4,7 +4,7 @@
 <script src="../js/resources/js-test-pre.js"></script>
 </head>
 <body>
-<script src="script-tests/parsing-wrap-shape.js"></script>
+<script src="script-tests/parsing-wrap-shape-inside.js"></script>
 <script src="../js/resources/js-test-post.js"></script>
 </body>
 </html>
diff --git a/LayoutTests/fast/exclusions/parsing-wrap-shape-outside-expected.txt b/LayoutTests/fast/exclusions/parsing-wrap-shape-outside-expected.txt
new file mode 100644 (file)
index 0000000..6ae8dfe
--- /dev/null
@@ -0,0 +1,87 @@
+Testing the parsing of the -webkit-wrap-shape-outside property.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testCSSText("auto") is "auto"
+PASS testComputedStyle("auto") is "auto"
+PASS testCSSText("rect(10px, 20px, 30px, 40px)") is "rect(10px, 20px, 30px, 40px)"
+PASS testComputedStyle("rect(10px, 20px, 30px, 40px)") is "rect(10px, 20px, 30px, 40px)"
+PASS testCSSText("rect(10px, 20px, 30px, 40px, 5px)") is "rect(10px, 20px, 30px, 40px, 5px)"
+PASS testComputedStyle("rect(10px, 20px, 30px, 40px, 5px)") is "rect(10px, 20px, 30px, 40px, 5px)"
+PASS testCSSText("rect(10px, 20px, 30px, 40px, 5px, 10px)") is "rect(10px, 20px, 30px, 40px, 5px, 10px)"
+PASS testComputedStyle("rect(10px, 20px, 30px, 40px, 5px, 10px)") is "rect(10px, 20px, 30px, 40px, 5px, 10px)"
+PASS testCSSText("circle(10px, 20px, 30px)") is "circle(10px, 20px, 30px)"
+PASS testComputedStyle("circle(10px, 20px, 30px)") is "circle(10px, 20px, 30px)"
+PASS testCSSText("ellipse(10px, 20px, 30px, 40px)") is "ellipse(10px, 20px, 30px, 40px)"
+PASS testComputedStyle("ellipse(10px, 20px, 30px, 40px)") is "ellipse(10px, 20px, 30px, 40px)"
+PASS testCSSText("polygon(10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
+PASS testComputedStyle("polygon(10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
+PASS testCSSText("polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)"
+PASS testComputedStyle("polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)"
+PASS testCSSText("polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
+PASS testComputedStyle("polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)") is "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)"
+PASS testNotInherited("auto", "rect(10px, 20px, 30px, 40px)") is "parent: auto, child: rect(10px, 20px, 30px, 40px)"
+PASS testNotInherited("rect(10px, 20px, 30px, 40px)", "initial") is "parent: rect(10px, 20px, 30px, 40px), child: auto"
+PASS testNotInherited("rect(10px, 20px, 30px, 40px)", "") is "parent: rect(10px, 20px, 30px, 40px), child: auto"
+PASS testNotInherited("rect(10px, 20px, 30px, 40px)", "inherit") is "parent: rect(10px, 20px, 30px, 40px), child: rect(10px, 20px, 30px, 40px)"
+PASS testNotInherited("", "inherit") is "parent: auto, child: auto"
+PASS testNotInherited("auto", "inherit") is "parent: auto, child: auto"
+PASS testCSSText("calc()") is ""
+PASS testComputedStyle("calc()") is "auto"
+PASS testCSSText("none") is ""
+PASS testComputedStyle("none") is "auto"
+PASS testCSSText("rect()") is ""
+PASS testComputedStyle("rect()") is "auto"
+PASS testCSSText("rect(10px)") is ""
+PASS testComputedStyle("rect(10px)") is "auto"
+PASS testCSSText("rect(10px, 10px)") is ""
+PASS testComputedStyle("rect(10px, 10px)") is "auto"
+PASS testCSSText("rect(10px, 20px, 30px)") is ""
+PASS testComputedStyle("rect(10px, 20px, 30px)") is "auto"
+PASS testCSSText("rect(10px 20px 30px 40px)") is ""
+PASS testComputedStyle("rect(10px 20px 30px 40px)") is "auto"
+PASS testCSSText("rect(10px, 20px, 30px, 40px, 50px, 60px, 70px)") is ""
+PASS testComputedStyle("rect(10px, 20px, 30px, 40px, 50px, 60px, 70px)") is "auto"
+PASS testCSSText("circle()") is ""
+PASS testComputedStyle("circle()") is "auto"
+PASS testCSSText("circle(10px)") is ""
+PASS testComputedStyle("circle(10px)") is "auto"
+PASS testCSSText("circle(10px, 20px)") is ""
+PASS testComputedStyle("circle(10px, 20px)") is "auto"
+PASS testCSSText("circle(10px 20px 30px)") is ""
+PASS testComputedStyle("circle(10px 20px 30px)") is "auto"
+PASS testCSSText("circle(10px, 20px, 30px, 40px)") is ""
+PASS testComputedStyle("circle(10px, 20px, 30px, 40px)") is "auto"
+PASS testCSSText("ellipse()") is ""
+PASS testComputedStyle("ellipse()") is "auto"
+PASS testCSSText("ellipse(10px)") is ""
+PASS testComputedStyle("ellipse(10px)") is "auto"
+PASS testCSSText("ellipse(10px, 20px)") is ""
+PASS testComputedStyle("ellipse(10px, 20px)") is "auto"
+PASS testCSSText("ellipse(10px, 20px, 30px)") is ""
+PASS testComputedStyle("ellipse(10px, 20px, 30px)") is "auto"
+PASS testCSSText("ellipse(10px 20px 30px 40px)") is ""
+PASS testComputedStyle("ellipse(10px 20px 30px 40px)") is "auto"
+PASS testCSSText("polygon()") is ""
+PASS testComputedStyle("polygon()") is "auto"
+PASS testCSSText("polygon(evenodd 10px, 20px 30px, 40px 40px, 50px)") is ""
+PASS testComputedStyle("polygon(evenodd 10px, 20px 30px, 40px 40px, 50px)") is "auto"
+PASS testCSSText("polygon(nonzero 10px, 20px 30px, 40px 40px, 50px)") is ""
+PASS testComputedStyle("polygon(nonzero 10px, 20px 30px, 40px 40px, 50px)") is "auto"
+PASS testCSSText("polygon(nonzero)") is ""
+PASS testComputedStyle("polygon(nonzero)") is "auto"
+PASS testCSSText("polygon(evenodd)") is ""
+PASS testComputedStyle("polygon(evenodd)") is "auto"
+PASS testCSSText("polygon(10px)") is ""
+PASS testComputedStyle("polygon(10px)") is "auto"
+PASS testCSSText("polygon(nonzero,10px)") is ""
+PASS testComputedStyle("polygon(nonzero,10px)") is "auto"
+PASS testCSSText("polygon(evenodd,12px)") is ""
+PASS testComputedStyle("polygon(evenodd,12px)") is "auto"
+PASS testCSSText("polygon(10px, 20px, 30px, 40px, 40px, 50px)") is ""
+PASS testComputedStyle("polygon(10px, 20px, 30px, 40px, 40px, 50px)") is "auto"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/exclusions/parsing-wrap-shape-outside.html b/LayoutTests/fast/exclusions/parsing-wrap-shape-outside.html
new file mode 100644 (file)
index 0000000..c870e12
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<script src="script-tests/parsing-wrap-shape-outside.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
similarity index 89%
rename from LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape.js
rename to LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js
index 776c236ebba9a794c49193a8b6c5d7eb34d00bcc..be82104af0860e1b0f2630410cadffd407089f6a 100644 (file)
@@ -1,19 +1,19 @@
-description('Testing the parsing of the -webkit-wrap-shape property.');
+description('Testing the parsing of the -webkit-wrap-shape-inside property.');
 
 function testCSSText(declaration, expected)
 {
     var element = document.createElement("div");
-    element.style.cssText = "-webkit-wrap-shape: " + declaration;
-    return element.style.webkitWrapShape;
+    element.style.cssText = "-webkit-wrap-shape-inside: " + declaration;
+    return element.style.webkitWrapShapeInside;
 }
 
 function testComputedStyle(value, expected) {
     var element = document.createElement("div");
     document.body.appendChild(element);
-    element.style.setProperty("-webkit-wrap-shape", value);
-    
+    element.style.setProperty("-webkit-wrap-shape-inside", value);
+
     var computedStyle = getComputedStyle(element);
-    var actualValue = computedStyle.getPropertyValue("-webkit-wrap-shape");
+    var actualValue = computedStyle.getPropertyValue("-webkit-wrap-shape-inside");
     document.body.removeChild(element);
 
     return actualValue;
@@ -22,21 +22,21 @@ function testComputedStyle(value, expected) {
 function testNotInherited(parentValue, childValue) {
    var parentElement = document.createElement("div");
    document.body.appendChild(parentElement);
-   parentElement.style.setProperty("-webkit-wrap-shape", parentValue);
+   parentElement.style.setProperty("-webkit-wrap-shape-inside", parentValue);
 
    var childElement = document.createElement("div");
    parentElement.appendChild(childElement);
-   childElement.style.setProperty("-webkit-wrap-shape", childValue);
+   childElement.style.setProperty("-webkit-wrap-shape-inside", childValue);
 
    var parentComputedStyle = getComputedStyle(parentElement);
-   var parentActual = parentComputedStyle.getPropertyValue('-webkit-wrap-shape')
-   
+   var parentActual = parentComputedStyle.getPropertyValue('-webkit-wrap-shape-inside')
+
    var childComputedStyle = getComputedStyle(childElement);
-   var childActual = childComputedStyle.getPropertyValue('-webkit-wrap-shape')
-   
+   var childActual = childComputedStyle.getPropertyValue('-webkit-wrap-shape-inside')
+
    parentElement.removeChild(childElement);
    document.body.removeChild(parentElement);
-   
+
    return "parent: " + parentActual + ", child: " + childActual;
 }
 
diff --git a/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-outside.js b/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-outside.js
new file mode 100644 (file)
index 0000000..9977ad7
--- /dev/null
@@ -0,0 +1,109 @@
+description('Testing the parsing of the -webkit-wrap-shape-outside property.');
+
+function testCSSText(declaration, expected)
+{
+    var element = document.createElement("div");
+    element.style.cssText = "-webkit-wrap-shape-outside: " + declaration;
+    return element.style.webkitWrapShapeOutside;
+}
+
+function testComputedStyle(value, expected) {
+    var element = document.createElement("div");
+    document.body.appendChild(element);
+    element.style.setProperty("-webkit-wrap-shape-outside", value);
+
+    var computedStyle = getComputedStyle(element);
+    var actualValue = computedStyle.getPropertyValue("-webkit-wrap-shape-outside");
+    document.body.removeChild(element);
+
+    return actualValue;
+}
+
+function testNotInherited(parentValue, childValue) {
+   var parentElement = document.createElement("div");
+   document.body.appendChild(parentElement);
+   parentElement.style.setProperty("-webkit-wrap-shape-outside", parentValue);
+
+   var childElement = document.createElement("div");
+   parentElement.appendChild(childElement);
+   childElement.style.setProperty("-webkit-wrap-shape-outside", childValue);
+
+   var parentComputedStyle = getComputedStyle(parentElement);
+   var parentActual = parentComputedStyle.getPropertyValue('-webkit-wrap-shape-outside')
+
+   var childComputedStyle = getComputedStyle(childElement);
+   var childActual = childComputedStyle.getPropertyValue('-webkit-wrap-shape-outside')
+
+   parentElement.removeChild(childElement);
+   document.body.removeChild(parentElement);
+
+   return "parent: " + parentActual + ", child: " + childActual;
+}
+
+function test(value, expected) {
+    var unevaledString = '"' + value.replace(/\\/g, "\\\\").replace(/"/g, "\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r") + '"';
+    shouldBeEqualToString('testCSSText(' + unevaledString + ')', expected);
+    shouldBeEqualToString('testComputedStyle(' + unevaledString + ')', expected);
+}
+
+function negative_test(value) {
+    var unevaledString = '"' + value.replace(/\\/g, "\\\\").replace(/"/g, "\"").replace(/\n/g, "\\n").replace(/\r/g, "\\r") + '"';
+    shouldBeEqualToString('testCSSText(' + unevaledString + ')', '');
+    shouldBeEqualToString('testComputedStyle(' + unevaledString + ')', 'auto');
+}
+
+// positive tests
+
+test("auto", "auto");
+test("rect(10px, 20px, 30px, 40px)", "rect(10px, 20px, 30px, 40px)");
+test("rect(10px, 20px, 30px, 40px, 5px)", "rect(10px, 20px, 30px, 40px, 5px)");
+test("rect(10px, 20px, 30px, 40px, 5px, 10px)", "rect(10px, 20px, 30px, 40px, 5px, 10px)");
+
+test("circle(10px, 20px, 30px)", "circle(10px, 20px, 30px)");
+
+test("ellipse(10px, 20px, 30px, 40px)", "ellipse(10px, 20px, 30px, 40px)");
+
+test("polygon(10px, 20px 30px, 40px 40px, 50px)", "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)");
+test("polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)", "polygon(evenodd, 10px, 20px 30px, 40px 40px, 50px)");
+test("polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)", "polygon(nonzero, 10px, 20px 30px, 40px 40px, 50px)");
+
+shouldBeEqualToString('testNotInherited("auto", "rect(10px, 20px, 30px, 40px)")', "parent: auto, child: rect(10px, 20px, 30px, 40px)");
+shouldBeEqualToString('testNotInherited("rect(10px, 20px, 30px, 40px)", "initial")', "parent: rect(10px, 20px, 30px, 40px), child: auto");
+shouldBeEqualToString('testNotInherited("rect(10px, 20px, 30px, 40px)", "")', "parent: rect(10px, 20px, 30px, 40px), child: auto");
+shouldBeEqualToString('testNotInherited("rect(10px, 20px, 30px, 40px)", "inherit")', "parent: rect(10px, 20px, 30px, 40px), child: rect(10px, 20px, 30px, 40px)");
+shouldBeEqualToString('testNotInherited("", "inherit")', "parent: auto, child: auto");
+shouldBeEqualToString('testNotInherited("auto", "inherit")', "parent: auto, child: auto");
+
+// negative tests
+
+negative_test("calc()");
+negative_test("none");
+
+negative_test("rect()");
+negative_test("rect(10px)");
+negative_test("rect(10px, 10px)");
+negative_test("rect(10px, 20px, 30px)");
+negative_test("rect(10px 20px 30px 40px)");
+negative_test("rect(10px, 20px, 30px, 40px, 50px, 60px, 70px)");
+
+negative_test("circle()");
+negative_test("circle(10px)");
+negative_test("circle(10px, 20px)");
+negative_test("circle(10px 20px 30px)");
+negative_test("circle(10px, 20px, 30px, 40px)");
+
+negative_test("ellipse()");
+negative_test("ellipse(10px)");
+negative_test("ellipse(10px, 20px)");
+negative_test("ellipse(10px, 20px, 30px)");
+negative_test("ellipse(10px 20px 30px 40px)");
+
+negative_test("polygon()");
+negative_test("polygon(evenodd 10px, 20px 30px, 40px 40px, 50px)");
+negative_test("polygon(nonzero 10px, 20px 30px, 40px 40px, 50px)");
+negative_test("polygon(nonzero)");
+negative_test("polygon(evenodd)");
+negative_test("polygon(10px)");
+negative_test("polygon(nonzero,10px)");
+negative_test("polygon(evenodd,12px)");
+negative_test("polygon(10px, 20px, 30px, 40px, 40px, 50px)");
index 3a802bfbfcf66850609818073313c7679342849c..32b9bfd031748f1a0edc30fea9183199dd71b992 100644 (file)
@@ -1,3 +1,39 @@
+2011-11-23  Mihnea Ovidenie  <mihnea@adobe.com>
+
+        CSS Exclusions: update the name of the shape CSS properties
+        https://bugs.webkit.org/show_bug.cgi?id=71898
+        Instead of a single wrap-shape property, we have wrap-shape-inside and wrap-shape-outside.
+
+        Reviewed by Dean Jackson.
+
+        Tests: fast/exclusions/parsing-wrap-shape-inside.html
+               fast/exclusions/parsing-wrap-shape-outside.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseWrapShape):
+        * css/CSSParser.h:
+        * css/CSSProperty.cpp:
+        (WebCore::CSSProperty::isInheritedProperty):
+        * css/CSSPropertyNames.in:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applyProperty):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::diff):
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::setWrapShapeInside):
+        (WebCore::InheritedFlags::wrapShapeInside):
+        (WebCore::InheritedFlags::setWrapShapeOutside):
+        (WebCore::InheritedFlags::wrapShapeOutside):
+        (WebCore::InheritedFlags::initialWrapShapeInside):
+        (WebCore::InheritedFlags::initialWrapShapeOutside):
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==):
+        * rendering/style/StyleRareNonInheritedData.h:
+
 2011-11-23  Andrey Kosyakov  <caseq@chromium.org>
 
         Web Inspector: [Extensions API] avoid exception in initExtensions() if elements panel is not present
index 2e57408476a0b68d12f79affba3dd38ec2b00634..9e53bd5554676f8d059f1fa2c61a1db656a002e2 100644 (file)
@@ -2174,11 +2174,15 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
         case CSSPropertyWebkitTransition:
             break;
 
-        case CSSPropertyWebkitWrapShape:
-            if (!style->wrapShape())
+        case CSSPropertyWebkitWrapShapeInside:
+            if (!style->wrapShapeInside())
                 return primitiveValueCache->createIdentifierValue(CSSValueAuto);
+            return primitiveValueCache->createValue(style->wrapShapeInside());
 
-            return primitiveValueCache->createValue(style->wrapShape());
+        case CSSPropertyWebkitWrapShapeOutside:
+            if (!style->wrapShapeOutside())
+                return primitiveValueCache->createIdentifierValue(CSSValueAuto);
+            return primitiveValueCache->createValue(style->wrapShapeOutside());
 
         case CSSPropertyWebkitWrapFlow:
             return primitiveValueCache->createValue(style->wrapFlow());
index bb3f29470ee27e57baa69a03ce5db3f1b6f6bb39..c6581d243abba43ee6e2c99c2e4b60248c6136a8 100644 (file)
@@ -2195,11 +2195,12 @@ bool CSSParser::parseValue(int propId, bool important)
             return parseFontFeatureSettings(important);
         break;
 
-    case CSSPropertyWebkitWrapShape:
+    case CSSPropertyWebkitWrapShapeInside:
+    case CSSPropertyWebkitWrapShapeOutside:
         if (id == CSSValueAuto)
             validPrimitive = true;
         else if (value->unit == CSSParserValue::Function)
-            return parseWrapShape(important);
+            return parseWrapShape((propId == CSSPropertyWebkitWrapShapeInside), important);
         break;
     case CSSPropertyWebkitWrapFlow:
         if (id == CSSValueAuto || id == CSSValueBoth || id == CSSValueLeft || id == CSSValueRight || id == CSSValueMaximum || id == CSSValueClear)
@@ -3948,7 +3949,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapePolygon(CSSParserValueList* ar
     return shape;
 }
 
-bool CSSParser::parseWrapShape(bool important)
+bool CSSParser::parseWrapShape(bool shapeInside, bool important)
 {
     CSSParserValue* value = m_valueList->current();
     CSSParserValueList* args = value->function->args.get();
@@ -3968,7 +3969,7 @@ bool CSSParser::parseWrapShape(bool important)
         shape = parseWrapShapePolygon(args);
 
     if (shape) {
-        addProperty(CSSPropertyWebkitWrapShape, primitiveValueCache()->createValue(shape.release()), important);
+        addProperty(shapeInside ? CSSPropertyWebkitWrapShapeInside : CSSPropertyWebkitWrapShapeOutside, primitiveValueCache()->createValue(shape.release()), important);
         m_valueList->next();
         return true;
     }
index 689583c428014200991af1f6e4adb7dd4d9604cc..e0b2fca8fd2220d9530fe8b7038a8ec4ba9ee736 100644 (file)
@@ -129,7 +129,7 @@ public:
 
     bool parseShape(int propId, bool important);
 
-    bool parseWrapShape(bool important);
+    bool parseWrapShape(bool shapeInside, bool important);
     PassRefPtr<CSSWrapShape> parseWrapShapeRect(CSSParserValueList* args);
     PassRefPtr<CSSWrapShape> parseWrapShapeCircle(CSSParserValueList* args);
     PassRefPtr<CSSWrapShape> parseWrapShapeEllipse(CSSParserValueList* args);
index b5a59edaed767adaa4f18c8dcda11cb890bbffd0..8266679238752bf585f35f900074f5f9c225cc2b 100644 (file)
@@ -626,7 +626,8 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     case CSSPropertyWebkitFlowInto:
     case CSSPropertyWebkitFlowFrom:
     case CSSPropertyWebkitRegionOverflow:
-    case CSSPropertyWebkitWrapShape:
+    case CSSPropertyWebkitWrapShapeInside:
+    case CSSPropertyWebkitWrapShapeOutside:
     case CSSPropertyWebkitWrapMargin:
     case CSSPropertyWebkitWrapPadding:
     case CSSPropertyWebkitRegionBreakAfter:
index c03fc443809a35b4eece5224343dfaeb012f0e8d..b7a21b4fecb0ad04c0512e9e460e93b07073311e 100644 (file)
@@ -354,7 +354,8 @@ z-index
 -webkit-flow-into
 -webkit-flow-from
 -webkit-region-overflow
--webkit-wrap-shape
+-webkit-wrap-shape-inside
+-webkit-wrap-shape-outside
 -webkit-wrap-margin
 -webkit-wrap-padding
 -webkit-region-break-after
index 16294fb73a0769f0eeadfe62312edf434e3af0db..efef2755aad6b3357ce17adbeef4a4a95d6e3102 100644 (file)
@@ -3860,16 +3860,24 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
         HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(columnAxis, ColumnAxis);
         return;
 
-    case CSSPropertyWebkitWrapShape:
-        HANDLE_INHERIT_AND_INITIAL(wrapShape, WrapShape);
+    case CSSPropertyWebkitWrapShapeInside:
+        HANDLE_INHERIT_AND_INITIAL(wrapShapeInside, WrapShapeInside);
         if (!primitiveValue)
             return;
-
         if (primitiveValue->getIdent() == CSSValueAuto)
-            m_style->setWrapShape(0);
+            m_style->setWrapShapeInside(0);
         else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_SHAPE)
-            m_style->setWrapShape(primitiveValue->getShapeValue());
+            m_style->setWrapShapeInside(primitiveValue->getShapeValue());
+        return;
 
+    case CSSPropertyWebkitWrapShapeOutside:
+        HANDLE_INHERIT_AND_INITIAL(wrapShapeOutside, WrapShapeOutside);
+        if (!primitiveValue)
+            return;
+        if (primitiveValue->getIdent() == CSSValueAuto)
+            m_style->setWrapShapeOutside(0);
+        else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_SHAPE)
+            m_style->setWrapShapeOutside(primitiveValue->getShapeValue());
         return;
 
     case CSSPropertyWebkitWrapFlow:
index c7429eb82fc5560ee4acfde9790886a24a41e808..2c7f2e8966aca57fcfe8c0ba2cdea2dd3efbdbfd 100644 (file)
@@ -629,7 +629,8 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
         // the parent container. For sure, I will have to revisit this code, but for now I've added this in order 
         // to avoid having diff() == StyleDifferenceEqual where wrap-shapes actually differ.
         // Tracking bug: https://bugs.webkit.org/show_bug.cgi?id=62991
-        if (rareNonInheritedData->m_wrapShape != other->rareNonInheritedData->m_wrapShape)
+        if (rareNonInheritedData->m_wrapShapeInside != other->rareNonInheritedData->m_wrapShapeInside
+            || rareNonInheritedData->m_wrapShapeOutside != other->rareNonInheritedData->m_wrapShapeOutside)
             return StyleDifferenceRepaint;
 
 #if USE(ACCELERATED_COMPOSITING)
index d5397c6f4d97e87475d1ef0ef9a0f05e3c2b9302..82787e2c2caea0c15daa3f93211f2d7d63c31ee7 100644 (file)
@@ -1286,13 +1286,22 @@ public:
     void setKerning(SVGLength k) { accessSVGStyle()->setKerning(k); }
 #endif
 
-    void setWrapShape(PassRefPtr<CSSWrapShape> shape)
+    void setWrapShapeInside(PassRefPtr<CSSWrapShape> shape)
     {
-        if (rareNonInheritedData->m_wrapShape != shape)
-            rareNonInheritedData.access()->m_wrapShape = shape;
+        if (rareNonInheritedData->m_wrapShapeInside != shape)
+            rareNonInheritedData.access()->m_wrapShapeInside = shape;
     }
-    CSSWrapShape* wrapShape() const { return rareNonInheritedData->m_wrapShape.get(); }
-    static CSSWrapShape* initialWrapShape() { return 0; }
+    CSSWrapShape* wrapShapeInside() const { return rareNonInheritedData->m_wrapShapeInside.get(); }
+
+    void setWrapShapeOutside(PassRefPtr<CSSWrapShape> shape)
+    {
+        if (rareNonInheritedData->m_wrapShapeOutside != shape)
+            rareNonInheritedData.access()->m_wrapShapeOutside = shape;
+    }
+    CSSWrapShape* wrapShapeOutside() const { return rareNonInheritedData->m_wrapShapeOutside.get(); }
+
+    static CSSWrapShape* initialWrapShapeInside() { return 0; }
+    static CSSWrapShape* initialWrapShapeOutside() { return 0; }
 
     Length wrapPadding() const { return rareNonInheritedData->m_wrapPadding; }
     void setWrapPadding(Length wrapPadding) { SET_VAR(rareNonInheritedData, m_wrapPadding, wrapPadding); }
index 788a488d8e6df79a758dd6d9790ce23dec142479..0c21c0b608a524e6805a5540893f13e6c44e037f 100644 (file)
@@ -45,7 +45,8 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
     , lineClamp(RenderStyle::initialLineClamp())
     , m_mask(FillLayer(MaskFillLayer))
     , m_pageSize()
-    , m_wrapShape(RenderStyle::initialWrapShape())
+    , m_wrapShapeInside(RenderStyle::initialWrapShapeInside())
+    , m_wrapShapeOutside(RenderStyle::initialWrapShapeOutside())
     , m_wrapMargin(RenderStyle::initialWrapMargin())
     , m_wrapPadding(RenderStyle::initialWrapPadding())
     , m_visitedLinkBackgroundColor(RenderStyle::initialBackgroundColor())
@@ -104,7 +105,8 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
     , m_mask(o.m_mask)
     , m_maskBoxImage(o.m_maskBoxImage)
     , m_pageSize(o.m_pageSize)
-    , m_wrapShape(o.m_wrapShape)
+    , m_wrapShapeInside(o.m_wrapShapeInside)
+    , m_wrapShapeOutside(o.m_wrapShapeOutside)
     , m_wrapMargin(o.m_wrapMargin)
     , m_wrapPadding(o.m_wrapPadding)
     , m_visitedLinkBackgroundColor(o.m_visitedLinkBackgroundColor)
@@ -192,7 +194,8 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
         && (m_flowThread == o.m_flowThread)
         && (m_regionThread == o.m_regionThread)
         && (m_regionOverflow == o.m_regionOverflow)
-        && (m_wrapShape == o.m_wrapShape)
+        && (m_wrapShapeInside == o.m_wrapShapeInside)
+        && (m_wrapShapeOutside == o.m_wrapShapeOutside)
         && (m_wrapFlow == o.m_wrapFlow)
         && (m_wrapThrough == o.m_wrapThrough)
         && (m_wrapMargin == o.m_wrapMargin)
index e2c62bc7365b249d755ab006e0f64280dff0ad17..39c53b267bc9220b50b35687d3bd95936a36713b 100644 (file)
@@ -129,7 +129,8 @@ public:
 
     LengthSize m_pageSize;
 
-    RefPtr<CSSWrapShape> m_wrapShape;
+    RefPtr<CSSWrapShape> m_wrapShapeInside;
+    RefPtr<CSSWrapShape> m_wrapShapeOutside;
     Length m_wrapMargin;
     Length m_wrapPadding;