Title: [129787] trunk/Source/WebCore
Revision
129787
Author
commit-qu...@webkit.org
Date
2012-09-27 12:23:40 -0700 (Thu, 27 Sep 2012)

Log Message

[CSS Exclusions] Rename RenderStyle::wrapShapeInside/Outside to shapeInside/Outside
https://bugs.webkit.org/show_bug.cgi?id=97707

Patch by Bear Travis <betra...@adobe.com> on 2012-09-27
Reviewed by Antti Koivisto.

The exclusions specification has renamed wrap-shape-inside and wrap-shape-outside
to shape-inside and shape-outside. We should rename the getter/setter functions
in RenderStyle, and update the derived variable and function names accordingly.
For more information, see: http://dev.w3.org/csswg/css3-exclusions/#declaring-shapes

Covered by existing tests. No new functionality.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/StyleBuilder.cpp:
(WebCore::ApplyPropertyExclusionShape::applyValue):
(WebCore::StyleBuilder::StyleBuilder):
* rendering/ExclusionShapeInsideInfo.cpp:
(WebCore::ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock):
(WebCore::ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock):
(WebCore::ExclusionShapeInsideInfo::removeExclusionShapeInsideInfoForRenderBlock):
(WebCore::ExclusionShapeInsideInfo::computeShapeSize):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleDidChange):
(WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::exclusionShapeInsideInfo):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
(WebCore::StyleRareNonInheritedData::reportMemoryUsage):
* rendering/style/StyleRareNonInheritedData.h:
(StyleRareNonInheritedData):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (129786 => 129787)


--- trunk/Source/WebCore/ChangeLog	2012-09-27 19:04:59 UTC (rev 129786)
+++ trunk/Source/WebCore/ChangeLog	2012-09-27 19:23:40 UTC (rev 129787)
@@ -1,3 +1,42 @@
+2012-09-27  Bear Travis  <betra...@adobe.com>
+
+        [CSS Exclusions] Rename RenderStyle::wrapShapeInside/Outside to shapeInside/Outside
+        https://bugs.webkit.org/show_bug.cgi?id=97707
+
+        Reviewed by Antti Koivisto.
+
+        The exclusions specification has renamed wrap-shape-inside and wrap-shape-outside
+        to shape-inside and shape-outside. We should rename the getter/setter functions
+        in RenderStyle, and update the derived variable and function names accordingly.
+        For more information, see: http://dev.w3.org/csswg/css3-exclusions/#declaring-shapes
+
+        Covered by existing tests. No new functionality.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/StyleBuilder.cpp:
+        (WebCore::ApplyPropertyExclusionShape::applyValue):
+        (WebCore::StyleBuilder::StyleBuilder):
+        * rendering/ExclusionShapeInsideInfo.cpp:
+        (WebCore::ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock):
+        (WebCore::ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock):
+        (WebCore::ExclusionShapeInsideInfo::removeExclusionShapeInsideInfoForRenderBlock):
+        (WebCore::ExclusionShapeInsideInfo::computeShapeSize):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::styleDidChange):
+        (WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange):
+        * rendering/RenderBlock.h:
+        (WebCore::RenderBlock::exclusionShapeInsideInfo):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::diff):
+        * rendering/style/RenderStyle.h:
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==):
+        (WebCore::StyleRareNonInheritedData::reportMemoryUsage):
+        * rendering/style/StyleRareNonInheritedData.h:
+        (StyleRareNonInheritedData):
+
 2012-09-27  Michael Saboff  <msab...@apple.com>
 
         ApplicationCacheStorage does not optimally handle 8 bit strings

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (129786 => 129787)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-09-27 19:04:59 UTC (rev 129786)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2012-09-27 19:23:40 UTC (rev 129787)
@@ -2443,13 +2443,13 @@
         case CSSPropertyWebkitWrapPadding:
             return cssValuePool().createValue(style->wrapPadding());
         case CSSPropertyWebkitShapeInside:
-            if (!style->wrapShapeInside())
+            if (!style->shapeInside())
                 return cssValuePool().createIdentifierValue(CSSValueAuto);
-            return valueForBasicShape(style->wrapShapeInside());
+            return valueForBasicShape(style->shapeInside());
         case CSSPropertyWebkitShapeOutside:
-            if (!style->wrapShapeOutside())
+            if (!style->shapeOutside())
                 return cssValuePool().createIdentifierValue(CSSValueAuto);
-            return valueForBasicShape(style->wrapShapeOutside());
+            return valueForBasicShape(style->shapeOutside());
         case CSSPropertyWebkitWrapThrough:
             return cssValuePool().createValue(style->wrapThrough());
 #endif

Modified: trunk/Source/WebCore/css/StyleBuilder.cpp (129786 => 129787)


--- trunk/Source/WebCore/css/StyleBuilder.cpp	2012-09-27 19:04:59 UTC (rev 129786)
+++ trunk/Source/WebCore/css/StyleBuilder.cpp	2012-09-27 19:23:40 UTC (rev 129787)
@@ -1709,7 +1709,7 @@
 
 #if ENABLE(CSS_EXCLUSIONS)
 template <BasicShape* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<BasicShape>), BasicShape* (*initialFunction)()>
-class ApplyPropertyWrapShape {
+class ApplyPropertyExclusionShape {
 public:
     static void setValue(RenderStyle* style, PassRefPtr<BasicShape> value) { (style->*setterFunction)(value); }
     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
@@ -1719,8 +1719,8 @@
             if (primitiveValue->getIdent() == CSSValueAuto)
                 setValue(styleResolver->style(), 0);
             else if (primitiveValue->isShape()) {
-                RefPtr<BasicShape> wrapShape = basicShapeForValue(styleResolver, primitiveValue->getShapeValue());
-                setValue(styleResolver->style(), wrapShape.release());
+                RefPtr<BasicShape> shape = basicShapeForValue(styleResolver, primitiveValue->getShapeValue());
+                setValue(styleResolver->style(), shape.release());
             }
         }
     }
@@ -2060,8 +2060,8 @@
     setPropertyHandler(CSSPropertyWebkitWrapMargin, ApplyPropertyLength<&RenderStyle::wrapMargin, &RenderStyle::setWrapMargin, &RenderStyle::initialWrapMargin>::createHandler());
     setPropertyHandler(CSSPropertyWebkitWrapPadding, ApplyPropertyLength<&RenderStyle::wrapPadding, &RenderStyle::setWrapPadding, &RenderStyle::initialWrapPadding>::createHandler());
     setPropertyHandler(CSSPropertyWebkitWrapThrough, ApplyPropertyDefault<WrapThrough, &RenderStyle::wrapThrough, WrapThrough, &RenderStyle::setWrapThrough, WrapThrough, &RenderStyle::initialWrapThrough>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitShapeInside, ApplyPropertyWrapShape<&RenderStyle::wrapShapeInside, &RenderStyle::setWrapShapeInside, &RenderStyle::initialWrapShapeInside>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitShapeOutside, ApplyPropertyWrapShape<&RenderStyle::wrapShapeOutside, &RenderStyle::setWrapShapeOutside, &RenderStyle::initialWrapShapeOutside>::createHandler());
+    setPropertyHandler(CSSPropertyWebkitShapeInside, ApplyPropertyExclusionShape<&RenderStyle::shapeInside, &RenderStyle::setShapeInside, &RenderStyle::initialShapeInside>::createHandler());
+    setPropertyHandler(CSSPropertyWebkitShapeOutside, ApplyPropertyExclusionShape<&RenderStyle::shapeOutside, &RenderStyle::setShapeOutside, &RenderStyle::initialShapeOutside>::createHandler());
 #endif
     setPropertyHandler(CSSPropertyWhiteSpace, ApplyPropertyDefault<EWhiteSpace, &RenderStyle::whiteSpace, EWhiteSpace, &RenderStyle::setWhiteSpace, EWhiteSpace, &RenderStyle::initialWhiteSpace>::createHandler());
     setPropertyHandler(CSSPropertyWidows, ApplyPropertyDefault<short, &RenderStyle::widows, short, &RenderStyle::setWidows, short, &RenderStyle::initialWidows>::createHandler());

Modified: trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.cpp (129786 => 129787)


--- trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.cpp	2012-09-27 19:04:59 UTC (rev 129786)
+++ trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.cpp	2012-09-27 19:23:40 UTC (rev 129787)
@@ -65,20 +65,20 @@
 
 ExclusionShapeInsideInfo* ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock(const RenderBlock* block)
 {
-    ASSERT(block->style()->wrapShapeInside());
+    ASSERT(block->style()->shapeInside());
     return exclusionShapeInsideInfoMap().get(block);
 }
 
 bool ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock(const RenderBlock* block)
 {
     // FIXME: Bug 89707: Enable shape inside for non-rectangular shapes
-    BasicShape* shape = block->style()->wrapShapeInside();
+    BasicShape* shape = block->style()->shapeInside();
     return (shape && shape->type() == BasicShape::BASIC_SHAPE_RECTANGLE);
 }
 
 void ExclusionShapeInsideInfo::removeExclusionShapeInsideInfoForRenderBlock(const RenderBlock* block)
 {
-    if (!block->style() || !block->style()->wrapShapeInside())
+    if (!block->style() || !block->style()->shapeInside())
         return;
     exclusionShapeInsideInfoMap().remove(block);
 }
@@ -93,7 +93,7 @@
     m_logicalHeight = logicalHeight;
 
     // FIXME: Bug 89993: The wrap shape may come from the parent object
-    BasicShape* shape = m_block->style()->wrapShapeInside();
+    BasicShape* shape = m_block->style()->shapeInside();
     ASSERT(shape);
 
     m_shape = ExclusionShape::createExclusionShape(shape, logicalWidth, logicalHeight, m_block->style()->writingMode());

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (129786 => 129787)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-09-27 19:04:59 UTC (rev 129786)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-09-27 19:23:40 UTC (rev 129787)
@@ -330,7 +330,7 @@
 #if ENABLE(CSS_EXCLUSIONS)
     // FIXME: Bug 89993: Style changes should affect the ExclusionShapeInsideInfos for other render blocks that
     // share the same ExclusionShapeInsideInfo
-    updateExclusionShapeInsideInfoAfterStyleChange(style()->wrapShapeInside(), oldStyle ? oldStyle->wrapShapeInside() : 0);
+    updateExclusionShapeInsideInfoAfterStyleChange(style()->shapeInside(), oldStyle ? oldStyle->shapeInside() : 0);
 #endif
 
     if (!isAnonymousBlock()) {
@@ -1380,13 +1380,13 @@
 }
 
 #if ENABLE(CSS_EXCLUSIONS)
-void RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape* wrapShape, const BasicShape* oldWrapShape)
+void RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape* shapeInside, const BasicShape* oldShapeInside)
 {
     // FIXME: A future optimization would do a deep comparison for equality.
-    if (wrapShape == oldWrapShape)
+    if (shapeInside == oldShapeInside)
         return;
 
-    if (wrapShape) {
+    if (shapeInside) {
         ExclusionShapeInsideInfo* exclusionShapeInsideInfo = ExclusionShapeInsideInfo::ensureExclusionShapeInsideInfoForRenderBlock(this);
         exclusionShapeInsideInfo->dirtyShapeSize();
     } else

Modified: trunk/Source/WebCore/rendering/RenderBlock.h (129786 => 129787)


--- trunk/Source/WebCore/rendering/RenderBlock.h	2012-09-27 19:04:59 UTC (rev 129786)
+++ trunk/Source/WebCore/rendering/RenderBlock.h	2012-09-27 19:23:40 UTC (rev 129787)
@@ -404,7 +404,7 @@
 #if ENABLE(CSS_EXCLUSIONS)
     ExclusionShapeInsideInfo* exclusionShapeInsideInfo() const
     {
-        return style()->wrapShapeInside() && ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock(this) ? ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock(this) : 0;
+        return style()->shapeInside() && ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock(this) ? ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock(this) : 0;
     }
 #endif
 

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (129786 => 129787)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2012-09-27 19:04:59 UTC (rev 129786)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2012-09-27 19:23:40 UTC (rev 129787)
@@ -458,7 +458,7 @@
 #endif
 
 #if ENABLE(CSS_EXCLUSIONS)
-        if (rareNonInheritedData->m_wrapShapeInside != other->rareNonInheritedData->m_wrapShapeInside)
+        if (rareNonInheritedData->m_shapeInside != other->rareNonInheritedData->m_shapeInside)
             return StyleDifferenceLayout;
 #endif
     }
@@ -679,7 +679,7 @@
         // 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_wrapShapeOutside != other->rareNonInheritedData->m_wrapShapeOutside)
+        if (rareNonInheritedData->m_shapeOutside != other->rareNonInheritedData->m_shapeOutside)
             return StyleDifferenceRepaint;
 
         if (rareNonInheritedData->m_clipPath != other->rareNonInheritedData->m_clipPath)

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (129786 => 129787)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-09-27 19:04:59 UTC (rev 129786)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2012-09-27 19:23:40 UTC (rev 129787)
@@ -1445,22 +1445,22 @@
     void setKerning(SVGLength k) { accessSVGStyle()->setKerning(k); }
 #endif
 
-    void setWrapShapeInside(PassRefPtr<BasicShape> shape)
+    void setShapeInside(PassRefPtr<BasicShape> shape)
     {
-        if (rareNonInheritedData->m_wrapShapeInside != shape)
-            rareNonInheritedData.access()->m_wrapShapeInside = shape;
+        if (rareNonInheritedData->m_shapeInside != shape)
+            rareNonInheritedData.access()->m_shapeInside = shape;
     }
-    BasicShape* wrapShapeInside() const { return rareNonInheritedData->m_wrapShapeInside.get(); }
+    BasicShape* shapeInside() const { return rareNonInheritedData->m_shapeInside.get(); }
 
-    void setWrapShapeOutside(PassRefPtr<BasicShape> shape)
+    void setShapeOutside(PassRefPtr<BasicShape> shape)
     {
-        if (rareNonInheritedData->m_wrapShapeOutside != shape)
-            rareNonInheritedData.access()->m_wrapShapeOutside = shape;
+        if (rareNonInheritedData->m_shapeOutside != shape)
+            rareNonInheritedData.access()->m_shapeOutside = shape;
     }
-    BasicShape* wrapShapeOutside() const { return rareNonInheritedData->m_wrapShapeOutside.get(); }
+    BasicShape* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
 
-    static BasicShape* initialWrapShapeInside() { return 0; }
-    static BasicShape* initialWrapShapeOutside() { return 0; }
+    static BasicShape* initialShapeInside() { return 0; }
+    static BasicShape* initialShapeOutside() { return 0; }
 
     void setClipPath(PassRefPtr<ClipPathOperation> operation)
     {

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (129786 => 129787)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2012-09-27 19:04:59 UTC (rev 129786)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2012-09-27 19:23:40 UTC (rev 129787)
@@ -45,8 +45,8 @@
     , lineClamp(RenderStyle::initialLineClamp())
     , m_mask(FillLayer(MaskFillLayer))
     , m_pageSize()
-    , m_wrapShapeInside(RenderStyle::initialWrapShapeInside())
-    , m_wrapShapeOutside(RenderStyle::initialWrapShapeOutside())
+    , m_shapeInside(RenderStyle::initialShapeInside())
+    , m_shapeOutside(RenderStyle::initialShapeOutside())
     , m_wrapMargin(RenderStyle::initialWrapMargin())
     , m_wrapPadding(RenderStyle::initialWrapPadding())
     , m_clipPath(RenderStyle::initialClipPath())
@@ -116,8 +116,8 @@
     , m_mask(o.m_mask)
     , m_maskBoxImage(o.m_maskBoxImage)
     , m_pageSize(o.m_pageSize)
-    , m_wrapShapeInside(o.m_wrapShapeInside)
-    , m_wrapShapeOutside(o.m_wrapShapeOutside)
+    , m_shapeInside(o.m_shapeInside)
+    , m_shapeOutside(o.m_shapeOutside)
     , m_wrapMargin(o.m_wrapMargin)
     , m_wrapPadding(o.m_wrapPadding)
     , m_clipPath(o.m_clipPath)
@@ -198,8 +198,8 @@
         && m_mask == o.m_mask
         && m_maskBoxImage == o.m_maskBoxImage
         && m_pageSize == o.m_pageSize
-        && m_wrapShapeInside == o.m_wrapShapeInside
-        && m_wrapShapeOutside == o.m_wrapShapeOutside
+        && m_shapeInside == o.m_shapeInside
+        && m_shapeOutside == o.m_shapeOutside
         && m_wrapMargin == o.m_wrapMargin
         && m_wrapPadding == o.m_wrapPadding
         && m_clipPath == o.m_clipPath
@@ -325,8 +325,8 @@
     info.addMember(m_boxReflect);
     info.addMember(m_animations);
     info.addMember(m_transitions);
-    info.addMember(m_wrapShapeInside);
-    info.addMember(m_wrapShapeOutside);
+    info.addMember(m_shapeInside);
+    info.addMember(m_shapeOutside);
     info.addMember(m_clipPath);
     info.addMember(m_flowThread);
     info.addMember(m_regionThread);

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (129786 => 129787)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2012-09-27 19:04:59 UTC (rev 129786)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2012-09-27 19:23:40 UTC (rev 129787)
@@ -134,8 +134,8 @@
 
     LengthSize m_pageSize;
 
-    RefPtr<BasicShape> m_wrapShapeInside;
-    RefPtr<BasicShape> m_wrapShapeOutside;
+    RefPtr<BasicShape> m_shapeInside;
+    RefPtr<BasicShape> m_shapeOutside;
     Length m_wrapMargin;
     Length m_wrapPadding;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to