Title: [118815] trunk/Source/WebCore
Revision
118815
Author
[email protected]
Date
2012-05-29 12:12:34 -0700 (Tue, 29 May 2012)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=87764
        
Add implementation of checkForPaginationLogicalHeightChange to RenderMultiColumnBlock.
        
Also stub out ensureColumnSets() and write a comment describing how it's going to work.

Reviewed by Anders Carlsson.

* rendering/RenderMultiColumnBlock.cpp:
(WebCore::RenderMultiColumnBlock::RenderMultiColumnBlock):
(WebCore::RenderMultiColumnBlock::checkForPaginationLogicalHeightChange):
(WebCore):
(WebCore::RenderMultiColumnBlock::ensureColumnSets):
* rendering/RenderMultiColumnBlock.h:
(WebCore::RenderMultiColumnBlock::columnHeight):
(WebCore::RenderMultiColumnBlock::setColumnHeight):
(RenderMultiColumnBlock):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118814 => 118815)


--- trunk/Source/WebCore/ChangeLog	2012-05-29 18:48:19 UTC (rev 118814)
+++ trunk/Source/WebCore/ChangeLog	2012-05-29 19:12:34 UTC (rev 118815)
@@ -1,3 +1,23 @@
+2012-05-29  David Hyatt  <[email protected]>
+
+        https://bugs.webkit.org/show_bug.cgi?id=87764
+        
+        Add implementation of checkForPaginationLogicalHeightChange to RenderMultiColumnBlock.
+        
+        Also stub out ensureColumnSets() and write a comment describing how it's going to work.
+
+        Reviewed by Anders Carlsson.
+
+        * rendering/RenderMultiColumnBlock.cpp:
+        (WebCore::RenderMultiColumnBlock::RenderMultiColumnBlock):
+        (WebCore::RenderMultiColumnBlock::checkForPaginationLogicalHeightChange):
+        (WebCore):
+        (WebCore::RenderMultiColumnBlock::ensureColumnSets):
+        * rendering/RenderMultiColumnBlock.h:
+        (WebCore::RenderMultiColumnBlock::columnHeight):
+        (WebCore::RenderMultiColumnBlock::setColumnHeight):
+        (RenderMultiColumnBlock):
+
 2012-05-29  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r118620.

Modified: trunk/Source/WebCore/rendering/RenderMultiColumnBlock.cpp (118814 => 118815)


--- trunk/Source/WebCore/rendering/RenderMultiColumnBlock.cpp	2012-05-29 18:48:19 UTC (rev 118814)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnBlock.cpp	2012-05-29 19:12:34 UTC (rev 118815)
@@ -36,6 +36,7 @@
     , m_flowThread(0)
     , m_columnCount(1)
     , m_columnWidth(0)
+    , m_columnHeight(ZERO_LAYOUT_UNIT)
 {
 }
 
@@ -75,6 +76,27 @@
     return relayoutChildren;
 }
 
+void RenderMultiColumnBlock::checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight)
+{
+    // We need to go ahead and set our explicit page height if one exists, so that we can
+    // avoid doing multiple layout passes.
+    computeLogicalHeight();
+    LayoutUnit newContentLogicalHeight = contentLogicalHeight();
+    if (newContentLogicalHeight > ZERO_LAYOUT_UNIT) {
+        pageLogicalHeight = newContentLogicalHeight;
+        hasSpecifiedPageLogicalHeight = true;
+    }
+    setLogicalHeight(ZERO_LAYOUT_UNIT);
+
+    if (columnHeight() != pageLogicalHeight && everHadLayout()) {
+        setColumnHeight(pageLogicalHeight);
+        pageLogicalHeightChanged = true;
+    }
+    
+    // Set up our column sets.
+    ensureColumnSets();
+}
+
 void RenderMultiColumnBlock::addChild(RenderObject* newChild, RenderObject* beforeChild)
 {
     if (!m_flowThread) {
@@ -91,6 +113,25 @@
         m_flowThread->addChild(newChild, beforeChild);
 }
 
+void RenderMultiColumnBlock::ensureColumnSets()
+{
+    // FIXME: Implement.
+    // This function ensures we have the correct column set information before we get into layout.
+    // For a simple multi-column layout in continuous media, only one column set child is required.
+    // Once a column is nested inside an enclosing pagination context, the number of column sets
+    // required becomes 2n-1, where n is the total number of nested pagination contexts. For example:
+    //
+    // Column layout with no enclosing pagination model = 2 * 1 - 1 = 1 column set.
+    // Columns inside pages = 2 * 2 - 1 = 3 column sets (bottom of first page, all the subsequent pages, then the last page).
+    // Columns inside columns inside pages = 2 * 3 - 1 = 5 column sets.
+    //
+    // In addition, column spans will force a column set to "split" into before/after sets around the spanning region.
+    //
+    // Finally, we will need to deal with columns inside regions. If regions have variable widths, then there will need
+    // to be unique column sets created inside any region whose width is different from its surrounding regions. This is
+    // actually pretty similar to the spanning case, in that we break up the column sets whenever the width varies.
+}
+
 const char* RenderMultiColumnBlock::renderName() const
 {    
     if (isFloating())

Modified: trunk/Source/WebCore/rendering/RenderMultiColumnBlock.h (118814 => 118815)


--- trunk/Source/WebCore/rendering/RenderMultiColumnBlock.h	2012-05-29 18:48:19 UTC (rev 118814)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnBlock.h	2012-05-29 19:12:34 UTC (rev 118815)
@@ -37,22 +37,28 @@
 public:
     RenderMultiColumnBlock(Node*);
     
+    LayoutUnit columnHeight() const { return m_columnHeight; }
+    void setColumnHeight(LayoutUnit columnHeight) { m_columnHeight = columnHeight; }
+
 private:
     virtual const char* renderName() const;
 
     virtual bool recomputeLogicalWidth();
-    void computeColumnCountAndWidth();
+    virtual void checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight) OVERRIDE;
 
     virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) OVERRIDE;
 
+    void computeColumnCountAndWidth();
+
+    void ensureColumnSets();
+
     RenderMultiColumnFlowThread* flowThread() const { return m_flowThread; }
 
-private:
     RenderMultiColumnFlowThread* m_flowThread;
-
     unsigned m_columnCount;   // The default column count/width that are based off our containing block width. These values represent only the default,
     LayoutUnit m_columnWidth; // since a multi-column block that is split across variable width pages or regions will have different column counts and widths in each.
                               // These values will be cached (eventually) for multi-column blocks.
+    LayoutUnit m_columnHeight; // The current column height.
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to