[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

hyatt at apple.com hyatt at apple.com
Wed Dec 22 13:08:47 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 57c6ddae1f9c2bff41f0ea8914b5d35e79ed8239
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 7 19:59:27 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=45317, encapsulate multi-column rectangle information.
    
    Reviewed by Beth Dakin.
    
    * WebCore.xcodeproj/project.pbxproj:
    * rendering/ColumnInfo.h: Added.
    (WebCore::ColumnInfo::ColumnInfo):
    (WebCore::ColumnInfo::desiredColumnWidth):
    (WebCore::ColumnInfo::setDesiredColumnWidth):
    (WebCore::ColumnInfo::desiredColumnCount):
    (WebCore::ColumnInfo::setDesiredColumnCount):
    (WebCore::ColumnInfo::columnCount):
    (WebCore::ColumnInfo::columnRectAt):
    (WebCore::ColumnInfo::clearColumns):
    (WebCore::ColumnInfo::addColumnRect):
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::paintColumnRules):
    (WebCore::RenderBlock::paintColumnContents):
    (WebCore::RenderBlock::lowestPosition):
    (WebCore::RenderBlock::rightmostPosition):
    (WebCore::RenderBlock::leftmostPosition):
    (WebCore::RenderBlock::hitTestColumns):
    (WebCore::RenderBlock::setDesiredColumnCountAndWidth):
    (WebCore::RenderBlock::desiredColumnWidth):
    (WebCore::RenderBlock::desiredColumnCount):
    (WebCore::RenderBlock::columnInfo):
    (WebCore::RenderBlock::layoutColumns):
    (WebCore::RenderBlock::adjustPointToColumnContents):
    (WebCore::RenderBlock::adjustRectForColumns):
    (WebCore::RenderBlock::adjustForColumns):
    * rendering/RenderBlock.h:
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::paintChildLayerIntoColumns):
    (WebCore::RenderLayer::hitTestChildLayerColumns):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66903 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1475634..27b5ba8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,40 @@
+2010-09-07  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Beth Dakin.
+
+        https://bugs.webkit.org/show_bug.cgi?id=45317, encapsulate multi-column rectangle information.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * rendering/ColumnInfo.h: Added.
+        (WebCore::ColumnInfo::ColumnInfo):
+        (WebCore::ColumnInfo::desiredColumnWidth):
+        (WebCore::ColumnInfo::setDesiredColumnWidth):
+        (WebCore::ColumnInfo::desiredColumnCount):
+        (WebCore::ColumnInfo::setDesiredColumnCount):
+        (WebCore::ColumnInfo::columnCount):
+        (WebCore::ColumnInfo::columnRectAt):
+        (WebCore::ColumnInfo::clearColumns):
+        (WebCore::ColumnInfo::addColumnRect):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::paintColumnRules):
+        (WebCore::RenderBlock::paintColumnContents):
+        (WebCore::RenderBlock::lowestPosition):
+        (WebCore::RenderBlock::rightmostPosition):
+        (WebCore::RenderBlock::leftmostPosition):
+        (WebCore::RenderBlock::hitTestColumns):
+        (WebCore::RenderBlock::setDesiredColumnCountAndWidth):
+        (WebCore::RenderBlock::desiredColumnWidth):
+        (WebCore::RenderBlock::desiredColumnCount):
+        (WebCore::RenderBlock::columnInfo):
+        (WebCore::RenderBlock::layoutColumns):
+        (WebCore::RenderBlock::adjustPointToColumnContents):
+        (WebCore::RenderBlock::adjustRectForColumns):
+        (WebCore::RenderBlock::adjustForColumns):
+        * rendering/RenderBlock.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintChildLayerIntoColumns):
+        (WebCore::RenderLayer::hitTestChildLayerColumns):
+
 2010-09-07  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Dave Hyatt.
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index c8b88ec..15cc06c 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -4930,6 +4930,7 @@
 		BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2BD0C17B69E005C90A2 /* JSNamedNodeMap.h */; };
 		BCD9C2C20C17B69E005C90A2 /* JSNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */; };
 		BCD9C2C30C17B69E005C90A2 /* JSNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */; };
+		BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDD454D1236C95C009A7985 /* ColumnInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BCDF317B11F8D683003C5BF8 /* UserTypingGestureIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */; };
 		BCDF317C11F8D683003C5BF8 /* UserTypingGestureIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BCDFD48E0E305290009D10AD /* XMLHttpRequestUpload.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */; };
@@ -10730,6 +10731,7 @@
 		BCD9C2BD0C17B69E005C90A2 /* JSNamedNodeMap.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNamedNodeMap.h; sourceTree = "<group>"; };
 		BCD9C2BE0C17B69E005C90A2 /* JSNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeList.cpp; sourceTree = "<group>"; };
 		BCD9C2BF0C17B69E005C90A2 /* JSNodeList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNodeList.h; sourceTree = "<group>"; };
+		BCDD454D1236C95C009A7985 /* ColumnInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColumnInfo.h; sourceTree = "<group>"; };
 		BCDF317911F8D683003C5BF8 /* UserTypingGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserTypingGestureIndicator.cpp; sourceTree = "<group>"; };
 		BCDF317A11F8D683003C5BF8 /* UserTypingGestureIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserTypingGestureIndicator.h; sourceTree = "<group>"; };
 		BCDFD48C0E305290009D10AD /* XMLHttpRequestUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLHttpRequestUpload.h; sourceTree = "<group>"; };
@@ -17090,6 +17092,7 @@
 				BCE789851120E7A60060ECE5 /* BidiRun.h */,
 				BCEA4815097D93020094C9E4 /* break_lines.cpp */,
 				BCEA4816097D93020094C9E4 /* break_lines.h */,
+				BCDD454D1236C95C009A7985 /* ColumnInfo.h */,
 				9392F14F0AD1862300691BD4 /* CounterNode.cpp */,
 				9392F14B0AD1861B00691BD4 /* CounterNode.h */,
 				A8CFF6CA0A1561CD000A4234 /* EllipsisBox.cpp */,
@@ -20432,6 +20435,7 @@
 				898785B9122CA2A7003AABDA /* JSMetadataCallback.h in Headers */,
 				898785F1122E1E87003AABDA /* JSFileException.h in Headers */,
 				898785F5122E1EAC003AABDA /* JSFileReaderSync.h in Headers */,
+				BCDD454E1236C95C009A7985 /* ColumnInfo.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/rendering/ColumnInfo.h b/WebCore/rendering/ColumnInfo.h
new file mode 100644
index 0000000..883287b
--- /dev/null
+++ b/WebCore/rendering/ColumnInfo.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef ColumnInfo_h
+#define ColumnInfo_h
+
+#include <wtf/Vector.h>
+#include "IntRect.h"
+
+namespace WebCore {
+
+class ColumnInfo : public Noncopyable {
+public:
+    ColumnInfo()
+        : m_desiredColumnWidth(0)
+        , m_desiredColumnCount(1)
+        { }
+    
+    int desiredColumnWidth() const { return m_desiredColumnWidth; }
+    void setDesiredColumnWidth(int width) { m_desiredColumnWidth = width; }
+    
+    unsigned desiredColumnCount() const { return m_desiredColumnCount; }
+    void setDesiredColumnCount(unsigned count) { m_desiredColumnCount = count; }
+
+    // Encapsulated for the future where we can avoid storing the rects and just compute them dynamically.
+    size_t columnCount() const { return m_columnRects.size(); }
+    const IntRect& columnRectAt(size_t i) const { return m_columnRects[i]; }
+
+    void clearColumns() { m_columnRects.clear(); }
+
+    // FIXME: Will go away once we don't use the Vector.
+    void addColumnRect(const IntRect& rect) { m_columnRects.append(rect); }
+    
+private:
+    int m_desiredColumnWidth;
+    unsigned m_desiredColumnCount;
+    Vector<IntRect> m_columnRects;
+};
+
+}
+
+#endif
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index e7f28a3..51a200f 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -24,6 +24,7 @@
 #include "config.h"
 #include "RenderBlock.h"
 
+#include "ColumnInfo.h"
 #include "Document.h"
 #include "Element.h"
 #include "FloatQuad.h"
@@ -61,16 +62,6 @@ static const int verticalLineClickFudgeFactor = 3;
 
 using namespace HTMLNames;
 
-struct ColumnInfo : public Noncopyable {
-    ColumnInfo()
-        : m_desiredColumnWidth(0)
-        , m_desiredColumnCount(1)
-        { }
-    int m_desiredColumnWidth;
-    unsigned m_desiredColumnCount;
-    Vector<IntRect> m_columnRects;
-};
-
 typedef WTF::HashMap<const RenderBox*, ColumnInfo*> ColumnInfoMap;
 static ColumnInfoMap* gColumnInfoMap = 0;
 
@@ -2005,13 +1996,13 @@ void RenderBlock::paintColumnRules(PaintInfo& paintInfo, int tx, int ty)
         return;
 
     // We need to do multiple passes, breaking up our child painting into strips.
-    Vector<IntRect>* colRects = columnRects();
-    unsigned colCount = colRects->size();
+    ColumnInfo* colInfo = columnInfo();
+    unsigned colCount = colInfo->columnCount();
     int currXOffset = style()->direction() == LTR ? 0 : contentWidth();
     int ruleAdd = borderLeft() + paddingLeft();
     int ruleX = style()->direction() == LTR ? 0 : contentWidth();
     for (unsigned i = 0; i < colCount; i++) {
-        IntRect colRect = colRects->at(i);
+        IntRect colRect = colInfo->columnRectAt(i);
 
         // Move to the next position.
         if (style()->direction() == LTR) {
@@ -2041,15 +2032,15 @@ void RenderBlock::paintColumnContents(PaintInfo& paintInfo, int tx, int ty, bool
     // We need to do multiple passes, breaking up our child painting into strips.
     GraphicsContext* context = paintInfo.context;
     int colGap = columnGap();
-    Vector<IntRect>* colRects = columnRects();
-    unsigned colCount = colRects->size();
+    ColumnInfo* colInfo = columnInfo();
+    unsigned colCount = colInfo->columnCount();
     if (!colCount)
         return;
-    int currXOffset = style()->direction() == LTR ? 0 : contentWidth() - colRects->at(0).width();
+    int currXOffset = style()->direction() == LTR ? 0 : contentWidth() - colInfo->columnRectAt(0).width();
     int currYOffset = 0;
     for (unsigned i = 0; i < colCount; i++) {
         // For each rect, we clip to the rect, and then we adjust our coords.
-        IntRect colRect = colRects->at(i);
+        IntRect colRect = colInfo->columnRectAt(i);
         colRect.move(tx, ty);
         PaintInfo info(paintInfo);
         info.rect.intersect(colRect);
@@ -3166,9 +3157,9 @@ int RenderBlock::lowestPosition(bool includeOverflowInterior, bool includeSelf)
     }
 
     if (hasColumns()) {
-        Vector<IntRect>* colRects = columnRects();
-        for (unsigned i = 0; i < colRects->size(); i++)
-            bottom = max(bottom, colRects->at(i).bottom() + relativeOffset);
+        ColumnInfo* colInfo = columnInfo();
+        for (unsigned i = 0; i < colInfo->columnCount(); i++)
+            bottom = max(bottom, colInfo->columnRectAt(i).bottom() + relativeOffset);
         return bottom;
     }
 
@@ -3260,8 +3251,11 @@ int RenderBlock::rightmostPosition(bool includeOverflowInterior, bool includeSel
 
     if (hasColumns()) {
         // This only matters for LTR
-        if (style()->direction() == LTR)
-            right = max(columnRects()->last().right() + relativeOffset, right);
+        if (style()->direction() == LTR) {
+            ColumnInfo* colInfo = columnInfo();
+            if (colInfo->columnCount())
+                right = max(colInfo->columnRectAt(colInfo->columnCount() - 1).right() + relativeOffset, right);
+        }
         return right;
     }
 
@@ -3357,8 +3351,11 @@ int RenderBlock::leftmostPosition(bool includeOverflowInterior, bool includeSelf
 
     if (hasColumns()) {
         // This only matters for RTL
-        if (style()->direction() == RTL)
-            left = min(columnRects()->last().x() + relativeOffset, left);
+        if (style()->direction() == RTL) {
+            ColumnInfo* colInfo = columnInfo();
+            if (colInfo->columnCount())
+                left = min(colInfo->columnRectAt(colInfo->columnCount() - 1).x() + relativeOffset, left);
+        }
         return left;
     }
 
@@ -3849,17 +3846,17 @@ bool RenderBlock::hitTestFloats(const HitTestRequest& request, HitTestResult& re
 bool RenderBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty, HitTestAction hitTestAction)
 {
     // We need to do multiple passes, breaking up our hit testing into strips.
-    Vector<IntRect>* colRects = columnRects();
-    int colCount = colRects->size();
+    ColumnInfo* colInfo = columnInfo();
+    int colCount = colInfo->columnCount();
     if (!colCount)
         return false;
     int left = borderLeft() + paddingLeft();
     int currYOffset = 0;
     int i;
     for (i = 0; i < colCount; i++)
-        currYOffset -= colRects->at(i).height();
+        currYOffset -= colInfo->columnRectAt(i).height();
     for (i = colCount - 1; i >= 0; i--) {
-        IntRect colRect = colRects->at(i);
+        IntRect colRect = colInfo->columnRectAt(i);
         int currXOffset = colRect.x() - left;
         currYOffset += colRect.height();
         colRect.move(tx, ty);
@@ -4171,8 +4168,8 @@ void RenderBlock::setDesiredColumnCountAndWidth(int count, int width)
             gColumnInfoMap->add(this, info);
             setHasColumns(true);
         }
-        info->m_desiredColumnCount = count;
-        info->m_desiredColumnWidth = width;   
+        info->setDesiredColumnCount(count);
+        info->setDesiredColumnWidth(width);   
     }
 }
 
@@ -4180,21 +4177,21 @@ int RenderBlock::desiredColumnWidth() const
 {
     if (!hasColumns())
         return contentWidth();
-    return gColumnInfoMap->get(this)->m_desiredColumnWidth;
+    return gColumnInfoMap->get(this)->desiredColumnWidth();
 }
 
 unsigned RenderBlock::desiredColumnCount() const
 {
     if (!hasColumns())
         return 1;
-    return gColumnInfoMap->get(this)->m_desiredColumnCount;
+    return gColumnInfoMap->get(this)->desiredColumnCount();
 }
 
-Vector<IntRect>* RenderBlock::columnRects() const
+ColumnInfo* RenderBlock::columnInfo() const
 {
     if (!hasColumns())
         return 0;
-    return &gColumnInfoMap->get(this)->m_columnRects;    
+    return gColumnInfoMap->get(this);    
 }
 
 int RenderBlock::layoutColumns(int endOfContent, int requestedColumnHeight)
@@ -4204,9 +4201,8 @@ int RenderBlock::layoutColumns(int endOfContent, int requestedColumnHeight)
         return -1;
 
     ColumnInfo* info = gColumnInfoMap->get(this);
-    int desiredColumnWidth = info->m_desiredColumnWidth;
-    int desiredColumnCount = info->m_desiredColumnCount;
-    Vector<IntRect>* columnRects = &info->m_columnRects;
+    int desiredColumnWidth = info->desiredColumnWidth();
+    int desiredColumnCount = info->desiredColumnCount();
     
     bool computeIntrinsicHeight = (endOfContent == -1);
 
@@ -4227,7 +4223,7 @@ int RenderBlock::layoutColumns(int endOfContent, int requestedColumnHeight)
     int colGap = columnGap();
 
     // Compute a collection of column rects.
-    columnRects->clear();
+    info->clearColumns();
     
     // Then we do a simulated "paint" into the column slices and allow the content to slightly adjust our individual column rects.
     // FIXME: We need to take into account layers that are affected by the columns as well here so that they can have an opportunity
@@ -4296,7 +4292,7 @@ int RenderBlock::layoutColumns(int endOfContent, int requestedColumnHeight)
 
         maxColBottom = max(colRect.bottom(), maxColBottom);
 
-        columnRects->append(colRect);
+        info->addColumnRect(colRect);
         
         // Start adding in more columns as long as there's still content left.
         if (currY < endOfContent && i == colCount - 1 && (computeIntrinsicHeight || contentHeight()))
@@ -4322,7 +4318,7 @@ int RenderBlock::layoutColumns(int endOfContent, int requestedColumnHeight)
     v->setPrintRect(IntRect());
     v->setTruncatedAt(0);
     
-    ASSERT(colCount == columnRects->size());
+    ASSERT(colCount == info->columnCount());
     
     return contentBottom;
 }
@@ -4333,16 +4329,18 @@ void RenderBlock::adjustPointToColumnContents(IntPoint& point) const
     if (!hasColumns())
         return;
     
-    Vector<IntRect>* colRects = columnRects();
+    ColumnInfo* colInfo = columnInfo();
+    if (!colInfo->columnCount())
+        return;
 
     // Determine which columns we intersect.
     int colGap = columnGap();
     int leftGap = colGap / 2;
-    IntPoint columnPoint(colRects->at(0).location());
+    IntPoint columnPoint(colInfo->columnRectAt(0).location());
     int yOffset = 0;
-    for (unsigned i = 0; i < colRects->size(); i++) {
+    for (unsigned i = 0; i < colInfo->columnCount(); i++) {
         // Add in half the column gap to the left and right of the rect.
-        IntRect colRect = colRects->at(i);
+        IntRect colRect = colInfo->columnRectAt(i);
         IntRect gapAndColumnRect(colRect.x() - leftGap, colRect.y(), colRect.width() + colGap, colRect.height());
 
         if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.right()) {
@@ -4374,13 +4372,13 @@ void RenderBlock::adjustRectForColumns(IntRect& r) const
     if (!hasColumns())
         return;
     
-    Vector<IntRect>* colRects = columnRects();
+    ColumnInfo* colInfo = columnInfo();
 
     // Begin with a result rect that is empty.
     IntRect result;
     
     // Determine which columns we intersect.
-    unsigned colCount = colRects->size();
+    unsigned colCount = colInfo->columnCount();
     if (!colCount)
         return;
     
@@ -4388,7 +4386,7 @@ void RenderBlock::adjustRectForColumns(IntRect& r) const
     
     int currYOffset = 0;
     for (unsigned i = 0; i < colCount; i++) {
-        IntRect colRect = colRects->at(i);
+        IntRect colRect = colInfo->columnRectAt(i);
         int currXOffset = colRect.x() - left;
         
         IntRect repaintRect = r;
@@ -4410,13 +4408,13 @@ void RenderBlock::adjustForColumns(IntSize& offset, const IntPoint& point) const
     if (!hasColumns())
         return;
 
-    Vector<IntRect>& columnRects = *this->columnRects();
-  
+    ColumnInfo* colInfo = columnInfo();
+
     int left = borderLeft() + paddingLeft();
     int yOffset = 0;
-    size_t columnCount = columnRects.size();
+    size_t columnCount = colInfo->columnCount();
     for (size_t i = 0; i < columnCount; ++i) {
-        IntRect columnRect = columnRects[i];
+        IntRect columnRect = colInfo->columnRectAt(i);
         int xOffset = columnRect.x() - left;
         if (point.y() < columnRect.bottom() + yOffset) {
             offset.expand(xOffset, -yOffset);
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index 9147410..6ed0d7b 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -32,6 +32,7 @@
 
 namespace WebCore {
 
+class ColumnInfo;
 class InlineIterator;
 class RenderInline;
 
@@ -148,7 +149,7 @@ public:
     static void appendRunsForObject(int start, int end, RenderObject*, InlineBidiResolver&);    
     static bool requiresLineBox(const InlineIterator&, bool isLineEmpty = true, bool previousLineBrokeCleanly = true);
 
-    Vector<IntRect>* columnRects() const;
+    ColumnInfo* columnInfo() const;
     int columnGap() const;
 
 protected:
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index cf6d23f..cba61a9 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -44,6 +44,7 @@
 #include "config.h"
 #include "RenderLayer.h"
 
+#include "ColumnInfo.h"
 #include "CSSPropertyNames.h"
 #include "CSSStyleDeclaration.h"
 #include "CSSStyleSelector.h"
@@ -2539,12 +2540,12 @@ void RenderLayer::paintChildLayerIntoColumns(RenderLayer* childLayer, RenderLaye
     int layerY = 0;
     columnBlock->layer()->convertToLayerCoords(rootLayer, layerX, layerY);
     
-    Vector<IntRect>* colRects = columnBlock->columnRects();
-    unsigned colCount = colRects->size();
+    ColumnInfo* colInfo = columnBlock->columnInfo();
+    unsigned colCount = colInfo->columnCount();
     int currYOffset = 0;
     for (unsigned i = 0; i < colCount; i++) {
         // For each rect, we clip to the rect, and then we adjust our coords.
-        IntRect colRect = colRects->at(i);
+        IntRect colRect = colInfo->columnRectAt(i);
         int currXOffset = colRect.x() - (columnBlock->borderLeft() + columnBlock->paddingLeft());
         colRect.move(layerX, layerY);
 
@@ -3005,18 +3006,18 @@ RenderLayer* RenderLayer::hitTestChildLayerColumns(RenderLayer* childLayer, Rend
     int layerY = 0;
     columnBlock->layer()->convertToLayerCoords(rootLayer, layerX, layerY);
     
-    Vector<IntRect>* colRects = columnBlock->columnRects();
-    int colCount = colRects->size();
+    ColumnInfo* colInfo = columnBlock->columnInfo();
+    int colCount = colInfo->columnCount();
     
     // We have to go backwards from the last column to the first.
     int left = columnBlock->borderLeft() + columnBlock->paddingLeft();
     int currYOffset = 0;
     int i;
     for (i = 0; i < colCount; i++)
-        currYOffset -= colRects->at(i).height();
+        currYOffset -= colInfo->columnRectAt(i).height();
     for (i = colCount - 1; i >= 0; i--) {
         // For each rect, we clip to the rect, and then we adjust our coords.
-        IntRect colRect = colRects->at(i);
+        IntRect colRect = colInfo->columnRectAt(i);
         int currXOffset = colRect.x() - left;
         currYOffset += colRect.height();
         colRect.move(layerX, layerY);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list