Changeset 95855 in webkit
- Timestamp:
- Sep 23, 2011 1:25:11 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r95852 r95855 1 2011-09-23 David Hyatt <hyatt@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=68719 4 5 Push through multiple regions when an object doesn't fit in any of them. Unlike with pages and 6 columns, when regions have a non-uniform height, we may need to push through multiple regions 7 in order to find one that fits. 8 9 Added an optimization for quickly noticing if regions do have a uniform height so that we can 10 treat them like columns and pages if so. 11 12 Also fixed the end line matchup to properly null out endLine when no next line box exists. The new 13 layout tests I wrote to cover this feature exposed this crasher, so fixing it in order to land 14 the new tests. 15 16 Reviewed by Anders Carlsson. 17 18 * fast/regions/webkit-flow-float-pushed-to-last-region.html: Added. 19 * fast/regions/webkit-flow-float-unable-to-push.html: Added. 20 * platform/mac/fast/regions/webkit-flow-float-pushed-to-last-region-expected.png: Added. 21 * platform/mac/fast/regions/webkit-flow-float-pushed-to-last-region-expected.txt: Added. 22 * platform/mac/fast/regions/webkit-flow-float-unable-to-push-expected.png: Added. 23 * platform/mac/fast/regions/webkit-flow-float-unable-to-push-expected.txt: Added. 24 1 25 2011-09-23 Konstantin Scheglov <scheglov@google.com> 2 26 -
trunk/Source/WebCore/ChangeLog
r95852 r95855 1 2011-09-23 David Hyatt <hyatt@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=68719 4 5 Push through multiple regions when an object doesn't fit in any of them. Unlike with pages and 6 columns, when regions have a non-uniform height, we may need to push through multiple regions 7 in order to find one that fits. 8 9 Added an optimization for quickly noticing if regions do have a uniform height so that we can 10 treat them like columns and pages if so. 11 12 Also fixed the end line matchup to properly null out endLine when no next line box exists. The new 13 layout tests I wrote to cover this feature exposed this crasher, so fixing it in order to land 14 the new tests. 15 16 Reviewed by Anders Carlsson. 17 18 Added new tests in fast/regions. 19 20 * rendering/RenderBlock.cpp: 21 (WebCore::RenderBlock::adjustForUnsplittableChild): 22 (WebCore::RenderBlock::pushToNextPageWithMinimumLogicalHeight): 23 (WebCore::RenderBlock::adjustLinePositionForPagination): 24 * rendering/RenderBlock.h: 25 * rendering/RenderBlockLineLayout.cpp: 26 (WebCore::RenderBlock::matchedEndLine): 27 * rendering/RenderFlowThread.cpp: 28 (WebCore::RenderFlowThread::RenderFlowThread): 29 (WebCore::RenderFlowThread::layout): 30 * rendering/RenderFlowThread.h: 31 1 32 2011-09-23 Konstantin Scheglov <scheglov@google.com> 2 33 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r95777 r95855 6229 6229 layoutState->m_columnInfo->updateMinimumColumnHeight(childLogicalHeight); 6230 6230 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); 6231 if (!pageLogicalHeight || (childLogicalHeight > pageLogicalHeight && !view()->hasRenderFlowThread())) 6231 bool hasUniformPageLogicalHeight = !view()->hasRenderFlowThread() || view()->currentRenderFlowThread()->regionsHaveUniformLogicalHeight(); 6232 if (!pageLogicalHeight || (hasUniformPageLogicalHeight && childLogicalHeight > pageLogicalHeight)) 6232 6233 return logicalOffset; 6233 6234 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset); 6234 if (remainingLogicalHeight < childLogicalHeight) 6235 if (remainingLogicalHeight < childLogicalHeight) { 6236 if (!hasUniformPageLogicalHeight && !pushToNextPageWithMinimumLogicalHeight(remainingLogicalHeight, logicalOffset, childLogicalHeight)) 6237 return logicalOffset; 6235 6238 return logicalOffset + remainingLogicalHeight; 6239 } 6236 6240 return logicalOffset; 6241 } 6242 6243 bool RenderBlock::pushToNextPageWithMinimumLogicalHeight(LayoutUnit& adjustment, LayoutUnit logicalOffset, LayoutUnit minimumLogicalHeight) const 6244 { 6245 bool checkedRegion = false; 6246 for (LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset + adjustment); pageLogicalHeight; 6247 pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset + adjustment)) { 6248 if (minimumLogicalHeight <= pageLogicalHeight) 6249 return true; 6250 adjustment += pageLogicalHeight; 6251 checkedRegion = true; 6252 } 6253 return !checkedRegion; 6237 6254 } 6238 6255 … … 6268 6285 lineBox->setPaginationStrut(0); 6269 6286 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); 6270 if (!pageLogicalHeight || (lineHeight > pageLogicalHeight && !renderView->hasRenderFlowThread())) 6287 bool hasUniformPageLogicalHeight = !view()->hasRenderFlowThread() || view()->currentRenderFlowThread()->regionsHaveUniformLogicalHeight(); 6288 if (!pageLogicalHeight || (hasUniformPageLogicalHeight && lineHeight > pageLogicalHeight)) 6271 6289 return; 6272 6290 const bool includeBoundaryPoint = false; 6273 6291 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, includeBoundaryPoint); 6274 6292 if (remainingLogicalHeight < lineHeight) { 6293 // If we have a non-uniform page height, then we have to shift further possibly. 6294 if (!hasUniformPageLogicalHeight && !pushToNextPageWithMinimumLogicalHeight(remainingLogicalHeight, logicalOffset, lineHeight)) 6295 return; 6275 6296 LayoutUnit totalLogicalHeight = lineHeight + max<LayoutUnit>(0, logicalOffset); 6276 if (lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeight && !isPositioned() && !isTableCell()) 6297 LayoutUnit pageLogicalHeightAtNewOffset = hasUniformPageLogicalHeight ? pageLogicalHeight : pageLogicalHeightForOffset(logicalOffset + remainingLogicalHeight); 6298 if (lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeightAtNewOffset && !isPositioned() && !isTableCell()) 6277 6299 setPaginationStrut(remainingLogicalHeight + max<LayoutUnit>(0, logicalOffset)); 6278 6300 else { -
trunk/Source/WebCore/rendering/RenderBlock.h
r95756 r95855 825 825 LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const; 826 826 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, bool includeBoundaryPoint = true) const; 827 bool pushToNextPageWithMinimumLogicalHeight(LayoutUnit& adjustment, LayoutUnit logicalOffset, LayoutUnit minimumLogicalHeight) const; 827 828 828 829 LayoutUnit adjustForUnsplittableChild(RenderBox* child, LayoutUnit logicalOffset, bool includeMargins = false); // If the child is unsplittable and can't fit on the current page, return the top of the next page/column. -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r95756 r95855 1615 1615 bool matched = false; 1616 1616 RootInlineBox* result = line->nextRootBox(); 1617 layoutState.setEndLine(result); 1617 1618 if (result) { 1618 1619 layoutState.setEndLineLogicalTop(line->lineBottomWithLeading()); 1619 layoutState.setEndLine(result);1620 1620 matched = checkPaginationAndFloatsAtEndLine(layoutState); 1621 1621 } -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r95740 r95855 49 49 , m_regionsInvalidated(false) 50 50 , m_regionsHaveUniformLogicalWidth(true) 51 , m_regionsHaveUniformLogicalHeight(true) 51 52 , m_regionFittingDisableCount(0) 52 53 { … … 307 308 m_hasValidRegions = false; 308 309 m_regionsHaveUniformLogicalWidth = true; 310 m_regionsHaveUniformLogicalHeight = true; 309 311 LayoutUnit previousRegionLogicalWidth = 0; 312 LayoutUnit previousRegionLogicalHeight = 0; 310 313 if (hasRegions()) { 311 314 int logicalHeight = 0; … … 319 322 320 323 LayoutUnit regionLogicalWidth; 324 LayoutUnit regionLogicalHeight; 321 325 322 326 IntRect regionRect; … … 325 329 logicalHeight += regionRect.height(); 326 330 regionLogicalWidth = region->contentWidth(); 331 regionLogicalHeight = region->contentHeight(); 327 332 } else { 328 333 regionRect = IntRect(logicalHeight, 0, region->contentWidth(), region->contentHeight()); 329 334 logicalHeight += regionRect.width(); 330 335 regionLogicalWidth = region->contentHeight(); 336 regionLogicalHeight = region->contentWidth(); 331 337 } 332 338 333 339 if (!m_hasValidRegions) 334 340 m_hasValidRegions = true; 335 else if (m_regionsHaveUniformLogicalWidth && previousRegionLogicalWidth != regionLogicalWidth) 336 m_regionsHaveUniformLogicalWidth = false; 341 else { 342 if (m_regionsHaveUniformLogicalWidth && previousRegionLogicalWidth != regionLogicalWidth) 343 m_regionsHaveUniformLogicalWidth = false; 344 if (m_regionsHaveUniformLogicalHeight && previousRegionLogicalHeight != regionLogicalHeight) 345 m_regionsHaveUniformLogicalHeight = false; 346 } 337 347 338 348 previousRegionLogicalWidth = regionLogicalWidth; -
trunk/Source/WebCore/rendering/RenderFlowThread.h
r95740 r95855 107 107 108 108 bool regionsHaveUniformLogicalWidth() const { return m_regionsHaveUniformLogicalWidth; } 109 109 bool regionsHaveUniformLogicalHeight() const { return m_regionsHaveUniformLogicalHeight; } 110 110 111 RenderRegion* mapFromFlowToRegion(TransformState&) const; 111 112 … … 141 142 bool m_regionsInvalidated; 142 143 bool m_regionsHaveUniformLogicalWidth; 144 bool m_regionsHaveUniformLogicalHeight; 143 145 unsigned m_regionFittingDisableCount; 144 146 };
Note: See TracChangeset
for help on using the changeset viewer.