Changeset 278379 in webkit


Ignore:
Timestamp:
Jun 2, 2021 3:31:09 PM (14 months ago)
Author:
Alan Bujtas
Message:

Incorrect selection when tall float is present
https://bugs.webkit.org/show_bug.cgi?id=226552
<rdar://problem/78781056>

Reviewed by Simon Fraser.

Source/WebCore:

While floats may end up at the bottom of their containers, they do not necessarily stretch the container by their full height.
e.g. <div><div style="float: left; height: 10px; width: 10px;"></div>some<br>text<br>here</div>
The [some text here] content wraps around the float and stretches the containing block <div>.

Test: editing/selection/select-out-of-floated-non-editable-13.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::positionForPoint):

LayoutTests:

  • editing/selection/select-out-of-floated-non-editable-07.html:
  • editing/selection/select-out-of-floated-non-editable-13-expected.txt: Added.
  • editing/selection/select-out-of-floated-non-editable-13.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278377 r278379  
     12021-06-02  Alan Bujtas  <zalan@apple.com>
     2
     3        Incorrect selection when tall float is present
     4        https://bugs.webkit.org/show_bug.cgi?id=226552
     5        <rdar://problem/78781056>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * editing/selection/select-out-of-floated-non-editable-07.html:
     10        * editing/selection/select-out-of-floated-non-editable-13-expected.txt: Added.
     11        * editing/selection/select-out-of-floated-non-editable-13.html: Added.
     12
    1132021-06-02  Antoine Quint  <graouts@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r278377 r278379  
     12021-06-02  Alan Bujtas  <zalan@apple.com>
     2
     3        Incorrect selection when tall float is present
     4        https://bugs.webkit.org/show_bug.cgi?id=226552
     5        <rdar://problem/78781056>
     6
     7        Reviewed by Simon Fraser.
     8
     9        While floats may end up at the bottom of their containers, they do not necessarily stretch the container by their full height.
     10        e.g. <div><div style="float: left; height: 10px; width: 10px;"></div>some<br>text<br>here</div>
     11        The [some text here] content wraps around the float and stretches the containing block <div>.
     12
     13        Test: editing/selection/select-out-of-floated-non-editable-13.html
     14
     15        * rendering/RenderBlock.cpp:
     16        (WebCore::RenderBlock::positionForPoint):
     17
    1182021-06-02  Antoine Quint  <graouts@webkit.org>
    219
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r278354 r278379  
    22262226            if (!isChildHitTestCandidate(*childBox, fragment, pointInLogicalContents))
    22272227                continue;
    2228             LayoutUnit childLogicalBottom = logicalTopForChild(*childBox) + logicalHeightForChild(*childBox);
     2228            auto childLogicalBottom = logicalTopForChild(*childBox) + logicalHeightForChild(*childBox);
    22292229            if (is<RenderBlockFlow>(childBox))
    2230                 childLogicalBottom += downcast<RenderBlockFlow>(childBox)->lowestFloatLogicalBottom();
     2230                childLogicalBottom = std::max(childLogicalBottom, downcast<RenderBlockFlow>(*childBox).lowestFloatLogicalBottom());
    22312231            // We hit child if our click is above the bottom of its padding box (like IE6/7 and FF3).
    22322232            if (isChildHitTestCandidate(*childBox, fragment, pointInLogicalContents) && (pointInLogicalContents.y() < childLogicalBottom
Note: See TracChangeset for help on using the changeset viewer.