Unpredictable selection when dragging out of float elements children of in-flow block...
authorjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Sep 2017 13:43:28 +0000 (13:43 +0000)
committerjfernandez@igalia.com <jfernandez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Sep 2017 13:43:28 +0000 (13:43 +0000)
commitae060271c6e5e2b61f0d8590b284402e2c587368
tree21cbeaf717ba1bfdd2da0d7048e4a13f17e9cb8f
parent81ac8bc2da2ff02e2a970ee07bd925d2a920e8c3
Unpredictable selection when dragging out of float elements children of in-flow block-level box
https://bugs.webkit.org/show_bug.cgi?id=176096

Reviewed by David Hyatt.

Source/WebCore:

In order to improve Selection across float elements we need to
consider them as HitTest candidates.  Additionally, since
out-of-flow elements must not affect how in-flow elements are
rendered we have to deal with some special cases when implementing
the positionForPoint logic.

This patch addresses the issues caused by the fact that an in-flow
box's logicalBottom does not consider the out-of-flow children, as
they don't affect its height. Hence, we should add the lowest float
logical bottom to figure out the box the point is actually hitting.

Tests: editing/selection/select-out-of-floated-non-editable-01.html
       editing/selection/select-out-of-floated-non-editable-02.html
       editing/selection/select-out-of-floated-non-editable-03.html
       editing/selection/select-out-of-floated-non-editable-04.html
       editing/selection/select-out-of-floated-non-editable-05.html
       editing/selection/select-out-of-floated-non-editable-06.html
       editing/selection/select-out-of-floated-non-editable-07.html
       editing/selection/select-out-of-floated-non-editable-08.html
       editing/selection/select-out-of-floated-non-editable-09.html
       editing/selection/select-out-of-floated-non-editable-10.html
       editing/selection/select-out-of-floated-non-editable-11.html
       editing/selection/select-out-of-floated-non-editable-12.html

* rendering/RenderBlock.cpp:
(WebCore::isChildHitTestCandidate):
(WebCore::RenderBlock::positionForPoint):

LayoutTests:

Tests defining several cases of selection with floats, children of
a block-level box, so they behave as regular HitTest candidates
and don't mess the selection boundaries.

* editing/selection/resources/select-out-of-floated-non-editable.js: Added.
(clearLog):
(log):
(else.window.onmouseup):
(runTest):
(checkSelection):
* editing/selection/select-out-of-floated-non-editable-01-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-01.html: Added.
* editing/selection/select-out-of-floated-non-editable-02-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-02.html: Added.
* editing/selection/select-out-of-floated-non-editable-03-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-03.html: Added.
* editing/selection/select-out-of-floated-non-editable-04-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-04.html: Added.
* editing/selection/select-out-of-floated-non-editable-05-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-05.html: Added.
* editing/selection/select-out-of-floated-non-editable-06-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-06.html: Added.
* editing/selection/select-out-of-floated-non-editable-07-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-07.html: Added.
* editing/selection/select-out-of-floated-non-editable-08-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-08.html: Added.
* editing/selection/select-out-of-floated-non-editable-09-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-09.html: Added.
* editing/selection/select-out-of-floated-non-editable-10-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-10.html: Added.
* editing/selection/select-out-of-floated-non-editable-11-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-11.html: Added.
* editing/selection/select-out-of-floated-non-editable-12-expected.txt: Added.
* editing/selection/select-out-of-floated-non-editable-12.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222317 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/selection/resources/select-out-of-floated-non-editable.js [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-01-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-01.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-02-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-02.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-03-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-03.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-04-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-04.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-05-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-05.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-06-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-06.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-07-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-07.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-08-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-08.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-09-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-09.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-10-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-10.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-11-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-11.html [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-12-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-out-of-floated-non-editable-12.html [new file with mode: 0644]
LayoutTests/platform/ios-simulator-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlockFlow.h