Title: [153330] trunk/Source/WebCore
Revision
153330
Author
betra...@adobe.com
Date
2013-07-25 09:40:40 -0700 (Thu, 25 Jul 2013)

Log Message

[CSS Shapes] Shape methods and member variables should be guarded with the CSS_SHAPES flag
https://bugs.webkit.org/show_bug.cgi?id=117277

Reviewed by Alexandru Chiculita.

This patch adds some compile guards that were missing from the RenderStyle and
StyleRareNonInheritedData files. When the compile guard caused parameters to
not be used, the parameters were marked using UNUSED_PARAM.

* css/CSSPropertyNames.in: Inserting a line to trigger build.
* rendering/RenderBlock.cpp:
(WebCore::shapeInfoRequiresRelayout):
(WebCore::RenderBlock::updateRegionsAndShapesBeforeChildLayout):
(WebCore::RenderBlock::logicalRightFloatOffsetForLine):
* rendering/RenderBox.cpp:
(WebCore::isCandidateForOpaquenessTest):
* rendering/RenderBox.h:
* rendering/RenderObject.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
(WebCore::RenderStyle::changeRequiresRepaint):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (153329 => 153330)


--- trunk/Source/WebCore/ChangeLog	2013-07-25 16:38:37 UTC (rev 153329)
+++ trunk/Source/WebCore/ChangeLog	2013-07-25 16:40:40 UTC (rev 153330)
@@ -1,3 +1,32 @@
+2013-07-25  Bear Travis  <betra...@adobe.com>
+
+        [CSS Shapes] Shape methods and member variables should be guarded with the CSS_SHAPES flag
+        https://bugs.webkit.org/show_bug.cgi?id=117277
+
+        Reviewed by Alexandru Chiculita.
+
+        This patch adds some compile guards that were missing from the RenderStyle and
+        StyleRareNonInheritedData files. When the compile guard caused parameters to
+        not be used, the parameters were marked using UNUSED_PARAM.
+
+        * css/CSSPropertyNames.in: Inserting a line to trigger build.
+        * rendering/RenderBlock.cpp:
+        (WebCore::shapeInfoRequiresRelayout):
+        (WebCore::RenderBlock::updateRegionsAndShapesBeforeChildLayout):
+        (WebCore::RenderBlock::logicalRightFloatOffsetForLine):
+        * rendering/RenderBox.cpp:
+        (WebCore::isCandidateForOpaquenessTest):
+        * rendering/RenderBox.h:
+        * rendering/RenderObject.h:
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::changeRequiresLayout):
+        (WebCore::RenderStyle::changeRequiresRepaint):
+        * rendering/style/RenderStyle.h:
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==):
+        * rendering/style/StyleRareNonInheritedData.h:
+
 2013-07-24  Gyuyoung Kim  <gyuyoung....@samsung.com>
 
         Introduce toSVGPatternElement(), use it

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (153329 => 153330)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2013-07-25 16:38:37 UTC (rev 153329)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2013-07-25 16:40:40 UTC (rev 153330)
@@ -8,6 +8,7 @@
 // http://msdn.microsoft.com/workshop/author/css/reference/attributes.asp
 // 
 
+
 // high-priority property names have to be listed first, to simplify the check
 // for applying them first.
 color

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (153329 => 153330)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-07-25 16:38:37 UTC (rev 153329)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2013-07-25 16:40:40 UTC (rev 153330)
@@ -1468,28 +1468,27 @@
 }
 #endif
 
+#if ENABLE(CSS_SHAPES)
 static inline bool shapeInfoRequiresRelayout(const RenderBlock* block)
 {
-#if !ENABLE(CSS_SHAPES)
-    return false;
-#else
     ShapeInsideInfo* info = block->shapeInsideInfo();
     if (info)
         info->setNeedsLayout(info->shapeSizeDirty());
     else
         info = block->layoutShapeInsideInfo();
     return info && info->needsLayout();
+}
 #endif
-}
 
 bool RenderBlock::updateRegionsAndShapesBeforeChildLayout(RenderFlowThread* flowThread)
 {
 #if ENABLE(CSS_SHAPES)
     if (!flowThread && !shapeInsideInfo())
+        return shapeInfoRequiresRelayout(this);
 #else
     if (!flowThread)
+        return false;
 #endif
-        return shapeInfoRequiresRelayout(this);
 
     LayoutUnit oldHeight = logicalHeight();
     LayoutUnit oldTop = logicalTop();
@@ -1509,8 +1508,12 @@
 
     setLogicalHeight(oldHeight);
     setLogicalTop(oldTop);
-    
+
+#if ENABLE(CSS_SHAPES)
     return shapeInfoRequiresRelayout(this);
+#else
+    return false;
+#endif
 }
 
 #if ENABLE(CSS_SHAPES)
@@ -4549,6 +4552,8 @@
                 rightFloatOffset += shapeOutside->leftSegmentMarginBoxDelta();
             }
         }
+#else
+        UNUSED_PARAM(offsetMode);
 #endif
 
         right = min(right, rightFloatOffset);

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (153329 => 153330)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2013-07-25 16:38:37 UTC (rev 153329)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2013-07-25 16:40:40 UTC (rev 153330)
@@ -1224,8 +1224,12 @@
     RenderStyle* childStyle = childBox->style();
     if (childStyle->position() != StaticPosition && childBox->containingBlock() != childBox->parent())
         return false;
-    if (childStyle->visibility() != VISIBLE || childStyle->shapeOutside())
+    if (childStyle->visibility() != VISIBLE)
         return false;
+#if ENABLE(CSS_SHAPES)
+    if (childStyle->shapeOutside())
+        return false;
+#endif
     if (!childBox->width() || !childBox->height())
         return false;
     if (RenderLayer* childLayer = childBox->layer()) {

Modified: trunk/Source/WebCore/rendering/RenderBox.h (153329 => 153330)


--- trunk/Source/WebCore/rendering/RenderBox.h	2013-07-25 16:38:37 UTC (rev 153329)
+++ trunk/Source/WebCore/rendering/RenderBox.h	2013-07-25 16:40:40 UTC (rev 153330)
@@ -49,7 +49,15 @@
 
     // hasAutoZIndex only returns true if the element is positioned or a flex-item since
     // position:static elements that are not flex-items get their z-index coerced to auto.
-    virtual bool requiresLayer() const OVERRIDE { return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip() || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns() || !style()->hasAutoZIndex() || isFloatingWithShapeOutside(); }
+    virtual bool requiresLayer() const OVERRIDE
+    {
+        return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip()
+            || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns()
+#if ENABLE(CSS_SHAPES)
+            || isFloatingWithShapeOutside()
+#endif
+            || !style()->hasAutoZIndex();
+    }
 
     virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const OVERRIDE;
 

Modified: trunk/Source/WebCore/rendering/RenderObject.h (153329 => 153330)


--- trunk/Source/WebCore/rendering/RenderObject.h	2013-07-25 16:38:37 UTC (rev 153329)
+++ trunk/Source/WebCore/rendering/RenderObject.h	2013-07-25 16:40:40 UTC (rev 153330)
@@ -864,7 +864,9 @@
     virtual unsigned int length() const { return 1; }
 
     bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOutOfFlowPositioned()); }
+#if ENABLE(CSS_SHAPES)
     bool isFloatingWithShapeOutside() const { return isBox() && isFloating() && style()->shapeOutside(); }
+#endif
 
     bool isTransparent() const { return style()->opacity() < 1.0f; }
     float opacity() const { return style()->opacity(); }

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (153329 => 153330)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2013-07-25 16:38:37 UTC (rev 153329)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2013-07-25 16:40:40 UTC (rev 153330)
@@ -402,10 +402,14 @@
             return true;
 
         if (rareNonInheritedData->m_wrapFlow != other->rareNonInheritedData->m_wrapFlow
-            || rareNonInheritedData->m_wrapThrough != other->rareNonInheritedData->m_wrapThrough
-            || rareNonInheritedData->m_shapeMargin != other->rareNonInheritedData->m_shapeMargin
+            || rareNonInheritedData->m_wrapThrough != other->rareNonInheritedData->m_wrapThrough)
+            return true;
+
+#if ENABLE(CSS_SHAPES)
+        if (rareNonInheritedData->m_shapeMargin != other->rareNonInheritedData->m_shapeMargin
             || rareNonInheritedData->m_shapePadding != other->rareNonInheritedData->m_shapePadding)
             return true;
+#endif
 
         if (rareNonInheritedData->m_deprecatedFlexibleBox.get() != other->rareNonInheritedData->m_deprecatedFlexibleBox.get()
             && *rareNonInheritedData->m_deprecatedFlexibleBox.get() != *other->rareNonInheritedData->m_deprecatedFlexibleBox.get())
@@ -695,7 +699,8 @@
         || rareNonInheritedData->m_borderFit != other->rareNonInheritedData->m_borderFit
         || rareInheritedData->m_imageRendering != other->rareInheritedData->m_imageRendering)
         return true;
-        
+
+#if ENABLE(CSS_SHAPES)
     // FIXME: The current spec is being reworked to remove dependencies between exclusions and affected 
     // content. There's a proposal to use floats instead. In that case, wrap-shape should actually relayout 
     // the parent container. For sure, I will have to revisit this code, but for now I've added this in order 
@@ -703,6 +708,7 @@
     // Tracking bug: https://bugs.webkit.org/show_bug.cgi?id=62991
     if (rareNonInheritedData->m_shapeOutside != other->rareNonInheritedData->m_shapeOutside)
         return true;
+#endif
 
     if (rareNonInheritedData->m_clipPath != other->rareNonInheritedData->m_clipPath)
         return true;
@@ -1738,11 +1744,13 @@
     surround.access()->border.m_image.setOutset(outset);
 }
 
+#if ENABLE(CSS_SHAPES)
 ShapeValue* RenderStyle::initialShapeInside()
 {
     DEFINE_STATIC_LOCAL(RefPtr<ShapeValue>, sOutsideValue, (ShapeValue::createOutsideValue()));
     return sOutsideValue.get();
 }
+#endif
 
 void RenderStyle::setColumnStylesFromPaginationMode(const Pagination::Mode& paginationMode)
 {

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (153329 => 153330)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2013-07-25 16:38:37 UTC (rev 153329)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2013-07-25 16:40:40 UTC (rev 153330)
@@ -1465,6 +1465,7 @@
     void setKerning(SVGLength k) { accessSVGStyle()->setKerning(k); }
 #endif
 
+#if ENABLE(CSS_SHAPES)
     void setShapeInside(PassRefPtr<ShapeValue> value)
     {
         if (rareNonInheritedData->m_shapeInside == value)
@@ -1491,6 +1492,15 @@
     static ShapeValue* initialShapeInside();
     static ShapeValue* initialShapeOutside() { return 0; }
 
+    Length shapePadding() const { return rareNonInheritedData->m_shapePadding; }
+    void setShapePadding(Length shapePadding) { SET_VAR(rareNonInheritedData, m_shapePadding, shapePadding); }
+    static Length initialShapePadding() { return Length(0, Fixed); }
+
+    Length shapeMargin() const { return rareNonInheritedData->m_shapeMargin; }
+    void setShapeMargin(Length shapeMargin) { SET_VAR(rareNonInheritedData, m_shapeMargin, shapeMargin); }
+    static Length initialShapeMargin() { return Length(0, Fixed); }
+#endif
+
     void setClipPath(PassRefPtr<ClipPathOperation> operation)
     {
         if (rareNonInheritedData->m_clipPath != operation)
@@ -1500,14 +1510,6 @@
 
     static ClipPathOperation* initialClipPath() { return 0; }
 
-    Length shapePadding() const { return rareNonInheritedData->m_shapePadding; }
-    void setShapePadding(Length shapePadding) { SET_VAR(rareNonInheritedData, m_shapePadding, shapePadding); }
-    static Length initialShapePadding() { return Length(0, Fixed); }
-
-    Length shapeMargin() const { return rareNonInheritedData->m_shapeMargin; }
-    void setShapeMargin(Length shapeMargin) { SET_VAR(rareNonInheritedData, m_shapeMargin, shapeMargin); }
-    static Length initialShapeMargin() { return Length(0, Fixed); }
-
     bool hasContent() const { return contentData(); }
     const ContentData* contentData() const { return rareNonInheritedData->m_content.get(); }
     bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->rareNonInheritedData); }

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (153329 => 153330)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2013-07-25 16:38:37 UTC (rev 153329)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2013-07-25 16:40:40 UTC (rev 153330)
@@ -46,10 +46,12 @@
 #endif
     , m_mask(FillLayer(MaskFillLayer))
     , m_pageSize()
+#if ENABLE(CSS_SHAPES)
     , m_shapeInside(RenderStyle::initialShapeInside())
     , m_shapeOutside(RenderStyle::initialShapeOutside())
     , m_shapeMargin(RenderStyle::initialShapeMargin())
     , m_shapePadding(RenderStyle::initialShapePadding())
+#endif
     , m_clipPath(RenderStyle::initialClipPath())
     , m_visitedLinkBackgroundColor(RenderStyle::initialBackgroundColor())
     , m_order(RenderStyle::initialOrder())
@@ -120,10 +122,12 @@
     , m_mask(o.m_mask)
     , m_maskBoxImage(o.m_maskBoxImage)
     , m_pageSize(o.m_pageSize)
+#if ENABLE(CSS_SHAPES)
     , m_shapeInside(o.m_shapeInside)
     , m_shapeOutside(o.m_shapeOutside)
     , m_shapeMargin(o.m_shapeMargin)
     , m_shapePadding(o.m_shapePadding)
+#endif
     , m_clipPath(o.m_clipPath)
 #if ENABLE(CSS3_TEXT)
     , m_textDecorationColor(o.m_textDecorationColor)
@@ -209,10 +213,12 @@
         && m_mask == o.m_mask
         && m_maskBoxImage == o.m_maskBoxImage
         && m_pageSize == o.m_pageSize
+#if ENABLE(CSS_SHAPES)
         && m_shapeInside == o.m_shapeInside
         && m_shapeOutside == o.m_shapeOutside
         && m_shapeMargin == o.m_shapeMargin
         && m_shapePadding == o.m_shapePadding
+#endif
         && m_clipPath == o.m_clipPath
 #if ENABLE(CSS3_TEXT)
         && m_textDecorationColor == o.m_textDecorationColor

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (153329 => 153330)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2013-07-25 16:38:37 UTC (rev 153329)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2013-07-25 16:40:40 UTC (rev 153330)
@@ -136,10 +136,12 @@
 
     LengthSize m_pageSize;
 
+#if ENABLE(CSS_SHAPES)
     RefPtr<ShapeValue> m_shapeInside;
     RefPtr<ShapeValue> m_shapeOutside;
     Length m_shapeMargin;
     Length m_shapePadding;
+#endif
 
     RefPtr<ClipPathOperation> m_clipPath;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to