Changeset 176354 in webkit
- Timestamp:
- Nov 19, 2014, 3:40:23 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/multicol/tall-image-behavior-lr.html (added)
-
LayoutTests/fast/multicol/tall-image-behavior-rl.html (added)
-
LayoutTests/fast/multicol/tall-image-behavior.html (added)
-
LayoutTests/platform/mac/fast/multicol/tall-image-behavior-expected.png (added)
-
LayoutTests/platform/mac/fast/multicol/tall-image-behavior-expected.txt (added)
-
LayoutTests/platform/mac/fast/multicol/tall-image-behavior-lr-expected.png (added)
-
LayoutTests/platform/mac/fast/multicol/tall-image-behavior-lr-expected.txt (added)
-
LayoutTests/platform/mac/fast/multicol/tall-image-behavior-rl-expected.png (added)
-
LayoutTests/platform/mac/fast/multicol/tall-image-behavior-rl-expected.txt (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/InlineFlowBox.cpp (modified) (1 diff)
-
Source/WebCore/rendering/InlineFlowBox.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderBlockFlow.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r176350 r176354 1 2014-11-19 David Hyatt <hyatt@apple.com> 2 3 Images/replaced elements that are as tall as a page should be on their own page 4 https://bugs.webkit.org/show_bug.cgi?id=138886 - <rdar://problem/18296371> 5 6 Reviewed by Dean Jackson. 7 8 * fast/multicol/tall-image-behavior-lr.html: Added. 9 * fast/multicol/tall-image-behavior-rl.html: Added. 10 * fast/multicol/tall-image-behavior.html: Added. 11 * platform/mac/fast/multicol/tall-image-behavior-expected.png: Added. 12 * platform/mac/fast/multicol/tall-image-behavior-expected.txt: Added. 13 * platform/mac/fast/multicol/tall-image-behavior-lr-expected.png: Added. 14 * platform/mac/fast/multicol/tall-image-behavior-lr-expected.txt: Added. 15 * platform/mac/fast/multicol/tall-image-behavior-rl-expected.png: Added. 16 * platform/mac/fast/multicol/tall-image-behavior-rl-expected.txt: Added. 17 1 18 2014-11-18 Ada Chan <adachan@apple.com> 2 19 -
trunk/Source/WebCore/ChangeLog
r176350 r176354 1 2014-11-19 David Hyatt <hyatt@apple.com> 2 3 Images/replaced elements that are as tall as a page should be on their own page 4 https://bugs.webkit.org/show_bug.cgi?id=138886 - <rdar://problem/18296371> 5 6 Reviewed by Dean Jackson. 7 8 Added fast/multicol/tall-image-behavior.html (and RL/LR variants) 9 10 * rendering/InlineFlowBox.cpp: 11 (WebCore::InlineFlowBox::computeReplacedAndTextLineTopAndBottom): 12 * rendering/InlineFlowBox.h: 13 Add a new method that computes the line top and line bottom ignoring all margins, 14 overflow and line-height. This allows us to see if a line that is taller than a page 15 can be made to fit if we ignored margins and unused descent. 16 17 * rendering/RenderBlockFlow.cpp: 18 (WebCore::RenderBlockFlow::adjustLinePositionForPagination): 19 Call the new helper function, computeReplacedAndTextLineTopAndBottom and push 20 to a new page if we see that we can fit on a page by ourselves without blank space 21 included. 22 1 23 2014-11-18 Ada Chan <adachan@apple.com> 2 24 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r174840 r176354 1637 1637 } 1638 1638 1639 void InlineFlowBox::computeReplacedAndTextLineTopAndBottom(LayoutUnit& lineTop, LayoutUnit& lineBottom) const 1640 { 1641 for (const auto* box = firstChild(); box; box = box->nextOnLine()) { 1642 if (is<InlineFlowBox>(*box)) 1643 downcast<InlineFlowBox>(*box).computeReplacedAndTextLineTopAndBottom(lineTop, lineBottom); 1644 else { 1645 if (box->logicalTop() < lineTop) 1646 lineTop = box->logicalTop(); 1647 if (box->logicalBottom() > lineBottom) 1648 lineBottom = box->logicalBottom(); 1649 } 1650 } 1651 } 1652 1639 1653 #ifndef NDEBUG 1640 1654 -
trunk/Source/WebCore/rendering/InlineFlowBox.h
r174746 r176354 292 292 } 293 293 294 void computeReplacedAndTextLineTopAndBottom(LayoutUnit& lineTop, LayoutUnit& lineBottom) const; 295 294 296 private: 295 297 virtual bool isInlineFlowBox() const override final { return true; } -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r176285 r176354 1641 1641 // If lineHeight is greater than pageLogicalHeight, but logicalVisualOverflow.height() still fits, we are 1642 1642 // still going to add a strut, so that the visible overflow fits on a single page. 1643 if (!pageLogicalHeight || (hasUniformPageLogicalHeight && logicalVisualOverflow.height() > pageLogicalHeight) 1644 || !hasNextPage(logicalOffset)) 1643 if (!pageLogicalHeight || !hasNextPage(logicalOffset)) { 1645 1644 // FIXME: In case the line aligns with the top of the page (or it's slightly shifted downwards) it will not be marked as the first line in the page. 1646 1645 // From here, the fix is not straightforward because it's not easy to always determine when the current line is the first in the page. 1647 1646 return; 1647 } 1648 1649 if (hasUniformPageLogicalHeight && logicalVisualOverflow.height() > pageLogicalHeight) { 1650 // We are so tall that we are bigger than a page. Before we give up and just leave the line where it is, try drilling into the 1651 // line and computing a new height that excludes anything we consider "blank space". We will discard margins, descent, and even overflow. If we are 1652 // able to fit with the blank space and overflow excluded, we will give the line its own page with the highest non-blank element being aligned with the 1653 // top of the page. 1654 // FIXME: We are still honoring gigantic margins, which does leave open the possibility of blank pages caused by this heuristic. It remains to be seen whether or not 1655 // this will be a real-world issue. For now we don't try to deal with this problem. 1656 logicalOffset = intMaxForLayoutUnit; 1657 logicalBottom = intMinForLayoutUnit; 1658 lineBox->computeReplacedAndTextLineTopAndBottom(logicalOffset, logicalBottom); 1659 lineHeight = logicalBottom - logicalOffset; 1660 if (logicalOffset == intMaxForLayoutUnit || lineHeight > pageLogicalHeight) 1661 return; // Give up. We're genuinely too big even after excluding blank space and overflow. 1662 pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset); 1663 } 1664 1648 1665 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, ExcludePageBoundary); 1649 1666 overflowsRegion = (lineHeight > remainingLogicalHeight);
Note:
See TracChangeset
for help on using the changeset viewer.