Title: [135314] trunk
Revision
135314
Author
commit-qu...@webkit.org
Date
2012-11-20 14:39:38 -0800 (Tue, 20 Nov 2012)

Log Message

[CSS Exclusions] Support outside-shape value on shape-inside
https://bugs.webkit.org/show_bug.cgi?id=101108

Patch by Bear Travis <betra...@adobe.com> on 2012-11-20
Reviewed by Dirk Schulze.

Source/WebCore:

Shape-inside can potentially be: 'auto' | 'outside-shape' | <shape> | <url>.
Webkit currently supports the value 'auto' (null) and <shape> (a BasicShape*).
This patch adds support for the value 'outside-shape.' It adds the ExclusionShapeValue
class, which may be any of the three values: 'auto', 'outside-shape', or <shape>.
Bug 102738 tracks adding <url> support.

Modifying existing tests:
LayoutTests/fast/exclusions/parsing-wrap-shape-inside.html
LayoutTests/fast/exclusions/parsing-wrap-shape-outside.html

* GNUmakefile.list.am: Adding ExclusionShapeValue.h to the build files.
* Target.pri: Ditto.
* WebCore.gypi: Ditto.
* WebCore.vcproj/WebCore.vcproj: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
(WebCore):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Modifying code to use
ExclusionShapeValue* rather than the previous BasicShape* values.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Handle the outside-shape value.
* css/CSSValueKeywords.in: Adding outside-shape value.
* css/StyleBuilder.cpp:
(WebCore):
(WebCore::ApplyPropertyExclusionShape::setValue): Modify code to use
ExclusionShapeValue* rather than BasicShape*.
(WebCore::ApplyPropertyExclusionShape::applyValue): Ditto.
(WebCore::ApplyPropertyExclusionShape::createHandler): Ditto.
* page/animation/CSSPropertyAnimation.cpp: Ditto.
(WebCore::blendFunc): Ditto.
(WebCore::PropertyWrapperExclusionShape::PropertyWrapperExclusionShape): Ditto.
(WebCore::CSSPropertyAnimation::ensurePropertyMap): Ditto.
* rendering/ExclusionShapeInsideInfo.cpp:
(WebCore::ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock):
Ditto.
(WebCore::ExclusionShapeInsideInfo::computeShapeSize): Ditto.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange): Ditto.
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/style/ExclusionShapeValue.h: Added.
(WebCore):
(ExclusionShapeValue): New type to represent the possible values of shape-inside
and shape-outside. Only shape-inside can have a value of 'outside-shape.'
(WebCore::ExclusionShapeValue::~ExclusionShapeValue):
(WebCore::ExclusionShapeValue::type): Returns the value type.
(WebCore::ExclusionShapeValue::shape): Returns <shape> value's BasicShape*.
(WebCore::ExclusionShapeValue::operator==):
(WebCore::ExclusionShapeInfo::createShapeValue):
(WebCore::ExclusionShapeInfo::createOutsideValue):
(WebCore::ExclusionShapeValue::ExclusionShapeValue):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.h:
(StyleRareNonInheritedData):

LayoutTests:

Adding tests to make sure the 'outside-shape' value properly applies only to the
shape-inside property.

* 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:
* fast/exclusions/script-tests/parsing-wrap-shape-outside.js:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (135313 => 135314)


--- trunk/LayoutTests/ChangeLog	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/LayoutTests/ChangeLog	2012-11-20 22:39:38 UTC (rev 135314)
@@ -1,3 +1,18 @@
+2012-11-20  Bear Travis  <betra...@adobe.com>
+
+        [CSS Exclusions] Support outside-shape value on shape-inside
+        https://bugs.webkit.org/show_bug.cgi?id=101108
+
+        Reviewed by Dirk Schulze.
+
+        Adding tests to make sure the 'outside-shape' value properly applies only to the
+        shape-inside property.
+
+        * 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:
+        * fast/exclusions/script-tests/parsing-wrap-shape-outside.js:
+
 2012-11-20  Jian Li  <jia...@chromium.org>
 
         Unreviewed. Updated chromium test expectations.

Modified: trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-inside-expected.txt (135313 => 135314)


--- trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-inside-expected.txt	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-inside-expected.txt	2012-11-20 22:39:38 UTC (rev 135314)
@@ -5,6 +5,8 @@
 
 PASS testCSSText("auto") is "auto"
 PASS testComputedStyle("auto") is "auto"
+PASS testCSSText("outside-shape") is "outside-shape"
+PASS testComputedStyle("outside-shape") is "outside-shape"
 PASS testCSSText("rectangle(10px, 20px, 30px, 40px)") is "rectangle(10px, 20px, 30px, 40px)"
 PASS testComputedStyle("rectangle(10px, 20px, 30px, 40px)") is "rectangle(10px, 20px, 30px, 40px)"
 PASS testCSSText("rectangle(10px, 20px, 30px, 40px, 5px)") is "rectangle(10px, 20px, 30px, 40px, 5px)"
@@ -22,6 +24,7 @@
 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", "rectangle(10px, 20px, 30px, 40px)") is "parent: auto, child: rectangle(10px, 20px, 30px, 40px)"
+PASS testNotInherited("outside-shape", "rectangle(10px, 20px, 30px, 40px)") is "parent: outside-shape, child: rectangle(10px, 20px, 30px, 40px)"
 PASS testNotInherited("rectangle(10px, 20px, 30px, 40px)", "initial") is "parent: rectangle(10px, 20px, 30px, 40px), child: auto"
 PASS testNotInherited("rectangle(10px, 20px, 30px, 40px)", "") is "parent: rectangle(10px, 20px, 30px, 40px), child: auto"
 PASS testNotInherited("rectangle(10px, 20px, 30px, 40px)", "inherit") is "parent: rectangle(10px, 20px, 30px, 40px), child: rectangle(10px, 20px, 30px, 40px)"

Modified: trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-outside-expected.txt (135313 => 135314)


--- trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-outside-expected.txt	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/LayoutTests/fast/exclusions/parsing-wrap-shape-outside-expected.txt	2012-11-20 22:39:38 UTC (rev 135314)
@@ -31,6 +31,8 @@
 PASS testComputedStyle("calc()") is "auto"
 PASS testCSSText("none") is ""
 PASS testComputedStyle("none") is "auto"
+PASS testCSSText("outside-shape") is ""
+PASS testComputedStyle("outside-shape") is "auto"
 PASS testCSSText("rectangle()") is ""
 PASS testComputedStyle("rectangle()") is "auto"
 PASS testCSSText("rectangle(10px)") is ""

Modified: trunk/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js (135313 => 135314)


--- trunk/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-inside.js	2012-11-20 22:39:38 UTC (rev 135314)
@@ -58,6 +58,7 @@
 // positive tests
 
 test("auto", "auto");
+test("outside-shape", "outside-shape");
 test("rectangle(10px, 20px, 30px, 40px)", "rectangle(10px, 20px, 30px, 40px)");
 test("rectangle(10px, 20px, 30px, 40px, 5px)", "rectangle(10px, 20px, 30px, 40px, 5px)");
 test("rectangle(10px, 20px, 30px, 40px, 5px, 10px)", "rectangle(10px, 20px, 30px, 40px, 5px, 10px)");
@@ -71,6 +72,7 @@
 test("polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)");
 
 shouldBeEqualToString('testNotInherited("auto", "rectangle(10px, 20px, 30px, 40px)")', "parent: auto, child: rectangle(10px, 20px, 30px, 40px)");
+shouldBeEqualToString('testNotInherited("outside-shape", "rectangle(10px, 20px, 30px, 40px)")', "parent: outside-shape, child: rectangle(10px, 20px, 30px, 40px)");
 shouldBeEqualToString('testNotInherited("rectangle(10px, 20px, 30px, 40px)", "initial")', "parent: rectangle(10px, 20px, 30px, 40px), child: auto");
 shouldBeEqualToString('testNotInherited("rectangle(10px, 20px, 30px, 40px)", "")', "parent: rectangle(10px, 20px, 30px, 40px), child: auto");
 shouldBeEqualToString('testNotInherited("rectangle(10px, 20px, 30px, 40px)", "inherit")', "parent: rectangle(10px, 20px, 30px, 40px), child: rectangle(10px, 20px, 30px, 40px)");

Modified: trunk/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-outside.js (135313 => 135314)


--- trunk/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-outside.js	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/LayoutTests/fast/exclusions/script-tests/parsing-wrap-shape-outside.js	2012-11-20 22:39:38 UTC (rev 135314)
@@ -81,6 +81,7 @@
 
 negative_test("calc()");
 negative_test("none");
+negative_test("outside-shape");
 
 negative_test("rectangle()");
 negative_test("rectangle(10px)");

Modified: trunk/Source/WebCore/ChangeLog (135313 => 135314)


--- trunk/Source/WebCore/ChangeLog	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/ChangeLog	2012-11-20 22:39:38 UTC (rev 135314)
@@ -1,3 +1,65 @@
+2012-11-20  Bear Travis  <betra...@adobe.com>
+
+        [CSS Exclusions] Support outside-shape value on shape-inside
+        https://bugs.webkit.org/show_bug.cgi?id=101108
+
+        Reviewed by Dirk Schulze.
+
+        Shape-inside can potentially be: 'auto' | 'outside-shape' | <shape> | <url>.
+        Webkit currently supports the value 'auto' (null) and <shape> (a BasicShape*).
+        This patch adds support for the value 'outside-shape.' It adds the ExclusionShapeValue
+        class, which may be any of the three values: 'auto', 'outside-shape', or <shape>.
+        Bug 102738 tracks adding <url> support.
+
+        Modifying existing tests:
+        LayoutTests/fast/exclusions/parsing-wrap-shape-inside.html
+        LayoutTests/fast/exclusions/parsing-wrap-shape-outside.html
+
+        * GNUmakefile.list.am: Adding ExclusionShapeValue.h to the build files.
+        * Target.pri: Ditto.
+        * WebCore.gypi: Ditto.
+        * WebCore.vcproj/WebCore.vcproj: Ditto.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+        (WebCore):
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Modifying code to use
+        ExclusionShapeValue* rather than the previous BasicShape* values.
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue): Handle the outside-shape value.
+        * css/CSSValueKeywords.in: Adding outside-shape value.
+        * css/StyleBuilder.cpp:
+        (WebCore):
+        (WebCore::ApplyPropertyExclusionShape::setValue): Modify code to use
+        ExclusionShapeValue* rather than BasicShape*.
+        (WebCore::ApplyPropertyExclusionShape::applyValue): Ditto.
+        (WebCore::ApplyPropertyExclusionShape::createHandler): Ditto.
+        * page/animation/CSSPropertyAnimation.cpp: Ditto.
+        (WebCore::blendFunc): Ditto.
+        (WebCore::PropertyWrapperExclusionShape::PropertyWrapperExclusionShape): Ditto.
+        (WebCore::CSSPropertyAnimation::ensurePropertyMap): Ditto.
+        * rendering/ExclusionShapeInsideInfo.cpp:
+        (WebCore::ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock):
+        Ditto.
+        (WebCore::ExclusionShapeInsideInfo::computeShapeSize): Ditto.
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange): Ditto.
+        * rendering/RenderBlock.h:
+        (RenderBlock):
+        * rendering/style/ExclusionShapeValue.h: Added.
+        (WebCore):
+        (ExclusionShapeValue): New type to represent the possible values of shape-inside
+        and shape-outside. Only shape-inside can have a value of 'outside-shape.'
+        (WebCore::ExclusionShapeValue::~ExclusionShapeValue):
+        (WebCore::ExclusionShapeValue::type): Returns the value type.
+        (WebCore::ExclusionShapeValue::shape): Returns <shape> value's BasicShape*.
+        (WebCore::ExclusionShapeValue::operator==):
+        (WebCore::ExclusionShapeInfo::createShapeValue):
+        (WebCore::ExclusionShapeInfo::createOutsideValue):
+        (WebCore::ExclusionShapeValue::ExclusionShapeValue):
+        * rendering/style/RenderStyle.h:
+        * rendering/style/StyleRareNonInheritedData.h:
+        (StyleRareNonInheritedData):
+
 2012-11-20  Alpha Lam  <hc...@chromium.org>
 
         [chromium] Make lazy image decoding thread-safe

Modified: trunk/Source/WebCore/GNUmakefile.list.am (135313 => 135314)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-11-20 22:39:38 UTC (rev 135314)
@@ -4437,6 +4437,7 @@
 	Source/WebCore/rendering/style/CursorData.h \
 	Source/WebCore/rendering/style/CursorList.h \
 	Source/WebCore/rendering/style/DataRef.h \
+	Source/WebCore/rendering/style/ExclusionShapeValue.h \
 	Source/WebCore/rendering/style/FillLayer.cpp \
 	Source/WebCore/rendering/style/FillLayer.h \
 	Source/WebCore/rendering/style/GridPosition.h \

Modified: trunk/Source/WebCore/Target.pri (135313 => 135314)


--- trunk/Source/WebCore/Target.pri	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/Target.pri	2012-11-20 22:39:38 UTC (rev 135314)
@@ -2446,6 +2446,7 @@
     rendering/style/CounterDirectives.h \
     rendering/style/CursorData.h \
     rendering/style/CursorList.h \
+    rendering/style/ExclusionShapeValue.h \
     rendering/style/FillLayer.h \
     rendering/style/KeyframeList.h \
     rendering/style/NinePieceImage.h \

Modified: trunk/Source/WebCore/WebCore.gypi (135313 => 135314)


--- trunk/Source/WebCore/WebCore.gypi	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/WebCore.gypi	2012-11-20 22:39:38 UTC (rev 135314)
@@ -597,6 +597,7 @@
             'rendering/style/CursorData.h',
             'rendering/style/CursorList.h',
             'rendering/style/DataRef.h',
+            'rendering/style/ExclusionShapeValue.h',
             'rendering/style/FillLayer.h',
             'rendering/style/GridPosition.h',
             'rendering/style/LineClampValue.h',

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (135313 => 135314)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-11-20 22:39:38 UTC (rev 135314)
@@ -45443,6 +45443,10 @@
 					>
 				</File>
 				<File
+				    RelativePath="..\rendering\style\ExclusionShapeValue.h"
+				    >
+				</File>
+				<File
 					RelativePath="..\rendering\style\FillLayer.cpp"
 					>
 					<FileConfiguration

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (135313 => 135314)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-11-20 22:39:38 UTC (rev 135314)
@@ -6387,6 +6387,7 @@
 		FD06DFA5134A4DEF006F5D7D /* DefaultAudioDestinationNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD06DFA3134A4DEF006F5D7D /* DefaultAudioDestinationNode.cpp */; };
 		FD06DFA6134A4DEF006F5D7D /* DefaultAudioDestinationNode.h in Headers */ = {isa = PBXBuildFile; fileRef = FD06DFA4134A4DEF006F5D7D /* DefaultAudioDestinationNode.h */; };
 		FD1660A513787C6D001FFA7B /* DenormalDisabler.h in Headers */ = {isa = PBXBuildFile; fileRef = FD1660A413787C6D001FFA7B /* DenormalDisabler.h */; };
+		FD1AF1501656F15100C6D4F7 /* ExclusionShapeValue.h in Headers */ = {isa = PBXBuildFile; fileRef = FD1AF14E1656F12100C6D4F7 /* ExclusionShapeValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		FD23A12513F5FA5900F67001 /* JSMediaElementAudioSourceNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FD23A12313F5FA5900F67001 /* JSMediaElementAudioSourceNode.cpp */; };
 		FD23A12613F5FA5900F67001 /* JSMediaElementAudioSourceNode.h in Headers */ = {isa = PBXBuildFile; fileRef = FD23A12413F5FA5900F67001 /* JSMediaElementAudioSourceNode.h */; };
 		FD2DBF1212B048A300ED98C6 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD2DBF0E12B048A300ED98C6 /* Accelerate.framework */; };
@@ -13875,6 +13876,7 @@
 		FD06DFA3134A4DEF006F5D7D /* DefaultAudioDestinationNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DefaultAudioDestinationNode.cpp; sourceTree = "<group>"; };
 		FD06DFA4134A4DEF006F5D7D /* DefaultAudioDestinationNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DefaultAudioDestinationNode.h; sourceTree = "<group>"; };
 		FD1660A413787C6D001FFA7B /* DenormalDisabler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DenormalDisabler.h; sourceTree = "<group>"; };
+		FD1AF14E1656F12100C6D4F7 /* ExclusionShapeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExclusionShapeValue.h; path = style/ExclusionShapeValue.h; sourceTree = "<group>"; };
 		FD23A12313F5FA5900F67001 /* JSMediaElementAudioSourceNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaElementAudioSourceNode.cpp; sourceTree = "<group>"; };
 		FD23A12413F5FA5900F67001 /* JSMediaElementAudioSourceNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMediaElementAudioSourceNode.h; sourceTree = "<group>"; };
 		FD2DBF0E12B048A300ED98C6 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = /System/Library/Frameworks/Accelerate.framework; sourceTree = "<absolute>"; };
@@ -20630,6 +20632,7 @@
 				BC2272A10E82E87C00E7F975 /* CursorData.h */,
 				BC2272AC0E82E8F300E7F975 /* CursorList.h */,
 				BC22746E0E83664500E7F975 /* DataRef.h */,
+				FD1AF14E1656F12100C6D4F7 /* ExclusionShapeValue.h */,
 				BC5EB69C0E81DAEB00B25965 /* FillLayer.cpp */,
 				BC5EB69D0E81DAEB00B25965 /* FillLayer.h */,
 				A12705C21656BD6500C2E27C /* GridPosition.h */,
@@ -22457,6 +22460,7 @@
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				FD1AF1501656F15100C6D4F7 /* ExclusionShapeValue.h in Headers */,
 				BC7FA6210D1F0CBD00DB22A9 /* DynamicNodeList.h in Headers */,
 				A81369DA097374F600D74463 /* HTMLOptionsCollection.h in Headers */,
 				A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */,

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (135313 => 135314)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-11-20 22:39:38 UTC (rev 135314)
@@ -64,6 +64,10 @@
 #include "WebKitFontFamilyNames.h"
 #include <wtf/text/StringBuilder.h>
 
+#if ENABLE(CSS_EXCLUSIONS)
+#include "ExclusionShapeValue.h"
+#endif
+
 #if ENABLE(CSS_SHADERS)
 #include "CustomFilterArrayParameter.h"
 #include "CustomFilterNumberParameter.h"
@@ -2504,11 +2508,15 @@
         case CSSPropertyWebkitShapeInside:
             if (!style->shapeInside())
                 return cssValuePool().createIdentifierValue(CSSValueAuto);
-            return valueForBasicShape(style->shapeInside());
+            else if (style->shapeInside()->type() == ExclusionShapeValue::OUTSIDE)
+                return cssValuePool().createIdentifierValue(CSSValueOutsideShape);
+            ASSERT(style->shapeInside()->type() == ExclusionShapeValue::SHAPE);
+            return valueForBasicShape(style->shapeInside()->shape());
         case CSSPropertyWebkitShapeOutside:
             if (!style->shapeOutside())
                 return cssValuePool().createIdentifierValue(CSSValueAuto);
-            return valueForBasicShape(style->shapeOutside());
+            ASSERT(style->shapeOutside()->type() == ExclusionShapeValue::SHAPE);
+            return valueForBasicShape(style->shapeOutside()->shape());
         case CSSPropertyWebkitWrapThrough:
             return cssValuePool().createValue(style->wrapThrough());
 #endif

Modified: trunk/Source/WebCore/css/CSSParser.cpp (135313 => 135314)


--- trunk/Source/WebCore/css/CSSParser.cpp	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2012-11-20 22:39:38 UTC (rev 135314)
@@ -2735,6 +2735,8 @@
             return false;
         if (id == CSSValueAuto)
             validPrimitive = true;
+        else if (propId == CSSPropertyWebkitShapeInside && id == CSSValueOutsideShape)
+            validPrimitive = true;
         else if (value->unit == CSSParserValue::Function)
             return parseBasicShape(propId, important);
         break;

Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (135313 => 135314)


--- trunk/Source/WebCore/css/CSSValueKeywords.in	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in	2012-11-20 22:39:38 UTC (rev 135314)
@@ -914,9 +914,11 @@
 optimizeQuality
 -webkit-optimize-contrast
 
-// -webkit-wrap-shape
+// -webkit-shape-inside
+// -webkit-shape-outside
 nonzero
 evenodd
+outside-shape
 
 // -webkit-region-overflow
 // auto

Modified: trunk/Source/WebCore/css/StyleBuilder.cpp (135313 => 135314)


--- trunk/Source/WebCore/css/StyleBuilder.cpp	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/css/StyleBuilder.cpp	2012-11-20 22:39:38 UTC (rev 135314)
@@ -47,6 +47,10 @@
 #include <wtf/StdLibExtras.h>
 #include <wtf/UnusedParam.h>
 
+#if ENABLE(CSS_EXCLUSIONS)
+#include "ExclusionShapeValue.h"
+#endif
+
 using namespace std;
 
 namespace WebCore {
@@ -1716,25 +1720,28 @@
 };
 
 #if ENABLE(CSS_EXCLUSIONS)
-template <BasicShape* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<BasicShape>), BasicShape* (*initialFunction)()>
+template <ExclusionShapeValue* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<ExclusionShapeValue>), ExclusionShapeValue* (*initialFunction)()>
 class ApplyPropertyExclusionShape {
 public:
-    static void setValue(RenderStyle* style, PassRefPtr<BasicShape> value) { (style->*setterFunction)(value); }
+    static void setValue(RenderStyle* style, PassRefPtr<ExclusionShapeValue> value) { (style->*setterFunction)(value); }
     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
     {
         if (value->isPrimitiveValue()) {
             CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
             if (primitiveValue->getIdent() == CSSValueAuto)
                 setValue(styleResolver->style(), 0);
+            // FIXME Bug 102571: Layout for the value 'outside-shape' is not yet implemented
+            else if (primitiveValue->getIdent() == CSSValueOutsideShape)
+                setValue(styleResolver->style(), ExclusionShapeValue::createOutsideValue());
             else if (primitiveValue->isShape()) {
-                RefPtr<BasicShape> shape = basicShapeForValue(styleResolver, primitiveValue->getShapeValue());
+                RefPtr<ExclusionShapeValue> shape = ExclusionShapeValue::createShapeValue(basicShapeForValue(styleResolver, primitiveValue->getShapeValue()));
                 setValue(styleResolver->style(), shape.release());
             }
         }
     }
     static PropertyHandler createHandler()
     {
-        PropertyHandler handler = ApplyPropertyDefaultBase<BasicShape*, getterFunction, PassRefPtr<BasicShape>, setterFunction, BasicShape*, initialFunction>::createHandler();
+        PropertyHandler handler = ApplyPropertyDefaultBase<ExclusionShapeValue*, getterFunction, PassRefPtr<ExclusionShapeValue>, setterFunction, ExclusionShapeValue*, initialFunction>::createHandler();
         return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
     }
 };

Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (135313 => 135314)


--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2012-11-20 22:39:38 UTC (rev 135314)
@@ -143,12 +143,19 @@
 }
 
 #if ENABLE(CSS_EXCLUSIONS)
-static inline PassRefPtr<BasicShape> blendFunc(const AnimationBase*, BasicShape* from, BasicShape* to, double progress)
+static inline PassRefPtr<ExclusionShapeValue> blendFunc(const AnimationBase*, ExclusionShapeValue* from, ExclusionShapeValue* to, double progress)
 {
-    if (!from->canBlend(to))
+    // FIXME Bug 102723: Shape-inside should be able to animate a value of 'outside-shape' when shape-outside is set to a BasicShape
+    if (from->type() != ExclusionShapeValue::SHAPE || to->type() != ExclusionShapeValue::SHAPE)
         return to;
 
-    return to->blend(from, progress);
+    const BasicShape* fromShape = from->shape();
+    const BasicShape* toShape = to->shape();
+
+    if (!fromShape->canBlend(toShape))
+        return to;
+
+    return ExclusionShapeValue::createShapeValue(toShape->blend(fromShape, progress));
 }
 #endif
 
@@ -404,10 +411,10 @@
 };
 
 #if ENABLE(CSS_EXCLUSIONS)
-class PropertyWrapperBasicShape : public RefCountedPropertyWrapper<BasicShape> {
+class PropertyWrapperExclusionShape : public RefCountedPropertyWrapper<ExclusionShapeValue> {
 public:
-    PropertyWrapperBasicShape(CSSPropertyID prop, BasicShape* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(PassRefPtr<BasicShape>))
-        : RefCountedPropertyWrapper<BasicShape>(prop, getter, setter)
+    PropertyWrapperExclusionShape(CSSPropertyID prop, ExclusionShapeValue* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(PassRefPtr<ExclusionShapeValue>))
+        : RefCountedPropertyWrapper<ExclusionShapeValue>(prop, getter, setter)
     {
     }
 };
@@ -1162,7 +1169,7 @@
     gPropertyWrappers->append(new PropertyWrapperClipPath(CSSPropertyWebkitClipPath, &RenderStyle::clipPath, &RenderStyle::setClipPath));
 
 #if ENABLE(CSS_EXCLUSIONS)
-    gPropertyWrappers->append(new PropertyWrapperBasicShape(CSSPropertyWebkitShapeInside, &RenderStyle::shapeInside, &RenderStyle::setShapeInside));
+    gPropertyWrappers->append(new PropertyWrapperExclusionShape(CSSPropertyWebkitShapeInside, &RenderStyle::shapeInside, &RenderStyle::setShapeInside));
 #endif
 
     gPropertyWrappers->append(new PropertyWrapperVisitedAffectedColor(CSSPropertyWebkitColumnRuleColor, MaybeInvalidColor, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::visitedLinkColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor));

Modified: trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.cpp (135313 => 135314)


--- trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.cpp	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.cpp	2012-11-20 22:39:38 UTC (rev 135314)
@@ -72,7 +72,8 @@
 bool ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock(const RenderBlock* block)
 {
     // FIXME: Bug 89707: Enable shape inside for non-rectangular shapes
-    BasicShape* shape = block->style()->shapeInside();
+    ExclusionShapeValue* shapeValue = block->style()->shapeInside();
+    BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue::SHAPE) ? shapeValue->shape() : 0;
     return shape && (shape->type() == BasicShape::BASIC_SHAPE_RECTANGLE || shape->type() == BasicShape::BASIC_SHAPE_POLYGON);
 }
 
@@ -93,7 +94,9 @@
     m_logicalHeight = logicalHeight;
 
     // FIXME: Bug 89993: The wrap shape may come from the parent object
-    BasicShape* shape = m_block->style()->shapeInside();
+    ExclusionShapeValue* shapeValue = m_block->style()->shapeInside();
+    BasicShape* shape = (shapeValue && shapeValue->type() == ExclusionShapeValue::SHAPE) ? shapeValue->shape() : 0;
+
     ASSERT(shape);
 
     m_shape = ExclusionShape::createExclusionShape(shape, logicalWidth, logicalHeight, m_block->style()->writingMode());

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (135313 => 135314)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-11-20 22:39:38 UTC (rev 135314)
@@ -1398,7 +1398,7 @@
 }
 
 #if ENABLE(CSS_EXCLUSIONS)
-void RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape* shapeInside, const BasicShape* oldShapeInside)
+void RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange(const ExclusionShapeValue* shapeInside, const ExclusionShapeValue* oldShapeInside)
 {
     // FIXME: A future optimization would do a deep comparison for equality.
     if (shapeInside == oldShapeInside)

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (135313 => 135314)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2012-11-20 22:39:38 UTC (rev 135314)
@@ -36,6 +36,7 @@
 
 #if ENABLE(CSS_EXCLUSIONS)
 #include "ExclusionShapeInsideInfo.h"
+#include "ExclusionShapeValue.h"
 #endif
 
 namespace WebCore {
@@ -521,7 +522,7 @@
 private:
 #if ENABLE(CSS_EXCLUSIONS)
     void computeExclusionShapeSize();
-    void updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape*, const BasicShape* oldWrapShape);
+    void updateExclusionShapeInsideInfoAfterStyleChange(const ExclusionShapeValue*, const ExclusionShapeValue* oldExclusionShape);
 #endif
     virtual RenderObjectChildList* virtualChildren() { return children(); }
     virtual const RenderObjectChildList* virtualChildren() const { return children(); }

Added: trunk/Source/WebCore/rendering/style/ExclusionShapeValue.h (0 => 135314)


--- trunk/Source/WebCore/rendering/style/ExclusionShapeValue.h	                        (rev 0)
+++ trunk/Source/WebCore/rendering/style/ExclusionShapeValue.h	2012-11-20 22:39:38 UTC (rev 135314)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ *    copyright notice, this list of conditions and the following
+ *    disclaimer in the documentation and/or other materials
+ *    provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef ExclusionShapeValue_h
+#define ExclusionShapeValue_h
+
+#include "BasicShapes.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class ExclusionShapeValue : public RefCounted<ExclusionShapeValue> {
+public:
+    enum ExclusionShapeValueType {
+        // The AUTO value is defined by a null ExclusionShapeValue*
+        SHAPE,
+        OUTSIDE
+    };
+
+    static PassRefPtr<ExclusionShapeValue> createShapeValue(PassRefPtr<BasicShape> shape)
+    {
+        return adoptRef(new ExclusionShapeValue(shape));
+    }
+
+    static PassRefPtr<ExclusionShapeValue> createOutsideValue()
+    {
+        return adoptRef(new ExclusionShapeValue(OUTSIDE));
+    }
+
+    ExclusionShapeValueType type() const { return m_type; }
+    BasicShape* shape() const { return m_shape.get(); }
+    bool operator==(const ExclusionShapeValue& other) const { return type() == other.type(); }
+
+private:
+    ExclusionShapeValue(PassRefPtr<BasicShape> shape) : m_type(SHAPE), m_shape(shape) { }
+    ExclusionShapeValue(ExclusionShapeValueType type) : m_type(type) { }
+    ExclusionShapeValueType m_type;
+    RefPtr<BasicShape> m_shape;
+};
+
+}
+
+#endif

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (135313 => 135314)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-11-20 22:39:38 UTC (rev 135314)
@@ -34,6 +34,7 @@
 #include "ColorSpace.h"
 #include "CounterDirectives.h"
 #include "DataRef.h"
+#include "ExclusionShapeValue.h"
 #include "FontBaseline.h"
 #include "FontDescription.h"
 #include "GraphicsTypes.h"
@@ -1455,22 +1456,24 @@
     void setKerning(SVGLength k) { accessSVGStyle()->setKerning(k); }
 #endif
 
-    void setShapeInside(PassRefPtr<BasicShape> shape)
+    void setShapeInside(PassRefPtr<ExclusionShapeValue> value)
     {
-        if (rareNonInheritedData->m_shapeInside != shape)
-            rareNonInheritedData.access()->m_shapeInside = shape;
+        if (rareNonInheritedData->m_shapeInside == value)
+            return;
+        rareNonInheritedData.access()->m_shapeInside = value;
     }
-    BasicShape* shapeInside() const { return rareNonInheritedData->m_shapeInside.get(); }
+    ExclusionShapeValue* shapeInside() const { return rareNonInheritedData->m_shapeInside.get(); }
 
-    void setShapeOutside(PassRefPtr<BasicShape> shape)
+    void setShapeOutside(PassRefPtr<ExclusionShapeValue> value)
     {
-        if (rareNonInheritedData->m_shapeOutside != shape)
-            rareNonInheritedData.access()->m_shapeOutside = shape;
+        if (rareNonInheritedData->m_shapeOutside == value)
+            return;
+        rareNonInheritedData.access()->m_shapeOutside = value;
     }
-    BasicShape* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
+    ExclusionShapeValue* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
 
-    static BasicShape* initialShapeInside() { return 0; }
-    static BasicShape* initialShapeOutside() { return 0; }
+    static ExclusionShapeValue* initialShapeInside() { return 0; }
+    static ExclusionShapeValue* initialShapeOutside() { return 0; }
 
     void setClipPath(PassRefPtr<ClipPathOperation> operation)
     {

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (135313 => 135314)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2012-11-20 22:27:07 UTC (rev 135313)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2012-11-20 22:39:38 UTC (rev 135314)
@@ -30,6 +30,7 @@
 #include "CounterDirectives.h"
 #include "CursorData.h"
 #include "DataRef.h"
+#include "ExclusionShapeValue.h"
 #include "FillLayer.h"
 #include "LineClampValue.h"
 #include "NinePieceImage.h"
@@ -137,8 +138,8 @@
 
     LengthSize m_pageSize;
 
-    RefPtr<BasicShape> m_shapeInside;
-    RefPtr<BasicShape> m_shapeOutside;
+    RefPtr<ExclusionShapeValue> m_shapeInside;
+    RefPtr<ExclusionShapeValue> m_shapeOutside;
     Length m_shapeMargin;
     Length m_shapePadding;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to