Changeset 55636 in webkit
- Timestamp:
- Mar 7, 2010 10:15:02 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r55635 r55636 1 2010-03-07 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 <rdar://problem/7722008> Column breaking ignores floats 6 https://bugs.webkit.org/show_bug.cgi?id=35837 7 8 * fast/multicol/float-truncation-expected.txt: Added. 9 * fast/multicol/float-truncation.html: Added. 10 1 11 2010-03-07 Dmitry Titov <dimich@chromium.org> 2 12 -
trunk/WebCore/ChangeLog
r55635 r55636 1 2010-03-07 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 <rdar://problem/7722008> Column breaking ignores floats 6 https://bugs.webkit.org/show_bug.cgi?id=35837 7 8 Test: fast/multicol/float-truncation.html 9 10 Introduce an earlier column-break if otherwise a float that could fit 11 inside a single column will be split between columns. 12 13 It is still possible for floats to be needlessly broken if initially 14 they fit in the column, but normal flow truncation then shortens the 15 column. 16 17 * rendering/RenderBlock.cpp: 18 (WebCore::RenderBlock::visibleTopOfHighestFloatExtendingBelow): Added. 19 Returns the visible top of the highest descendant float that visibly 20 extends below the given y offset, ignoring floats that are taller than 21 the given maximum height. 22 (WebCore::RenderBlock::layoutColumns): If the initial column height 23 would cause a float to be split, truncate above the float. 24 * rendering/RenderBlock.h: 25 1 26 2010-03-07 Dmitry Titov <dimich@chromium.org> 2 27 -
trunk/WebCore/rendering/RenderBlock.cpp
r55630 r55636 3183 3183 } 3184 3184 3185 int RenderBlock::visibleTopOfHighestFloatExtendingBelow(int bottom, int maxHeight) const 3186 { 3187 int top = bottom; 3188 if (m_floatingObjects) { 3189 FloatingObject* floatingObject; 3190 for (DeprecatedPtrListIterator<FloatingObject> it(*m_floatingObjects); (floatingObject = it.current()); ++it) { 3191 RenderBox* floatingBox = floatingObject->m_renderer; 3192 IntRect visibleOverflow = floatingBox->visibleOverflowRect(); 3193 visibleOverflow.move(floatingBox->x(), floatingBox->y()); 3194 if (visibleOverflow.y() < top && visibleOverflow.bottom() > bottom && visibleOverflow.height() <= maxHeight && floatingBox->containingBlock() == this) 3195 top = visibleOverflow.y(); 3196 } 3197 } 3198 3199 if (!childrenInline()) { 3200 for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { 3201 if (child->isFloatingOrPositioned() || !child->isRenderBlock()) 3202 continue; 3203 RenderBlock* childBlock = toRenderBlock(child); 3204 top = min(top, childBlock->y() + childBlock->visibleTopOfHighestFloatExtendingBelow(bottom - childBlock->y(), maxHeight)); 3205 } 3206 } 3207 3208 return top; 3209 } 3210 3185 3211 int RenderBlock::getClearDelta(RenderBox* child, int yPos) 3186 3212 { … … 3724 3750 // This represents the real column position. 3725 3751 IntRect colRect(currX, top, desiredColumnWidth, colHeight); 3726 3752 3753 int truncationPoint = visibleTopOfHighestFloatExtendingBelow(currY + colHeight, colHeight); 3754 3727 3755 // For the simulated paint, we pretend like everything is in one long strip. 3728 IntRect pageRect(left, currY, desiredColumnWidth, colHeight);3756 IntRect pageRect(left, currY, desiredColumnWidth, truncationPoint - currY); 3729 3757 v->setPrintRect(pageRect); 3730 v->setTruncatedAt( currY + colHeight);3758 v->setTruncatedAt(truncationPoint); 3731 3759 GraphicsContext context((PlatformGraphicsContext*)0); 3732 3760 RenderObject::PaintInfo paintInfo(&context, pageRect, PaintPhaseForeground, false, 0, 0); … … 3743 3771 int adjustedBottom = v->bestTruncatedAt(); 3744 3772 if (adjustedBottom <= currY) 3745 adjustedBottom = currY + colHeight;3773 adjustedBottom = truncationPoint; 3746 3774 3747 3775 colRect.setHeight(adjustedBottom - currY); -
trunk/WebCore/rendering/RenderBlock.h
r55630 r55636 372 372 void calcColumnWidth(); 373 373 int layoutColumns(int endOfContent = -1, int requestedColumnHeight = -1); 374 int visibleTopOfHighestFloatExtendingBelow(int bottom, int maxHeight) const; 374 375 375 376 bool expandsToEncloseOverhangingFloats() const;
Note: See TracChangeset
for help on using the changeset viewer.