Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1437)

Unified Diff: Source/core/rendering/RenderBox.cpp

Issue 14359018: Correct overflow propagation in BTT and RTL writing-modes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@236320
Patch Set: Don't remove incorrect expected.png files. Add stuff to LayoutTests/TestExpectations instead. Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 35035113b22169ca6da9343b3450e1707a4362d2..1931441bcc395bee8795f04b6582c3ee219755a0 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -4142,7 +4142,7 @@ void RenderBox::addOverflowFromChild(RenderBox* child, const LayoutSize& delta)
void RenderBox::addLayoutOverflow(const LayoutRect& rect)
{
- LayoutRect clientBox = clientBoxRect();
+ LayoutRect clientBox = noOverflowRect();
if (clientBox.contains(rect) || rect.isEmpty())
return;
@@ -4197,7 +4197,7 @@ void RenderBox::addVisualOverflow(const LayoutRect& rect)
return;
if (!m_overflow)
- m_overflow = adoptPtr(new RenderOverflow(clientBoxRect(), borderBox));
+ m_overflow = adoptPtr(new RenderOverflow(noOverflowRect(), borderBox));
m_overflow->addVisualOverflow(rect);
}
@@ -4391,6 +4391,26 @@ LayoutRect RenderBox::layoutOverflowRectForPropagation(RenderStyle* parentStyle)
return rect;
}
+LayoutRect RenderBox::noOverflowRect() const
+{
+ // Because of the special coodinate system used for overflow rectangles (not quite logical, not
+ // quite physical), we need to flip the block progression coordinate in vertical-rl and
+ // horizontal-bt writing modes. Apart from that, this method does the same as clientBoxRect().
+
+ LayoutUnit left = borderLeft();
+ LayoutUnit top = borderTop();
+ LayoutUnit right = borderRight();
+ LayoutUnit bottom = borderBottom();
+ // Calculate physical padding box.
+ LayoutRect rect(left, top, width() - left - right, height() - top - bottom);
+ // Flip block progression axis if writing mode is vertical-rl or horizontal-bt.
+ flipForWritingMode(rect);
+ // Subtract space occupied by scrollbars. They are at their physical edge in this coordinate
+ // system, so order is important here: first flip, then subtract scrollbars.
+ rect.contract(verticalScrollbarWidth(), horizontalScrollbarHeight());
+ return rect;
+}
+
LayoutRect RenderBox::overflowRectForPaintRejection() const
{
LayoutRect overflowRect = visualOverflowRect();
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698