Changeset 123904 in webkit


Ignore:
Timestamp:
Jul 27, 2012 12:25:43 PM (12 years ago)
Author:
mitz@apple.com
Message:

Hit testing near a column break can return a result from an adjacent column when there is leading
https://bugs.webkit.org/show_bug.cgi?id=92524

Reviewed by Anders Carlsson.

Source/WebCore:

The fix for <http://webkit.org/b/92311> relied on the existence of a pagination strut for
detecting that a line was at the beginning of a new column. However, when a line naturally
falls at the beginning of a column, there is no pagination strut, and the check failed.

Test: fast/multicol/hit-test-end-of-column-with-line-height.html

  • rendering/InlineFlowBox.h:

(WebCore::InlineFlowBox::InlineFlowBox): Added initializer for new member variable.
(InlineFlowBox): Added m_isFirstAfterPageBreak member variable.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::positionForPointWithInlineChildren): Changed the test for whether a
line was at the beginning of a column from relying on a pagination strut to checking
isFirstAfterPageBreak(). Also refined the hit test itself to include the leading above such
a line.
(WebCore::RenderBlock::adjustLinePositionForPagination): Added calls to
setIsFirstAfterPageBreak() to first reset this flag, then set it to true if necessary.

  • rendering/RootInlineBox.h:

(WebCore::RootInlineBox::isFirstAfterPageBreak): Added this accessor.
(WebCore::RootInlineBox::setIsFirstAfterPageBreak): Ditto.

LayoutTests:

  • fast/multicol/hit-test-end-of-column-with-line-height-expected.txt: Added.
  • fast/multicol/hit-test-end-of-column-with-line-height.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r123899 r123904  
     12012-07-27  Dan Bernstein  <mitz@apple.com>
     2
     3        Hit testing near a column break can return a result from an adjacent column when there is leading
     4        https://bugs.webkit.org/show_bug.cgi?id=92524
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * fast/multicol/hit-test-end-of-column-with-line-height-expected.txt: Added.
     9        * fast/multicol/hit-test-end-of-column-with-line-height.html: Added.
     10
    1112012-07-27  Mike West  <mkwst@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r123902 r123904  
     12012-07-27  Dan Bernstein  <mitz@apple.com>
     2
     3        Hit testing near a column break can return a result from an adjacent column when there is leading
     4        https://bugs.webkit.org/show_bug.cgi?id=92524
     5
     6        Reviewed by Anders Carlsson.
     7
     8        The fix for <http://webkit.org/b/92311> relied on the existence of a pagination strut for
     9        detecting that a line was at the beginning of a new column. However, when a line naturally
     10        falls at the beginning of a column, there is no pagination strut, and the check failed.
     11
     12        Test: fast/multicol/hit-test-end-of-column-with-line-height.html
     13
     14        * rendering/InlineFlowBox.h:
     15        (WebCore::InlineFlowBox::InlineFlowBox): Added initializer for new member variable.
     16        (InlineFlowBox): Added m_isFirstAfterPageBreak member variable.
     17        * rendering/RenderBlock.cpp:
     18        (WebCore::RenderBlock::positionForPointWithInlineChildren): Changed the test for whether a
     19        line was at the beginning of a column from relying on a pagination strut to checking
     20        isFirstAfterPageBreak(). Also refined the hit test itself to include the leading above such
     21        a line.
     22        (WebCore::RenderBlock::adjustLinePositionForPagination): Added calls to
     23        setIsFirstAfterPageBreak() to first reset this flag, then set it to true if necessary.
     24        * rendering/RootInlineBox.h:
     25        (WebCore::RootInlineBox::isFirstAfterPageBreak): Added this accessor.
     26        (WebCore::RootInlineBox::setIsFirstAfterPageBreak): Ditto.
     27
    1282012-07-27  John J. Barton  <johnjbarton@johnjbarton.com>
    229
  • trunk/Source/WebCore/rendering/InlineFlowBox.h

    r121085 r123904  
    5050        , m_hasAnnotationsBefore(false)
    5151        , m_hasAnnotationsAfter(false)
     52        , m_isFirstAfterPageBreak(false)
    5253#ifndef NDEBUG
    5354        , m_hasBadChildList(false)
     
    322323    unsigned m_hasAnnotationsBefore : 1;
    323324    unsigned m_hasAnnotationsAfter : 1;
     325    bool m_isFirstAfterPageBreak : 1;
    324326
    325327    unsigned m_lineBreakBidiStatusEor : 5; // WTF::Unicode::Direction
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r123754 r123904  
    49274927            firstRootBoxWithChildren = root;
    49284928
    4929         if (root->paginationStrut() && pointInLogicalContents.y() < root->logicalTop())
     4929        if (root->isFirstAfterPageBreak() && pointInLogicalContents.y() < root->lineTopWithLeading())
    49304930            break;
    49314931
     
    69626962    logicalOffset += delta;
    69636963    lineBox->setPaginationStrut(0);
     6964    lineBox->setIsFirstAfterPageBreak(false);
    69646965    LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
    69656966    bool hasUniformPageLogicalHeight = !inRenderFlowThread() || enclosingRenderFlowThread()->regionsHaveUniformLogicalHeight();
     
    69856986            delta += remainingLogicalHeight;
    69866987            lineBox->setPaginationStrut(remainingLogicalHeight);
    6987         }
    6988     }
     6988            lineBox->setIsFirstAfterPageBreak(true);
     6989        }
     6990    } else if (remainingLogicalHeight == pageLogicalHeight && lineBox != firstRootBox())
     6991        lineBox->setIsFirstAfterPageBreak(true);
    69896992}
    69906993
  • trunk/Source/WebCore/rendering/RootInlineBox.h

    r121085 r123904  
    5656    LayoutUnit paginationStrut() const { return m_paginationStrut; }
    5757    void setPaginationStrut(LayoutUnit s) { m_paginationStrut = s; }
     58
     59    bool isFirstAfterPageBreak() const { return m_isFirstAfterPageBreak; }
     60    void setIsFirstAfterPageBreak(bool isFirstAfterPageBreak) { m_isFirstAfterPageBreak = isFirstAfterPageBreak; }
    5861
    5962    LayoutUnit paginatedLineWidth() const { return m_paginatedLineWidth; }
Note: See TracChangeset for help on using the changeset viewer.