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

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

Issue 164773008: Reduce the number of virtual calls in the noOverflowRect() method by half (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 | « no previous file | 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 aee4dcc96e8f44165045e8250a24a57bdf60ff43..1de37a91963c47bb12e754434b9de127405f26f3 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -4471,14 +4471,16 @@ LayoutRect RenderBox::layoutOverflowRectForPropagation(RenderStyle* parentStyle)
LayoutRect RenderBox::noOverflowRect() const
{
- // Because of the special coodinate system used for overflow rectangles and many other
+ // Because of the special coordinate system used for overflow rectangles and many other
// rectangles (not quite logical, not quite physical), we need to flip the block progression
// coordinate in vertical-rl and horizontal-bt writing modes. In other words, the rectangle
// returned is physical, except for the block direction progression coordinate (y in horizontal
// writing modes, x in vertical writing modes), which is always "logical top". Apart from the
// flipping, this method does the same as clientBoxRect().
- LayoutUnit left = borderLeft() + (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? verticalScrollbarWidth() : 0);
+ const int scrollBarWidth = verticalScrollbarWidth();
+ const int scrollBarHeight = horizontalScrollbarHeight();
+ LayoutUnit left = borderLeft() + (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? scrollBarWidth : 0);
LayoutUnit top = borderTop();
LayoutUnit right = borderRight();
LayoutUnit bottom = borderBottom();
@@ -4494,9 +4496,9 @@ LayoutRect RenderBox::noOverflowRect() const
// clientBoxRect() or paddingBoxRect() in this method, rather than fiddling with the edges on
// our own.
if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
- rect.contract(0, horizontalScrollbarHeight());
+ rect.contract(0, scrollBarHeight);
else
- rect.contract(verticalScrollbarWidth(), horizontalScrollbarHeight());
+ rect.contract(scrollBarWidth, scrollBarHeight);
return rect;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698