Title: [147495] trunk/Source/WebCore
- Revision
- 147495
- Author
- [email protected]
- Date
- 2013-04-02 14:18:09 -0700 (Tue, 02 Apr 2013)
Log Message
[CSS Exclusions] refactor shape-outside code to use isFloatingWithShapeOutside() helper method
https://bugs.webkit.org/show_bug.cgi?id=113799
Patch by Bem Jones-Bey <[email protected]> on 2013-04-02
Reviewed by Dirk Schulze.
When reviewing my patch for bug 110349, Julien mentioned that the
common test for floating with shape outside should be factored out.
This patch does that.
No new functionality, so no new tests.
* rendering/ExclusionShapeOutsideInfo.cpp:
(WebCore::ExclusionShapeOutsideInfo::isEnabledFor): Use helper method.
* rendering/RenderBox.h:
(WebCore::RenderBox::exclusionShapeOutsideInfo): Ditto.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::shouldBeNormalFlowOnly): Ditto.
* rendering/RenderObject.h:
(WebCore::RenderObject::hasPaintOffset): Ditto.
(WebCore::RenderObject::isFloatingWithShapeOutside): Add method to
encapsulate the common test.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (147494 => 147495)
--- trunk/Source/WebCore/ChangeLog 2013-04-02 20:49:19 UTC (rev 147494)
+++ trunk/Source/WebCore/ChangeLog 2013-04-02 21:18:09 UTC (rev 147495)
@@ -1,3 +1,27 @@
+2013-04-02 Bem Jones-Bey <[email protected]>
+
+ [CSS Exclusions] refactor shape-outside code to use isFloatingWithShapeOutside() helper method
+ https://bugs.webkit.org/show_bug.cgi?id=113799
+
+ Reviewed by Dirk Schulze.
+
+ When reviewing my patch for bug 110349, Julien mentioned that the
+ common test for floating with shape outside should be factored out.
+ This patch does that.
+
+ No new functionality, so no new tests.
+
+ * rendering/ExclusionShapeOutsideInfo.cpp:
+ (WebCore::ExclusionShapeOutsideInfo::isEnabledFor): Use helper method.
+ * rendering/RenderBox.h:
+ (WebCore::RenderBox::exclusionShapeOutsideInfo): Ditto.
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::shouldBeNormalFlowOnly): Ditto.
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::hasPaintOffset): Ditto.
+ (WebCore::RenderObject::isFloatingWithShapeOutside): Add method to
+ encapsulate the common test.
+
2013-04-02 Jer Noble <[email protected]>
Add platform AudioSession and iOS platform-specific code.
Modified: trunk/Source/WebCore/rendering/ExclusionShapeOutsideInfo.cpp (147494 => 147495)
--- trunk/Source/WebCore/rendering/ExclusionShapeOutsideInfo.cpp 2013-04-02 20:49:19 UTC (rev 147494)
+++ trunk/Source/WebCore/rendering/ExclusionShapeOutsideInfo.cpp 2013-04-02 21:18:09 UTC (rev 147495)
@@ -39,7 +39,7 @@
bool ExclusionShapeOutsideInfo::isEnabledFor(const RenderBox* box)
{
ExclusionShapeValue* value = box->style()->shapeOutside();
- return (box->isFloating() && value && value->type() == ExclusionShapeValue::SHAPE) ? value->shape() : 0;
+ return (box->isFloatingWithShapeOutside() && value->type() == ExclusionShapeValue::SHAPE) ? value->shape() : 0;
}
bool ExclusionShapeOutsideInfo::computeSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineHeight)
Modified: trunk/Source/WebCore/rendering/RenderBox.h (147494 => 147495)
--- trunk/Source/WebCore/rendering/RenderBox.h 2013-04-02 20:49:19 UTC (rev 147494)
+++ trunk/Source/WebCore/rendering/RenderBox.h 2013-04-02 21:18:09 UTC (rev 147495)
@@ -49,7 +49,7 @@
// 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() || (style()->shapeOutside() && isFloating()); }
+ virtual bool requiresLayer() const OVERRIDE { return isRoot() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip() || hasTransform() || hasHiddenBackface() || hasReflection() || style()->specifiesColumns() || !style()->hasAutoZIndex() || isFloatingWithShapeOutside(); }
virtual bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect) const OVERRIDE;
@@ -582,7 +582,7 @@
#if ENABLE(CSS_EXCLUSIONS)
ExclusionShapeOutsideInfo* exclusionShapeOutsideInfo() const
{
- return style()->shapeOutside() && ExclusionShapeOutsideInfo::isEnabledFor(this) ? ExclusionShapeOutsideInfo::info(this) : 0;
+ return isFloatingWithShapeOutside() && ExclusionShapeOutsideInfo::isEnabledFor(this) ? ExclusionShapeOutsideInfo::info(this) : 0;
}
#endif
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (147494 => 147495)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2013-04-02 20:49:19 UTC (rev 147494)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2013-04-02 21:18:09 UTC (rev 147495)
@@ -5847,7 +5847,7 @@
&& !isTransparent()
&& !needsCompositedScrolling()
#if ENABLE(CSS_EXCLUSIONS)
- && !(renderer()->isFloating() && renderer()->style()->shapeOutside())
+ && !renderer()->isFloatingWithShapeOutside()
#endif
;
}
Modified: trunk/Source/WebCore/rendering/RenderObject.h (147494 => 147495)
--- trunk/Source/WebCore/rendering/RenderObject.h 2013-04-02 20:49:19 UTC (rev 147494)
+++ trunk/Source/WebCore/rendering/RenderObject.h 2013-04-02 21:18:09 UTC (rev 147495)
@@ -554,7 +554,7 @@
#if ENABLE(CSS_EXCLUSIONS)
// Shape outside on a float can reposition the float in much the
// same way as relative positioning, so treat it as such.
- positioned = positioned || (m_bitfields.floating() && m_bitfields.isBox() && style()->shapeOutside());
+ positioned = positioned || isFloatingWithShapeOutside();
#endif
return positioned;
}
@@ -879,6 +879,7 @@
virtual unsigned int length() const { return 1; }
bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOutOfFlowPositioned()); }
+ bool isFloatingWithShapeOutside() const { return isBox() && isFloating() && style()->shapeOutside(); }
bool isTransparent() const { return style()->opacity() < 1.0f; }
float opacity() const { return style()->opacity(); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes