Changeset 278411 in webkit


Ignore:
Timestamp:
Jun 3, 2021 10:53:13 AM (14 months ago)
Author:
Alan Bujtas
Message:

Incorrect text selection when crossing flex item boundary
https://bugs.webkit.org/show_bug.cgi?id=226518
<rdar://59487603>

Reviewed by Simon Fraser.

Source/WebCore:

Let's use the more sophisticated "which child is closer to the hit point" logic in RenderBox for the flex (and grid) content.
The rest of the RenderBlock::positionForPoint is meant to deal with BFC content where block level boxes are positioned in block direction, after each other.

Test: editing/selection/selecting-content-by-overshooting-the-container.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::positionForPoint):

LayoutTests:

  • editing/selection/selecting-content-by-overshooting-the-container-expected.txt: Added.
  • editing/selection/selecting-content-by-overshooting-the-container.html: Added.
Location:
trunk
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278410 r278411  
     12021-06-03  Alan Bujtas  <zalan@apple.com>
     2
     3        Incorrect text selection when crossing flex item boundary
     4        https://bugs.webkit.org/show_bug.cgi?id=226518
     5        <rdar://59487603>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * editing/selection/selecting-content-by-overshooting-the-container-expected.txt: Added.
     10        * editing/selection/selecting-content-by-overshooting-the-container.html: Added.
     11
    1122021-06-03  Youenn Fablet  <youenn@apple.com>
    213
  • trunk/LayoutTests/platform/ios/TestExpectations

    r278382 r278411  
    404404editing/selection/user-select-all-with-single-click.html [ Skip ]
    405405editing/selection/select-out-of-floated-non-editable-13.html [ Skip ]
     406editing/selection/selecting-content-by-overshooting-the-flex-container.html [ Skip ]
     407editing/selection/selecting-content-by-overshooting-the-deprecated-flex-container.html [ Skip ]
     408editing/selection/selecting-content-by-overshooting-the-grid-container.html [ Skip ]
    406409editing/spelling/context-menu-suggestions-multiword-selection.html [ Skip ]
    407410editing/spelling/context-menu-suggestions-subword-selection.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r278407 r278411  
     12021-06-03  Alan Bujtas  <zalan@apple.com>
     2
     3        Incorrect text selection when crossing flex item boundary
     4        https://bugs.webkit.org/show_bug.cgi?id=226518
     5        <rdar://59487603>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Let's use the more sophisticated "which child is closer to the hit point" logic in RenderBox for the flex (and grid) content.
     10        The rest of the RenderBlock::positionForPoint is meant to deal with BFC content where block level boxes are positioned in block direction, after each other.
     11
     12        Test: editing/selection/selecting-content-by-overshooting-the-container.html
     13
     14        * rendering/RenderBlock.cpp:
     15        (WebCore::RenderBlock::positionForPoint):
     16
    1172021-06-03  Antti Koivisto  <antti@apple.com>
    218
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r278389 r278411  
    21982198        if (pointLogicalTop >= logicalHeight() || (pointLogicalTop >= 0 && pointLogicalLeft >= logicalWidth()))
    21992199            return createVisiblePosition(caretMaxOffset(), Affinity::Downstream);
    2200     }
     2200    }
     2201    if (isFlexibleBoxIncludingDeprecated() || isRenderGrid())
     2202        return RenderBox::positionForPoint(point, fragment);
    22012203
    22022204    LayoutPoint pointInContents = point;
Note: See TracChangeset for help on using the changeset viewer.