Changeset 143506 in webkit
- Timestamp:
- Feb 20, 2013 2:16:55 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r143505 r143506 1 2013-02-20 David Hyatt <hyatt@apple.com> 2 3 [New Multicolumn] Resize RenderMultiColumnSets around their columns. 4 https://bugs.webkit.org/show_bug.cgi?id=110378. 5 6 Reviewed by Dirk Schulze. 7 8 * fast/multicol/newmulticol/positioned-with-constrained-height-expected.html: Added. 9 * fast/multicol/newmulticol/positioned-with-constrained-height.html: Added. 10 1 11 2013-02-20 Dirk Schulze <krit@webkit.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r143505 r143506 1 2013-02-20 David Hyatt <hyatt@apple.com> 2 3 [New Multicolumn] Resize RenderMultiColumnSets around their columns. 4 https://bugs.webkit.org/show_bug.cgi?id=110378. 5 6 Reviewed by Dirk Schulze. 7 8 Test: fast/multicol/newmulticol/positioned-with-constrained-height.html. 9 10 * rendering/RenderBlock.h: 11 (RenderBlock): 12 Make computeOverflow public so that RenderMultiColumnFlowThread can 13 access it. 14 15 * rendering/RenderMultiColumnFlowThread.cpp: 16 (WebCore::RenderMultiColumnFlowThread::layout): 17 Subclass layout to recompute the overflow for RenderMultiColumnBlock 18 after the flow thread has finished layout. This way it can account 19 for changes in RenderMultiColumnSets without having to do a second 20 layout pass. 21 22 * rendering/RenderMultiColumnFlowThread.h: 23 (RenderMultiColumnFlowThread): 24 Override layout(). 25 26 * rendering/RenderMultiColumnSet.cpp: 27 (WebCore::RenderMultiColumnSet::columnCount): 28 Clean up a comment that referred to portions as region rects still. 29 30 (WebCore::RenderMultiColumnSet::setFlowThreadPortionRect): 31 * rendering/RenderMultiColumnSet.h: 32 * rendering/RenderRegion.h: 33 (WebCore::RenderRegion::setFlowThreadPortionRect): 34 Make setFlowThreadPortionRect virtual and actually mutate the size 35 and position of RenderMultiColumnSets so that they enclose their 36 column rects. 37 1 38 2013-02-20 Dirk Schulze <krit@webkit.org> 2 39 -
trunk/Source/WebCore/rendering/RenderBlock.h
r143294 r143506 526 526 void setDesiredColumnCountAndWidth(int, LayoutUnit); 527 527 528 public: 528 529 void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats = false); 530 protected: 529 531 virtual void addOverflowFromChildren(); 530 532 void addOverflowFromFloats(); -
trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp
r140244 r143506 27 27 #include "RenderMultiColumnFlowThread.h" 28 28 29 #include "RenderMultiColumnBlock.h" 30 29 31 namespace WebCore { 30 32 … … 50 52 } 51 53 54 void RenderMultiColumnFlowThread::layout() 55 { 56 RenderFlowThread::layout(); 57 58 // Now that flow thread portions have been determined, we may have changed the dimensions of some of our multi-column sets. 59 // We need to make the RenderMultiColumnBlock recompute its overflow because some of these sets may be spilling out of the 60 // block. 61 RenderMultiColumnBlock* colBlock = toRenderMultiColumnBlock(parent()); 62 if (!colBlock) 63 return; 64 colBlock->computeOverflow(colBlock->clientLogicalBottom()); 52 65 } 66 67 } -
trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.h
r140244 r143506 39 39 private: 40 40 virtual const char* renderName() const OVERRIDE; 41 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const OVERRIDE; 41 42 42 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) constOVERRIDE;43 virtual void layout() OVERRIDE; 43 44 }; 44 45 -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp
r143484 r143506 32 32 #include "RenderMultiColumnFlowThread.h" 33 33 34 using std::min; 35 using std::max; 34 using namespace std; 36 35 37 36 namespace WebCore { … … 112 111 return 0; 113 112 114 // Our region rect determines our column count. We have as many columns as needed to fit all the content.113 // Our portion rect determines our column count. We have as many columns as needed to fit all the content. 115 114 LayoutUnit logicalHeightInColumns = flowThread()->isHorizontalWritingMode() ? flowThreadPortionRect().height() : flowThreadPortionRect().width(); 116 115 return ceil(static_cast<float>(logicalHeightInColumns) / computedColumnHeight()); … … 211 210 } 212 211 212 void RenderMultiColumnSet::setFlowThreadPortionRect(const LayoutRect& rect) 213 { 214 RenderRegion::setFlowThreadPortionRect(rect); 215 216 // Mutate the dimensions of the column set once our flow portion is set if the flow portion has more columns 217 // than can fit inside our current dimensions. 218 unsigned colCount = columnCount(); 219 if (!colCount) 220 return; 221 222 LayoutUnit colGap = columnGap(); 223 LayoutUnit minimumContentLogicalWidth = colCount * computedColumnWidth() + (colCount - 1) * colGap; 224 LayoutUnit currentContentLogicalWidth = contentLogicalWidth(); 225 LayoutUnit delta = max(LayoutUnit(), minimumContentLogicalWidth - currentContentLogicalWidth); 226 if (!delta) 227 return; 228 229 // Increase our logical width by the delta. 230 setLogicalWidth(logicalWidth() + delta); 231 232 // Shift our position left by the delta if we are RTL. 233 if (!style()->isLeftToRightDirection()) 234 setLogicalLeft(logicalLeft() - delta); 235 } 236 213 237 void RenderMultiColumnSet::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 214 238 { -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.h
r143484 r143506 119 119 LayoutRect flowThreadPortionRectAt(unsigned index) const; 120 120 LayoutRect flowThreadPortionOverflowRect(const LayoutRect& flowThreadPortion, unsigned index, unsigned colCount, LayoutUnit colGap) const; 121 virtual void setFlowThreadPortionRect(const LayoutRect&) OVERRIDE; 121 122 122 123 unsigned columnIndexAtOffset(LayoutUnit) const; -
trunk/Source/WebCore/rendering/RenderRegion.h
r142984 r143506 51 51 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); 52 52 53 v oid setFlowThreadPortionRect(const LayoutRect& rect) { m_flowThreadPortionRect = rect; }53 virtual void setFlowThreadPortionRect(const LayoutRect& rect) { m_flowThreadPortionRect = rect; } 54 54 LayoutRect flowThreadPortionRect() const { return m_flowThreadPortionRect; } 55 55 LayoutRect flowThreadPortionOverflowRect() const;
Note: See TracChangeset
for help on using the changeset viewer.