From 15119d60acb79db3afe83748912503b4d0ce3271 Mon Sep 17 00:00:00 2001 From: "mitz@apple.com" Date: Mon, 17 Oct 2011 23:41:20 +0000 Subject: [PATCH] Remove unnecessary calls to columnRectAt() https://bugs.webkit.org/show_bug.cgi?id=70283 Reviewed by Darin Adler. These call sites only needed one of the column dimensions, which are independent of the column index, and can be retrieved directly from the ColumnInfo. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintColumnRules): (WebCore::RenderBlock::hitTestColumns): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97671 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 14 ++++++++++++++ Source/WebCore/rendering/RenderBlock.cpp | 8 ++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index ac89dbae0034..d7f0a04c10be 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,17 @@ +2011-10-17 Dan Bernstein + + Remove unnecessary calls to columnRectAt() + https://bugs.webkit.org/show_bug.cgi?id=70283 + + Reviewed by Darin Adler. + + These call sites only needed one of the column dimensions, which are independent of the column + index, and can be retrieved directly from the ColumnInfo. + + * rendering/RenderBlock.cpp: + (WebCore::RenderBlock::paintColumnRules): + (WebCore::RenderBlock::hitTestColumns): + 2011-10-17 Andreas Kling Protect against incorrect Element::fast*Attribute() usage. diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp index 406a4046c6bc..f5233ed6b584 100644 --- a/Source/WebCore/rendering/RenderBlock.cpp +++ b/Source/WebCore/rendering/RenderBlock.cpp @@ -2395,12 +2395,9 @@ void RenderBlock::paintColumnRules(PaintInfo& paintInfo, const LayoutPoint& pain LayoutUnit ruleLogicalLeft = style()->isLeftToRightDirection() ? 0 : contentLogicalWidth(); bool antialias = shouldAntialiasLines(paintInfo.context); + LayoutUnit inlineDirectionSize = colInfo->desiredColumnWidth(); for (unsigned i = 0; i < colCount; i++) { - LayoutRect colRect = columnRectAt(colInfo, i); - - LayoutUnit inlineDirectionSize = isHorizontalWritingMode() ? colRect.width() : colRect.height(); - // Move to the next position. if (style()->isLeftToRightDirection()) { ruleLogicalLeft += inlineDirectionSize + colGap / 2; @@ -4202,9 +4199,8 @@ bool RenderBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& r LayoutUnit currLogicalTopOffset = 0; int i; bool isHorizontal = isHorizontalWritingMode(); + LayoutUnit blockDelta = colInfo->columnHeight(); for (i = 0; i < colCount; i++) { - LayoutRect colRect = columnRectAt(colInfo, i); - LayoutUnit blockDelta = (isHorizontal ? colRect.height() : colRect.width()); if (style()->isFlippedBlocksWritingMode()) currLogicalTopOffset += blockDelta; else -- 2.36.0