Title: [159682] trunk/Source/WebCore
Revision
159682
Author
r...@igalia.com
Date
2013-11-22 00:28:26 -0800 (Fri, 22 Nov 2013)

Log Message

[CSS Regions] Use hasOverflowClip() in RenderRegion
https://bugs.webkit.org/show_bug.cgi?id=124746

Reviewed by Mihnea Ovidenie.

Implement the suggested FIXME in RenderRegion using hasOverflowClip().

No new tests, covered by existing tests.

* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::overflowRectForFlowThreadPortion): Use
hasOverflowClip().
(WebCore::RenderRegion::rectFlowPortionForBox): Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (159681 => 159682)


--- trunk/Source/WebCore/ChangeLog	2013-11-22 05:12:47 UTC (rev 159681)
+++ trunk/Source/WebCore/ChangeLog	2013-11-22 08:28:26 UTC (rev 159682)
@@ -1,3 +1,19 @@
+2013-11-22  Manuel Rego Casasnovas  <r...@igalia.com>
+
+        [CSS Regions] Use hasOverflowClip() in RenderRegion
+        https://bugs.webkit.org/show_bug.cgi?id=124746
+
+        Reviewed by Mihnea Ovidenie.
+
+        Implement the suggested FIXME in RenderRegion using hasOverflowClip().
+
+        No new tests, covered by existing tests.
+
+        * rendering/RenderRegion.cpp:
+        (WebCore::RenderRegion::overflowRectForFlowThreadPortion): Use
+        hasOverflowClip().
+        (WebCore::RenderRegion::rectFlowPortionForBox): Ditto.
+
 2013-11-21  Frédéric Wang  <fred.w...@free.fr>
 
         Map the dir attribute to the CSS direction property.

Modified: trunk/Source/WebCore/rendering/RenderRegion.cpp (159681 => 159682)


--- trunk/Source/WebCore/rendering/RenderRegion.cpp	2013-11-22 05:12:47 UTC (rev 159681)
+++ trunk/Source/WebCore/rendering/RenderRegion.cpp	2013-11-22 08:28:26 UTC (rev 159682)
@@ -183,12 +183,8 @@
 {
     ASSERT(isValid());
 
-    // FIXME: Would like to just use hasOverflowClip() but we aren't a block yet. When RenderRegion is eliminated and
-    // folded into RenderBlock, switch to hasOverflowClip().
-    bool clipX = style().overflowX() != OVISIBLE;
-    bool clipY = style().overflowY() != OVISIBLE;
     bool isLastRegionWithRegionFragmentBreak = (isLastPortion && (style().regionFragment() == BreakRegionFragment));
-    if ((clipX && clipY) || isLastRegionWithRegionFragmentBreak)
+    if (hasOverflowClip() || isLastRegionWithRegionFragmentBreak)
         return flowThreadPortionRect;
 
     LayoutRect flowThreadOverflow = overflowType == VisualOverflow ? visualOverflowRectForBox(m_flowThread) : layoutOverflowRectForBox(m_flowThread);
@@ -199,12 +195,14 @@
     if (m_flowThread->isHorizontalWritingMode()) {
         LayoutUnit minY = isFirstPortion ? (flowThreadOverflow.y() - outlineSize) : flowThreadPortionRect.y();
         LayoutUnit maxY = isLastPortion ? std::max(flowThreadPortionRect.maxY(), flowThreadOverflow.maxY()) + outlineSize : flowThreadPortionRect.maxY();
+        bool clipX = style().overflowX() != OVISIBLE;
         LayoutUnit minX = clipX ? flowThreadPortionRect.x() : std::min(flowThreadPortionRect.x(), flowThreadOverflow.x() - outlineSize);
         LayoutUnit maxX = clipX ? flowThreadPortionRect.maxX() : std::max(flowThreadPortionRect.maxX(), (flowThreadOverflow.maxX() + outlineSize));
         clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY);
     } else {
         LayoutUnit minX = isFirstPortion ? (flowThreadOverflow.x() - outlineSize) : flowThreadPortionRect.x();
         LayoutUnit maxX = isLastPortion ? std::max(flowThreadPortionRect.maxX(), flowThreadOverflow.maxX()) + outlineSize : flowThreadPortionRect.maxX();
+        bool clipY = style().overflowY() != OVISIBLE;
         LayoutUnit minY = clipY ? flowThreadPortionRect.y() : std::min(flowThreadPortionRect.y(), (flowThreadOverflow.y() - outlineSize));
         LayoutUnit maxY = clipY ? flowThreadPortionRect.maxY() : std::max(flowThreadPortionRect.y(), (flowThreadOverflow.maxY() + outlineSize));
         clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY);
@@ -665,10 +663,8 @@
             mappedRect.setWidth(std::max<LayoutUnit>(0, std::min<LayoutUnit>(logicalBottomForFlowThreadContent() - mappedRect.x(), mappedRect.width())));
     }
 
-    bool clipX = style().overflowX() != OVISIBLE;
-    bool clipY = style().overflowY() != OVISIBLE;
     bool isLastRegionWithRegionFragmentBreak = (isLastRegion() && (style().regionFragment() == BreakRegionFragment));
-    if ((clipX && clipY) || isLastRegionWithRegionFragmentBreak)
+    if (hasOverflowClip() || isLastRegionWithRegionFragmentBreak)
         mappedRect.intersect(flowThreadPortionRect());
 
     return mappedRect.isEmpty() ? mappedRect : m_flowThread->mapFromFlowThreadToLocal(box, mappedRect);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to