Update shape-inside/shape-outside CSS Exclusion properties
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Mar 2012 01:17:38 +0000 (01:17 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Mar 2012 01:17:38 +0000 (01:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82365

Patch by Bear Travis <betravis@adobe.com> on 2012-03-29
Reviewed by Ryosuke Niwa.

Source/WebCore:

Updating CSS property names for wrap-shape-inside and wrap-shape-outside
to shape-inside and shape-outside, per the current exclusions spec.
Renaming some parsing functions in CSSParser for clarity.
No new functionality.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseClipShape):
(WebCore::CSSParser::parseExclusionShapeRect):
(WebCore::CSSParser::parseExclusionShapeCircle):
(WebCore::CSSParser::parseExclusionShapeEllipse):
(WebCore::CSSParser::parseExclusionShapePolygon):
(WebCore::CSSParser::parseExclusionShape):
* css/CSSParser.h:
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::collectMatchingRulesForList):

LayoutTests:

Renaming prefixed wrap-shape-inside and wrap-shape-outside
to prefixed shape-inside and shape-outside. Updating the
tests to reflect the change.

* fast/exclusions/parsing-wrap-shape-inside-expected.txt:
* fast/exclusions/parsing-wrap-shape-outside-expected.txt:
* fast/exclusions/script-tests/parsing-wrap-shape-inside.js:
(testCSSText):
(testComputedStyle):
(testNotInherited):
* fast/exclusions/script-tests/parsing-wrap-shape-outside.js:
(testCSSText):
(testComputedStyle):
(testNotInherited):

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

12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/exclusions/parsing-wrap-shape-inside-expected.txt
LayoutTests/fast/exclusions/parsing-wrap-shape-outside-expected.txt
LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js
LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-outside.js
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

index 009eeae..0b251d6 100644 (file)
@@ -1,3 +1,25 @@
+2012-03-29  Bear Travis  <betravis@adobe.com>
+
+        Update shape-inside/shape-outside CSS Exclusion properties
+        https://bugs.webkit.org/show_bug.cgi?id=82365
+
+        Reviewed by Ryosuke Niwa.
+
+        Renaming prefixed wrap-shape-inside and wrap-shape-outside
+        to prefixed shape-inside and shape-outside. Updating the
+        tests to reflect the change.
+
+        * fast/exclusions/parsing-wrap-shape-inside-expected.txt:
+        * fast/exclusions/parsing-wrap-shape-outside-expected.txt:
+        * fast/exclusions/script-tests/parsing-wrap-shape-inside.js:
+        (testCSSText):
+        (testComputedStyle):
+        (testNotInherited):
+        * fast/exclusions/script-tests/parsing-wrap-shape-outside.js:
+        (testCSSText):
+        (testComputedStyle):
+        (testNotInherited):
+
 2012-03-29  Dirk Pranke  <dpranke@chromium.org>
 
         Unreviewed, expectations changes.
index 1b70519..cde7707 100644 (file)
@@ -1,4 +1,4 @@
-Testing the parsing of the -webkit-wrap-shape-inside property.
+Testing the parsing of the -webkit-shape-inside property.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
index 6ae8dfe..3e66dd1 100644 (file)
@@ -1,4 +1,4 @@
-Testing the parsing of the -webkit-wrap-shape-outside property.
+Testing the parsing of the -webkit-shape-outside property.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
index be82104..d962a72 100644 (file)
@@ -1,19 +1,19 @@
-description('Testing the parsing of the -webkit-wrap-shape-inside property.');
+description('Testing the parsing of the -webkit-shape-inside property.');
 
 function testCSSText(declaration, expected)
 {
     var element = document.createElement("div");
-    element.style.cssText = "-webkit-wrap-shape-inside: " + declaration;
-    return element.style.webkitWrapShapeInside;
+    element.style.cssText = "-webkit-shape-inside: " + declaration;
+    return element.style.webkitShapeInside;
 }
 
 function testComputedStyle(value, expected) {
     var element = document.createElement("div");
     document.body.appendChild(element);
-    element.style.setProperty("-webkit-wrap-shape-inside", value);
+    element.style.setProperty("-webkit-shape-inside", value);
 
     var computedStyle = getComputedStyle(element);
-    var actualValue = computedStyle.getPropertyValue("-webkit-wrap-shape-inside");
+    var actualValue = computedStyle.getPropertyValue("-webkit-shape-inside");
     document.body.removeChild(element);
 
     return actualValue;
@@ -22,17 +22,17 @@ function testComputedStyle(value, expected) {
 function testNotInherited(parentValue, childValue) {
    var parentElement = document.createElement("div");
    document.body.appendChild(parentElement);
-   parentElement.style.setProperty("-webkit-wrap-shape-inside", parentValue);
+   parentElement.style.setProperty("-webkit-shape-inside", parentValue);
 
    var childElement = document.createElement("div");
    parentElement.appendChild(childElement);
-   childElement.style.setProperty("-webkit-wrap-shape-inside", childValue);
+   childElement.style.setProperty("-webkit-shape-inside", childValue);
 
    var parentComputedStyle = getComputedStyle(parentElement);
-   var parentActual = parentComputedStyle.getPropertyValue('-webkit-wrap-shape-inside')
+   var parentActual = parentComputedStyle.getPropertyValue('-webkit-shape-inside')
 
    var childComputedStyle = getComputedStyle(childElement);
-   var childActual = childComputedStyle.getPropertyValue('-webkit-wrap-shape-inside')
+   var childActual = childComputedStyle.getPropertyValue('-webkit-shape-inside')
 
    parentElement.removeChild(childElement);
    document.body.removeChild(parentElement);
index 9977ad7..baf3238 100644 (file)
@@ -1,19 +1,19 @@
-description('Testing the parsing of the -webkit-wrap-shape-outside property.');
+description('Testing the parsing of the -webkit-shape-outside property.');
 
 function testCSSText(declaration, expected)
 {
     var element = document.createElement("div");
-    element.style.cssText = "-webkit-wrap-shape-outside: " + declaration;
-    return element.style.webkitWrapShapeOutside;
+    element.style.cssText = "-webkit-shape-outside: " + declaration;
+    return element.style.webkitShapeOutside;
 }
 
 function testComputedStyle(value, expected) {
     var element = document.createElement("div");
     document.body.appendChild(element);
-    element.style.setProperty("-webkit-wrap-shape-outside", value);
+    element.style.setProperty("-webkit-shape-outside", value);
 
     var computedStyle = getComputedStyle(element);
-    var actualValue = computedStyle.getPropertyValue("-webkit-wrap-shape-outside");
+    var actualValue = computedStyle.getPropertyValue("-webkit-shape-outside");
     document.body.removeChild(element);
 
     return actualValue;
@@ -22,17 +22,17 @@ function testComputedStyle(value, expected) {
 function testNotInherited(parentValue, childValue) {
    var parentElement = document.createElement("div");
    document.body.appendChild(parentElement);
-   parentElement.style.setProperty("-webkit-wrap-shape-outside", parentValue);
+   parentElement.style.setProperty("-webkit-shape-outside", parentValue);
 
    var childElement = document.createElement("div");
    parentElement.appendChild(childElement);
-   childElement.style.setProperty("-webkit-wrap-shape-outside", childValue);
+   childElement.style.setProperty("-webkit-shape-outside", childValue);
 
    var parentComputedStyle = getComputedStyle(parentElement);
-   var parentActual = parentComputedStyle.getPropertyValue('-webkit-wrap-shape-outside')
+   var parentActual = parentComputedStyle.getPropertyValue('-webkit-shape-outside')
 
    var childComputedStyle = getComputedStyle(childElement);
-   var childActual = childComputedStyle.getPropertyValue('-webkit-wrap-shape-outside')
+   var childActual = childComputedStyle.getPropertyValue('-webkit-shape-outside')
 
    parentElement.removeChild(childElement);
    document.body.removeChild(parentElement);
index 0a27a86..ebaa43d 100644 (file)
@@ -1,3 +1,33 @@
+2012-03-29  Bear Travis  <betravis@adobe.com>
+
+        Update shape-inside/shape-outside CSS Exclusion properties
+        https://bugs.webkit.org/show_bug.cgi?id=82365
+
+        Reviewed by Ryosuke Niwa.
+
+        Updating CSS property names for wrap-shape-inside and wrap-shape-outside
+        to shape-inside and shape-outside, per the current exclusions spec.
+        Renaming some parsing functions in CSSParser for clarity.
+        No new functionality.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseClipShape):
+        (WebCore::CSSParser::parseExclusionShapeRect):
+        (WebCore::CSSParser::parseExclusionShapeCircle):
+        (WebCore::CSSParser::parseExclusionShapeEllipse):
+        (WebCore::CSSParser::parseExclusionShapePolygon):
+        (WebCore::CSSParser::parseExclusionShape):
+        * css/CSSParser.h:
+        * css/CSSProperty.cpp:
+        (WebCore::CSSProperty::isInheritedProperty):
+        * css/CSSPropertyNames.in:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::collectMatchingRulesForList):
+
 2012-03-29  Ryan Sleevi  <rsleevi@chromium.org>
 
         [chromium] Update paths in GYP files
index 5219097..8d2cf36 100644 (file)
@@ -2322,11 +2322,11 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
             return cssValuePool->createValue(style->wrapMargin());
         case CSSPropertyWebkitWrapPadding:
             return cssValuePool->createValue(style->wrapPadding());
-        case CSSPropertyWebkitWrapShapeInside:
+        case CSSPropertyWebkitShapeInside:
             if (!style->wrapShapeInside())
                 return cssValuePool->createIdentifierValue(CSSValueAuto);
             return cssValuePool->createValue(style->wrapShapeInside());
-        case CSSPropertyWebkitWrapShapeOutside:
+        case CSSPropertyWebkitShapeOutside:
             if (!style->wrapShapeOutside())
                 return cssValuePool->createIdentifierValue(CSSValueAuto);
             return cssValuePool->createValue(style->wrapShapeOutside());
index c67aae7..a374433 100644 (file)
@@ -1481,7 +1481,7 @@ bool CSSParser::parseValue(int propId, bool important)
         if (id == CSSValueAuto)
             validPrimitive = true;
         else if (value->unit == CSSParserValue::Function)
-            return parseShape(propId, important);
+            return parseClipShape(propId, important);
         break;
 
     /* Start of supported CSS properties with validation. This is needed for parseShorthand to work
@@ -2399,12 +2399,12 @@ bool CSSParser::parseValue(int propId, bool important)
             return parseFontVariantLigatures(important);
         break;
 
-    case CSSPropertyWebkitWrapShapeInside:
-    case CSSPropertyWebkitWrapShapeOutside:
+    case CSSPropertyWebkitShapeInside:
+    case CSSPropertyWebkitShapeOutside:
         if (id == CSSValueAuto)
             validPrimitive = true;
         else if (value->unit == CSSParserValue::Function)
-            return parseWrapShape((propId == CSSPropertyWebkitWrapShapeInside), important);
+            return parseExclusionShape((propId == CSSPropertyWebkitShapeInside), important);
         break;
     case CSSPropertyWebkitWrapMargin:
     case CSSPropertyWebkitWrapPadding:
@@ -4037,7 +4037,7 @@ PassRefPtr<CSSValue> CSSParser::parseCounterContent(CSSParserValueList* args, bo
     return cssValuePool()->createValue(Counter::create(identifier.release(), listStyle.release(), separator.release()));
 }
 
-bool CSSParser::parseShape(int propId, bool important)
+bool CSSParser::parseClipShape(int propId, bool important)
 {
     CSSParserValue* value = m_valueList->current();
     CSSParserValueList* args = value->function->args.get();
@@ -4086,7 +4086,7 @@ bool CSSParser::parseShape(int propId, bool important)
     return false;
 }
 
-PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeRect(CSSParserValueList* args)
+PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeRect(CSSParserValueList* args)
 {
     ASSERT(args);
 
@@ -4139,7 +4139,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeRect(CSSParserValueList* args)
     return shape;
 }
 
-PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeCircle(CSSParserValueList* args)
+PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeCircle(CSSParserValueList* args)
 {
     ASSERT(args);
 
@@ -4183,7 +4183,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeCircle(CSSParserValueList* arg
     return shape;
 }
 
-PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeEllipse(CSSParserValueList* args)
+PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapeEllipse(CSSParserValueList* args)
 {
     ASSERT(args);
 
@@ -4229,7 +4229,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapeEllipse(CSSParserValueList* ar
     return shape;
 }
 
-PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapePolygon(CSSParserValueList* args)
+PassRefPtr<CSSWrapShape> CSSParser::parseExclusionShapePolygon(CSSParserValueList* args)
 {
     ASSERT(args);
 
@@ -4279,7 +4279,7 @@ PassRefPtr<CSSWrapShape> CSSParser::parseWrapShapePolygon(CSSParserValueList* ar
     return shape;
 }
 
-bool CSSParser::parseWrapShape(bool shapeInside, bool important)
+bool CSSParser::parseExclusionShape(bool shapeInside, bool important)
 {
     CSSParserValue* value = m_valueList->current();
     CSSParserValueList* args = value->function->args.get();
@@ -4290,16 +4290,16 @@ bool CSSParser::parseWrapShape(bool shapeInside, bool important)
     RefPtr<CSSWrapShape> shape;
 
     if (equalIgnoringCase(value->function->name, "rect("))
-        shape = parseWrapShapeRect(args);
+        shape = parseExclusionShapeRect(args);
     else if (equalIgnoringCase(value->function->name, "circle("))
-        shape = parseWrapShapeCircle(args);
+        shape = parseExclusionShapeCircle(args);
     else if (equalIgnoringCase(value->function->name, "ellipse("))
-        shape = parseWrapShapeEllipse(args);
+        shape = parseExclusionShapeEllipse(args);
     else if (equalIgnoringCase(value->function->name, "polygon("))
-        shape = parseWrapShapePolygon(args);
+        shape = parseExclusionShapePolygon(args);
 
     if (shape) {
-        addProperty(shapeInside ? CSSPropertyWebkitWrapShapeInside : CSSPropertyWebkitWrapShapeOutside, cssValuePool()->createValue(shape.release()), important);
+        addProperty(shapeInside ? CSSPropertyWebkitShapeInside : CSSPropertyWebkitShapeOutside, cssValuePool()->createValue(shape.release()), important);
         m_valueList->next();
         return true;
     }
index f4df8e9..ccf10e1 100644 (file)
@@ -138,13 +138,13 @@ public:
 
     bool parseDashboardRegions(int propId, bool important);
 
-    bool parseShape(int propId, bool important);
+    bool parseClipShape(int propId, bool important);
 
-    bool parseWrapShape(bool shapeInside, bool important);
-    PassRefPtr<CSSWrapShape> parseWrapShapeRect(CSSParserValueList* args);
-    PassRefPtr<CSSWrapShape> parseWrapShapeCircle(CSSParserValueList* args);
-    PassRefPtr<CSSWrapShape> parseWrapShapeEllipse(CSSParserValueList* args);
-    PassRefPtr<CSSWrapShape> parseWrapShapePolygon(CSSParserValueList* args);
+    bool parseExclusionShape(bool shapeInside, bool important);
+    PassRefPtr<CSSWrapShape> parseExclusionShapeRect(CSSParserValueList* args);
+    PassRefPtr<CSSWrapShape> parseExclusionShapeCircle(CSSParserValueList* args);
+    PassRefPtr<CSSWrapShape> parseExclusionShapeEllipse(CSSParserValueList* args);
+    PassRefPtr<CSSWrapShape> parseExclusionShapePolygon(CSSParserValueList* args);
 
     bool parseFont(bool important);
     PassRefPtr<CSSValueList> parseFontFamily();
index ab10439..b0e63ec 100644 (file)
@@ -610,8 +610,8 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
     case CSSPropertyWebkitWrapFlow:
     case CSSPropertyWebkitWrapMargin:
     case CSSPropertyWebkitWrapPadding:
-    case CSSPropertyWebkitWrapShapeInside:
-    case CSSPropertyWebkitWrapShapeOutside:
+    case CSSPropertyWebkitShapeInside:
+    case CSSPropertyWebkitShapeOutside:
     case CSSPropertyWebkitWrapThrough:
 #if ENABLE(SVG)
     case CSSPropertyClipPath:
index b22555f..d6374ae 100644 (file)
@@ -361,8 +361,8 @@ z-index
 -webkit-flow-into
 -webkit-flow-from
 -webkit-region-overflow
--webkit-wrap-shape-inside
--webkit-wrap-shape-outside
+-webkit-shape-inside
+-webkit-shape-outside
 -webkit-wrap-margin
 -webkit-wrap-padding
 -webkit-region-break-after
index e522a3c..091aca3 100644 (file)
@@ -3739,7 +3739,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
         return;
     }
 
-    case CSSPropertyWebkitWrapShapeInside:
+    case CSSPropertyWebkitShapeInside:
         HANDLE_INHERIT_AND_INITIAL(wrapShapeInside, WrapShapeInside);
         if (!primitiveValue)
             return;
@@ -3749,7 +3749,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
             m_style->setWrapShapeInside(primitiveValue->getShapeValue());
         return;
 
-    case CSSPropertyWebkitWrapShapeOutside:
+    case CSSPropertyWebkitShapeOutside:
         HANDLE_INHERIT_AND_INITIAL(wrapShapeOutside, WrapShapeOutside);
         if (!primitiveValue)
             return;