Changeset 84096 in webkit
- Timestamp:
- Apr 16, 2011 2:59:36 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r84093 r84096 1 2011-04-16 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 <rdar://problem/9190108> Crash when hiding a float 6 7 * fast/block/float/overhanging-tall-block.html: Added. 8 * platform/mac/fast/block/float/overhanging-tall-block-expected.checksum: Added. 9 * platform/mac/fast/block/float/overhanging-tall-block-expected.png: Added. 10 * platform/mac/fast/block/float/overhanging-tall-block-expected.txt: Added. 11 1 12 2011-04-16 Simon Fraser <simon.fraser@apple.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r84091 r84096 1 2011-04-16 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 <rdar://problem/9190108> Crash when hiding a float 6 7 Test: fast/block/float/overhanging-tall-block.html 8 9 * rendering/RenderBlock.cpp: 10 (WebCore::RenderBlock::addOverhangingFloats): Moved the call to childLogicalTop() out of the loop. 11 Capped the logical bottom so that we get the correct maximum. 12 * rendering/RenderBlock.h: Decleared appendFloatingObjectToLastLine(). 13 * rendering/RenderBlockLineLayout.cpp: 14 (WebCore::RenderBlock::appendFloatingObjectToLastLine): Added. Ensures correct bookkeeping by 15 extending the float if needed so that it touches the line. 16 (WebCore::RenderBlock::layoutInlineChildren): Changed to call appendFloatingObjectToLastLine(). 17 (WebCore::RenderBlock::checkFloatsInCleanLine): Capped the float height so the we mark the right 18 range of lines as dirty. 19 * rendering/RootInlineBox.h: 20 (WebCore::RootInlineBox::appendFloat): Replaced the floats() accessor with this function, which 21 allows the creation of the vector to be combined with appending the first float. 22 1 23 2011-04-16 Sam Weinig <sam@webkit.org> 2 24 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r84066 r84096 3651 3651 return 0; 3652 3652 3653 int childLogicalTop = child->logicalTop(); 3653 3654 int lowestFloatLogicalBottom = 0; 3654 3655 … … 3658 3659 for (FloatingObjectSetIterator childIt = child->m_floatingObjects->set().begin(); childIt != childEnd; ++childIt) { 3659 3660 FloatingObject* r = *childIt; 3660 int logicalBottom = child->logicalTop() + logicalBottomForFloat(r); 3661 int logicalBottomForFloat = min(this->logicalBottomForFloat(r), numeric_limits<int>::max() - childLogicalTop); 3662 int logicalBottom = childLogicalTop + logicalBottomForFloat; 3661 3663 lowestFloatLogicalBottom = max(lowestFloatLogicalBottom, logicalBottom); 3662 3664 -
trunk/Source/WebCore/rendering/RenderBlock.h
r83813 r84096 512 512 // have to move to the next page/column. 513 513 bool positionNewFloatOnLine(FloatingObject* newFloat, FloatingObject* lastFloatFromPreviousLine, LineWidth&); 514 void appendFloatingObjectToLastLine(FloatingObject*); 514 515 515 516 // End of functions defined in RenderBlockLineLayout.cpp. -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r83813 r84096 713 713 } 714 714 return trailingSpaceRun; 715 } 716 717 void RenderBlock::appendFloatingObjectToLastLine(FloatingObject* floatingObject) 718 { 719 // Ensure that the float touches the line. 720 if (logicalBottomForFloat(floatingObject) < lastRootBox()->blockLogicalHeight()) 721 setLogicalHeightForFloat(floatingObject, lastRootBox()->blockLogicalHeight() - logicalTopForFloat(floatingObject)); 722 723 lastRootBox()->appendFloat(floatingObject->renderer()); 715 724 } 716 725 … … 999 1008 for (; it != end; ++it) { 1000 1009 FloatingObject* f = *it; 1001 lastRootBox()->floats().append(f->m_renderer);1010 appendFloatingObjectToLastLine(f); 1002 1011 ASSERT(f->m_renderer == floats[floatIndex].object); 1003 1012 // If a float's geometry has changed, give up on syncing with clean lines. … … 1081 1090 } 1082 1091 for (; it != end; ++it) 1083 lastRootBox()->floats().append((*it)->m_renderer);1092 appendFloatingObjectToLastLine(*it); 1084 1093 lastFloat = !floatingObjectSet.isEmpty() ? floatingObjectSet.last() : 0; 1085 1094 } … … 1139 1148 int floatHeight = isHorizontalWritingMode() ? max(floats[floatIndex].rect.height(), newSize.height()) 1140 1149 : max(floats[floatIndex].rect.width(), newSize.width()); 1150 floatHeight = min(floatHeight, numeric_limits<int>::max() - floatTop); 1141 1151 line->markDirty(); 1142 1152 markLinesDirtyInBlockRange(line->blockLogicalHeight(), floatTop + floatHeight, line); -
trunk/Source/WebCore/rendering/RootInlineBox.h
r82611 r84096 112 112 InlineBox* closestLeafChildForLogicalLeftPosition(int, bool onlyEditableLeaves = false); 113 113 114 Vector<RenderBox*>& floats()114 void appendFloat(RenderBox* floatingBox) 115 115 { 116 116 ASSERT(!isDirty()); 117 if (!m_floats) 118 m_floats= adoptPtr(new Vector<RenderBox*>); 119 return *m_floats; 117 if (m_floats) 118 m_floats->append(floatingBox); 119 else 120 m_floats= adoptPtr(new Vector<RenderBox*>(1, floatingBox)); 120 121 } 121 122
Note: See TracChangeset
for help on using the changeset viewer.