Remove unnecessary calls to columnRectAt()
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2011 23:41:20 +0000 (23:41 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2011 23:41:20 +0000 (23:41 +0000)
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
Source/WebCore/rendering/RenderBlock.cpp

index ac89dbae0034162938abe3e00b2d196bf8811e54..d7f0a04c10befb9a4f434073fdeac7b7fa8740b5 100644 (file)
@@ -1,3 +1,17 @@
+2011-10-17  Dan Bernstein  <mitz@apple.com>
+
+        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  <kling@webkit.org>
 
         Protect against incorrect Element::fast*Attribute() usage.
index 406a4046c6bc8761b59560604f15cc4f2d6ddbe2..f5233ed6b584002f8e91df4e0cf2ebc473be92ba 100644 (file)
@@ -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