⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 176285 in webkit


Ignore:
Timestamp:
Nov 18, 2014, 2:40:29 PM (12 years ago)
Author:
mmaxfield@apple.com
Message:

Multicolumn layout with negative line spacing and orphans causes pieces of letters to be shown at the bottom of columns
https://bugs.webkit.org/show_bug.cgi?id=138204

Source/WebCore:

Reviewed by Dave Hyatt.

This code is responsible for pushing block elements to the next column if
the "orphans" CSS property is triggered. The mechanism by which this is
achieved is to push the block down such that the origin of the block is
at the origin of the next column. However, if there is negative line
spacing, the top portion of the text might actually be on top of the
origin of the block. Therefore, the block wasn't being pushed down enough
to entirely contain its text, so the top pieces were being drawn on the
previous column.

Test: fast/multicol/orphans-negative-line-spacing.html

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::adjustLinePositionForPagination):

LayoutTests:

Patch by Myles C. Maxfield <litherum@gmail.com> on 2014-11-18
Reviewed by Dave Hyatt.

Create a layout where the "orphans" css property causes a block element to
be pushed to the next column.

  • fast/multicol/orphans-negative-line-spacing-expected.html: Added.
  • fast/multicol/orphans-negative-line-spacing.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r176282 r176285  
     12014-11-18  Myles C. Maxfield  <litherum@gmail.com>
     2
     3        Multicolumn layout with negative line spacing and orphans causes pieces of letters to be shown at the bottom of columns
     4        https://bugs.webkit.org/show_bug.cgi?id=138204
     5
     6        Reviewed by Dave Hyatt.
     7
     8        Create a layout where the "orphans" css property causes a block element to
     9        be pushed to the next column.
     10
     11        * fast/multicol/orphans-negative-line-spacing-expected.html: Added.
     12        * fast/multicol/orphans-negative-line-spacing.html: Added.
     13
    1142014-11-18  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r176282 r176285  
     12014-11-18  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Multicolumn layout with negative line spacing and orphans causes pieces of letters to be shown at the bottom of columns
     4        https://bugs.webkit.org/show_bug.cgi?id=138204
     5
     6        Reviewed by Dave Hyatt.
     7
     8        This code is responsible for pushing block elements to the next column if
     9        the "orphans" CSS property is triggered. The mechanism by which this is
     10        achieved is to push the block down such that the origin of the block is
     11        at the origin of the next column. However, if there is negative line
     12        spacing, the top portion of the text might actually be on top of the
     13        origin of the block. Therefore, the block wasn't being pushed down enough
     14        to entirely contain its text, so the top pieces were being drawn on the
     15        previous column.
     16
     17        Test: fast/multicol/orphans-negative-line-spacing.html
     18
     19        * rendering/RenderBlockFlow.cpp:
     20        (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
     21
    1222014-11-18  Chris Dumez  <cdumez@apple.com>
    223
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r176262 r176285  
    16681668        setPageBreak(logicalOffset, lineHeight - remainingLogicalHeight);
    16691669        if (((lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeightAtNewOffset) || (!style().hasAutoOrphans() && style().orphans() >= lineIndex))
    1670             && !isOutOfFlowPositioned() && !isTableCell())
    1671             setPaginationStrut(remainingLogicalHeight + std::max<LayoutUnit>(0, logicalOffset));
    1672         else {
     1670            && !isOutOfFlowPositioned() && !isTableCell()) {
     1671            auto firstRootBox = this->firstRootBox();
     1672            auto firstRootBoxOverflowRect = firstRootBox->logicalVisualOverflowRect(firstRootBox->lineTop(), firstRootBox->lineBottom());
     1673            auto firstLineUpperOverhang = std::max(-firstRootBoxOverflowRect.y(), LayoutUnit());
     1674            setPaginationStrut(remainingLogicalHeight + logicalOffset + firstLineUpperOverhang);
     1675        } else {
    16731676            delta += remainingLogicalHeight;
    16741677            lineBox->setPaginationStrut(remainingLogicalHeight);
Note: See TracChangeset for help on using the changeset viewer.