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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 25373006: Correction to layoutOverflowRect in case of direction:rtl (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added expected result file Created 7 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 4562 matching lines...) Expand 10 before | Expand all | Expand 10 after
4573 4573
4574 LayoutRect RenderBox::noOverflowRect() const 4574 LayoutRect RenderBox::noOverflowRect() const
4575 { 4575 {
4576 // Because of the special coodinate system used for overflow rectangles and many other 4576 // Because of the special coodinate system used for overflow rectangles and many other
4577 // rectangles (not quite logical, not quite physical), we need to flip the b lock progression 4577 // rectangles (not quite logical, not quite physical), we need to flip the b lock progression
4578 // coordinate in vertical-rl and horizontal-bt writing modes. In other words , the rectangle 4578 // coordinate in vertical-rl and horizontal-bt writing modes. In other words , the rectangle
4579 // returned is physical, except for the block direction progression coordina te (y in horizontal 4579 // returned is physical, except for the block direction progression coordina te (y in horizontal
4580 // writing modes, x in vertical writing modes), which is always "logical top ". Apart from the 4580 // writing modes, x in vertical writing modes), which is always "logical top ". Apart from the
4581 // flipping, this method does the same as clientBoxRect(). 4581 // flipping, this method does the same as clientBoxRect().
4582 4582
4583 LayoutUnit left = borderLeft(); 4583 LayoutUnit left = borderLeft() + (style()->shouldPlaceBlockDirectionScrollba rOnLogicalLeft() ? verticalScrollbarWidth() : 0);
4584 LayoutUnit top = borderTop(); 4584 LayoutUnit top = borderTop();
4585 LayoutUnit right = borderRight(); 4585 LayoutUnit right = borderRight();
4586 LayoutUnit bottom = borderBottom(); 4586 LayoutUnit bottom = borderBottom();
4587 LayoutRect rect(left, top, width() - left - right, height() - top - bottom); 4587 LayoutRect rect(left, top, width() - left - right, height() - top - bottom);
4588 flipForWritingMode(rect); 4588 flipForWritingMode(rect);
4589 // Subtract space occupied by scrollbars. Order is important here: first fli p, then subtract 4589 // Subtract space occupied by scrollbars. Order is important here: first fli p, then subtract
4590 // scrollbars. This may seem backwards and weird, since one would think that a horizontal 4590 // scrollbars. This may seem backwards and weird, since one would think that a horizontal
4591 // scrollbar at the physical bottom in horizontal-bt ought to be at the logi cal top (physical 4591 // scrollbar at the physical bottom in horizontal-bt ought to be at the logi cal top (physical
4592 // bottom), between the logical top (physical bottom) border and the logical top (physical 4592 // bottom), between the logical top (physical bottom) border and the logical top (physical
4593 // bottom) padding. But this is how the rest of the code expects us to behav e. This is highly 4593 // bottom) padding. But this is how the rest of the code expects us to behav e. This is highly
4594 // related to https://bugs.webkit.org/show_bug.cgi?id=76129 4594 // related to https://bugs.webkit.org/show_bug.cgi?id=76129
4595 // FIXME: when the above mentioned bug is fixed, it should hopefully be poss ible to call 4595 // FIXME: when the above mentioned bug is fixed, it should hopefully be poss ible to call
4596 // clientBoxRect() or paddingBoxRect() in this method, rather than fiddling with the edges on 4596 // clientBoxRect() or paddingBoxRect() in this method, rather than fiddling with the edges on
4597 // our own. 4597 // our own.
4598 rect.contract(verticalScrollbarWidth(), horizontalScrollbarHeight()); 4598 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
4599 rect.contract(0, horizontalScrollbarHeight());
4600 else
4601 rect.contract(verticalScrollbarWidth(), horizontalScrollbarHeight());
4599 return rect; 4602 return rect;
4600 } 4603 }
4601 4604
4602 LayoutRect RenderBox::overflowRectForPaintRejection() const 4605 LayoutRect RenderBox::overflowRectForPaintRejection() const
4603 { 4606 {
4604 LayoutRect overflowRect = visualOverflowRect(); 4607 LayoutRect overflowRect = visualOverflowRect();
4605 if (!m_overflow || !usesCompositedScrolling()) 4608 if (!m_overflow || !usesCompositedScrolling())
4606 return overflowRect; 4609 return overflowRect;
4607 4610
4608 overflowRect.unite(layoutOverflowRect()); 4611 overflowRect.unite(layoutOverflowRect());
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
4783 return 0; 4786 return 0;
4784 4787
4785 if (!layoutState && !flowThreadContainingBlock()) 4788 if (!layoutState && !flowThreadContainingBlock())
4786 return 0; 4789 return 0;
4787 4790
4788 RenderBlock* containerBlock = containingBlock(); 4791 RenderBlock* containerBlock = containingBlock();
4789 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4792 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4790 } 4793 }
4791 4794
4792 } // namespace WebCore 4795 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698