Chromium Code Reviews| Index: Source/core/rendering/RenderBox.cpp |
| diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp |
| index 5d3ad3c3fb10e61ee7366b4d10910c57d9fc7dfc..2b94258e97065edae4233c4a11f7048c14d6a5f2 100644 |
| --- a/Source/core/rendering/RenderBox.cpp |
| +++ b/Source/core/rendering/RenderBox.cpp |
| @@ -4158,7 +4158,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; |
| @@ -4213,7 +4213,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); |
| } |
| @@ -4407,6 +4407,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. |
|
Julien - ping for review
2013/07/15 23:50:33
I don't think this comment adds much.
mstensho (USE GERRIT)
2013/07/17 13:39:36
Done.
|
| + LayoutRect rect(left, top, width() - left - right, height() - top - bottom); |
|
Julien - ping for review
2013/07/15 23:50:33
This is very much:
LayoutRect physicalBorderBoxRe
jbroman
2013/07/16 01:19:05
Comment-on-a-comment: the border box is the rect t
mstensho (USE GERRIT)
2013/07/17 13:39:36
A good method to use here would be paddingBoxRect(
|
| + // Flip block progression axis if writing mode is vertical-rl or horizontal-bt. |
|
Julien - ping for review
2013/07/15 23:50:33
Same comment about not adding much (it repeats wha
mstensho (USE GERRIT)
2013/07/17 13:39:36
Done.
|
| + flipForWritingMode(rect); |
| + // Subtract space occupied by scrollbars. They are at their physical edge in this coordinate |
|
mstensho (USE GERRIT)
2013/07/17 13:39:36
Raising an issue myself. :)
I didn't understand th
|
| + // system, so order is important here: first flip, then subtract scrollbars. |
| + rect.contract(verticalScrollbarWidth(), horizontalScrollbarHeight()); |
| + return rect; |
| +} |
| + |
| LayoutRect RenderBox::overflowRectForPaintRejection() const |
| { |
| LayoutRect overflowRect = visualOverflowRect(); |