Changeset 123684 in webkit


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

Hit testing in one column or in the gap between cloumns along the block axis can return a result from the wrong column
https://bugs.webkit.org/show_bug.cgi?id=92311

Reviewed by Anders Carlsson.

Source/WebCore:

Tests: fast/multicol/hit-test-end-of-column.html

fast/multicol/hit-test-gap-block-axis.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::positionForPointWithInlineChildren): To prevent hits after the last
line on a given column from returning the next line in the next column, added a check if
the hit occurred within the pagination strut of a line. Covered by the first test.
(WebCore::RenderBlock::adjustPointToColumnContents): Added clamp-to-column logic for the
block-axis case. This prevents hits near the bottom of the top half of the gap from bleeding
into the top of the next column. Covered by the second test.

LayoutTests:

  • fast/multicol/hit-test-end-of-column-expected.txt: Added.
  • fast/multicol/hit-test-end-of-column.html: Added.
  • fast/multicol/hit-test-gap-block-axis-expected.txt: Added.
  • fast/multicol/hit-test-gap-block-axis.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r123678 r123684  
     12012-07-25  Dan Bernstein  <mitz@apple.com>
     2
     3        Hit testing in one column or in the gap between cloumns along the block axis can return a result from the wrong column
     4        https://bugs.webkit.org/show_bug.cgi?id=92311
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * fast/multicol/hit-test-end-of-column-expected.txt: Added.
     9        * fast/multicol/hit-test-end-of-column.html: Added.
     10        * fast/multicol/hit-test-gap-block-axis-expected.txt: Added.
     11        * fast/multicol/hit-test-gap-block-axis.html: Added.
     12
    1132012-07-25  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r123683 r123684  
     12012-07-25  Dan Bernstein  <mitz@apple.com>
     2
     3        Hit testing in one column or in the gap between cloumns along the block axis can return a result from the wrong column
     4        https://bugs.webkit.org/show_bug.cgi?id=92311
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Tests: fast/multicol/hit-test-end-of-column.html
     9               fast/multicol/hit-test-gap-block-axis.html
     10
     11        * rendering/RenderBlock.cpp:
     12        (WebCore::RenderBlock::positionForPointWithInlineChildren): To prevent hits after the last
     13        line on a given column from returning the next line in the next column, added a check if
     14        the hit occurred within the pagination strut of a line. Covered by the first test.
     15        (WebCore::RenderBlock::adjustPointToColumnContents): Added clamp-to-column logic for the
     16        block-axis case. This prevents hits near the bottom of the top half of the gap from bleeding
     17        into the top of the next column. Covered by the second test.
     18
    1192012-07-25  David Grogan  <dgrogan@chromium.org>
    220
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r123626 r123684  
    49264926        if (!firstRootBoxWithChildren)
    49274927            firstRootBoxWithChildren = root;
     4928
     4929        if (root->paginationStrut() && pointInLogicalContents.y() < root->logicalTop())
     4930            break;
     4931
    49284932        lastRootBoxWithChildren = root;
    49294933
     
    52485252            LayoutRect gapAndColumnRect(colRect.x() - halfColGap, colRect.y(), colRect.width() + colGap, colRect.height());
    52495253            if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.maxX()) {
    5250                 // FIXME: The clamping that follows is not completely right for right-to-left
    5251                 // content.
    5252                 // Clamp everything above the column to its top left.
    5253                 if (point.y() < gapAndColumnRect.y())
    5254                     point = gapAndColumnRect.location();
    5255                 // Clamp everything below the column to the next column's top left. If there is
    5256                 // no next column, this still maps to just after this column.
    5257                 else if (point.y() >= gapAndColumnRect.maxY()) {
    5258                     point = gapAndColumnRect.location();
    5259                     point.move(0, gapAndColumnRect.height());
     5254                if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) {
     5255                    // FIXME: The clamping that follows is not completely right for right-to-left
     5256                    // content.
     5257                    // Clamp everything above the column to its top left.
     5258                    if (point.y() < gapAndColumnRect.y())
     5259                        point = gapAndColumnRect.location();
     5260                    // Clamp everything below the column to the next column's top left. If there is
     5261                    // no next column, this still maps to just after this column.
     5262                    else if (point.y() >= gapAndColumnRect.maxY()) {
     5263                        point = gapAndColumnRect.location();
     5264                        point.move(0, gapAndColumnRect.height());
     5265                    }
     5266                } else {
     5267                    if (point.x() < colRect.x())
     5268                        point.setX(colRect.x());
     5269                    else if (point.x() >= colRect.maxX())
     5270                        point.setX(colRect.maxX() - 1);
    52605271                }
    52615272
     
    52735284            LayoutRect gapAndColumnRect(colRect.x(), colRect.y() - halfColGap, colRect.width(), colRect.height() + colGap);
    52745285            if (point.y() >= gapAndColumnRect.y() && point.y() < gapAndColumnRect.maxY()) {
    5275                 // FIXME: The clamping that follows is not completely right for right-to-left
    5276                 // content.
    5277                 // Clamp everything above the column to its top left.
    5278                 if (point.x() < gapAndColumnRect.x())
    5279                     point = gapAndColumnRect.location();
    5280                 // Clamp everything below the column to the next column's top left. If there is
    5281                 // no next column, this still maps to just after this column.
    5282                 else if (point.x() >= gapAndColumnRect.maxX()) {
    5283                     point = gapAndColumnRect.location();
    5284                     point.move(gapAndColumnRect.width(), 0);
     5286                if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) {
     5287                    // FIXME: The clamping that follows is not completely right for right-to-left
     5288                    // content.
     5289                    // Clamp everything above the column to its top left.
     5290                    if (point.x() < gapAndColumnRect.x())
     5291                        point = gapAndColumnRect.location();
     5292                    // Clamp everything below the column to the next column's top left. If there is
     5293                    // no next column, this still maps to just after this column.
     5294                    else if (point.x() >= gapAndColumnRect.maxX()) {
     5295                        point = gapAndColumnRect.location();
     5296                        point.move(gapAndColumnRect.width(), 0);
     5297                    }
     5298                } else {
     5299                    if (point.y() < colRect.y())
     5300                        point.setY(colRect.y());
     5301                    else if (point.y() >= colRect.maxY())
     5302                        point.setY(colRect.maxY() - 1);
    52855303                }
    52865304
Note: See TracChangeset for help on using the changeset viewer.