RESOLVED FIXED 176096
Unpredictable selection when dragging out of float elements children of in-flow block-level box
https://bugs.webkit.org/show_bug.cgi?id=176096
Summary Unpredictable selection when dragging out of float elements children of in-fl...
Javier Fernandez
Reported 2017-08-30 03:59:43 PDT
Created attachment 319356 [details] Test case to reproduce the bug This bug is the first one of several issues we have with selection and out-of-flow elements. Attached a reduced case to reproduce the issue. Selecting from any point inside the float element and dragging outside its visible area will cause the selection to change it's visible boundaries, in a very weird and unpredictable way. This particular issue address the case of float elements children of an in-flow block-level box. In this scenario, we use the LayoutBlock hit testing logic to determine the position of the selection point. Since we exclude float elements from the valid candidates, we end up setting the parent node. This logic implies that original start/end selection points will be transposed.
Attachments
Test case to reproduce the bug (390 bytes, text/html)
2017-08-30 03:59 PDT, Javier Fernandez
no flags
Patch (34.16 KB, patch)
2017-09-05 08:31 PDT, Javier Fernandez
no flags
Archive of layout-test-results from ews101 for mac-elcapitan (1.35 MB, application/zip)
2017-09-05 09:39 PDT, Build Bot
no flags
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (1.47 MB, application/zip)
2017-09-05 09:43 PDT, Build Bot
no flags
Archive of layout-test-results from ews116 for mac-elcapitan (2.15 MB, application/zip)
2017-09-05 09:58 PDT, Build Bot
no flags
Archive of layout-test-results from ews126 for ios-simulator-wk2 (1.38 MB, application/zip)
2017-09-05 10:07 PDT, Build Bot
no flags
Patch (34.16 KB, patch)
2017-09-06 02:42 PDT, Javier Fernandez
no flags
Patch (34.20 KB, patch)
2017-09-06 02:55 PDT, Javier Fernandez
no flags
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (1.71 MB, application/zip)
2017-09-06 03:51 PDT, Build Bot
no flags
Archive of layout-test-results from ews101 for mac-elcapitan (1.37 MB, application/zip)
2017-09-06 04:03 PDT, Build Bot
no flags
Archive of layout-test-results from ews116 for mac-elcapitan (2.17 MB, application/zip)
2017-09-06 04:18 PDT, Build Bot
no flags
Archive of layout-test-results from ews121 for ios-simulator-wk2 (1.38 MB, application/zip)
2017-09-06 04:33 PDT, Build Bot
no flags
Patch (35.03 KB, patch)
2017-09-06 15:54 PDT, Javier Fernandez
no flags
Archive of layout-test-results from ews124 for ios-simulator-wk2 (1.47 MB, application/zip)
2017-09-06 17:34 PDT, Build Bot
no flags
Patch (34.79 KB, patch)
2017-09-18 00:43 PDT, Javier Fernandez
no flags
Archive of layout-test-results from ews123 for ios-simulator-wk2 (1.49 MB, application/zip)
2017-09-18 02:22 PDT, Build Bot
no flags
Patch (36.22 KB, patch)
2017-09-21 02:34 PDT, Javier Fernandez
no flags
Javier Fernandez
Comment 1 2017-09-05 08:31:54 PDT
Build Bot
Comment 2 2017-09-05 09:39:04 PDT
Comment on attachment 319897 [details] Patch Attachment 319897 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/4454792 New failing tests: fast/multicol/hit-test-above-or-below.html fast/writing-mode/positionForPoint.html fast/events/drag-and-drop-link-into-focused-contenteditable.html editing/selection/click-in-margins-inside-editable-div.html
Build Bot
Comment 3 2017-09-05 09:39:05 PDT
Created attachment 319906 [details] Archive of layout-test-results from ews101 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 4 2017-09-05 09:43:51 PDT
Comment on attachment 319897 [details] Patch Attachment 319897 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/4454798 New failing tests: fast/multicol/hit-test-above-or-below.html fast/writing-mode/positionForPoint.html editing/selection/click-in-margins-inside-editable-div.html
Build Bot
Comment 5 2017-09-05 09:43:53 PDT
Created attachment 319909 [details] Archive of layout-test-results from ews105 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 6 2017-09-05 09:58:01 PDT
Comment on attachment 319897 [details] Patch Attachment 319897 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4454826 New failing tests: fast/multicol/hit-test-above-or-below.html fast/writing-mode/positionForPoint.html fast/events/drag-and-drop-link-into-focused-contenteditable.html editing/selection/click-in-margins-inside-editable-div.html
Build Bot
Comment 7 2017-09-05 09:58:03 PDT
Created attachment 319910 [details] Archive of layout-test-results from ews116 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 8 2017-09-05 10:07:54 PDT
Comment on attachment 319897 [details] Patch Attachment 319897 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/4454825 New failing tests: editing/selection/select-out-of-floated-non-editable-05.html editing/selection/select-out-of-floated-non-editable-10.html editing/selection/select-out-of-floated-non-editable-01.html fast/writing-mode/positionForPoint.html editing/selection/select-out-of-floated-non-editable-12.html editing/selection/select-out-of-floated-non-editable-04.html editing/selection/select-out-of-floated-non-editable-09.html fast/multicol/hit-test-above-or-below.html editing/selection/select-out-of-floated-non-editable-07.html editing/selection/select-out-of-floated-non-editable-06.html editing/selection/select-out-of-floated-non-editable-02.html editing/selection/select-out-of-floated-non-editable-08.html editing/selection/select-out-of-floated-non-editable-11.html editing/selection/select-out-of-floated-non-editable-03.html
Build Bot
Comment 9 2017-09-05 10:07:56 PDT
Created attachment 319912 [details] Archive of layout-test-results from ews126 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews126 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Javier Fernandez
Comment 10 2017-09-06 02:42:08 PDT
Javier Fernandez
Comment 11 2017-09-06 02:55:39 PDT
Build Bot
Comment 12 2017-09-06 03:51:55 PDT
Comment on attachment 319996 [details] Patch Attachment 319996 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/4461750 New failing tests: fast/multicol/hit-test-above-or-below.html editing/selection/select-out-of-floated-non-editable-07.html editing/selection/select-out-of-floated-non-editable-12.html editing/selection/click-in-margins-inside-editable-div.html editing/selection/select-out-of-floated-non-editable-09.html
Build Bot
Comment 13 2017-09-06 03:51:56 PDT
Created attachment 320002 [details] Archive of layout-test-results from ews104 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 14 2017-09-06 04:03:52 PDT
Comment on attachment 319996 [details] Patch Attachment 319996 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/4461893 New failing tests: editing/selection/select-out-of-floated-non-editable-12.html fast/events/drag-and-drop-link-into-focused-contenteditable.html editing/selection/select-out-of-floated-non-editable-09.html fast/multicol/hit-test-above-or-below.html editing/selection/select-out-of-floated-non-editable-07.html editing/selection/click-in-margins-inside-editable-div.html
Build Bot
Comment 15 2017-09-06 04:03:54 PDT
Created attachment 320003 [details] Archive of layout-test-results from ews101 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 16 2017-09-06 04:18:23 PDT
Comment on attachment 319996 [details] Patch Attachment 319996 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4461898 New failing tests: editing/selection/select-out-of-floated-non-editable-12.html fast/events/drag-and-drop-link-into-focused-contenteditable.html editing/selection/select-out-of-floated-non-editable-09.html fast/multicol/hit-test-above-or-below.html editing/selection/select-out-of-floated-non-editable-07.html editing/selection/click-in-margins-inside-editable-div.html
Build Bot
Comment 17 2017-09-06 04:18:24 PDT
Created attachment 320004 [details] Archive of layout-test-results from ews116 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Build Bot
Comment 18 2017-09-06 04:33:22 PDT
Comment on attachment 319996 [details] Patch Attachment 319996 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/4462000 New failing tests: editing/selection/select-out-of-floated-non-editable-05.html editing/selection/select-out-of-floated-non-editable-10.html editing/selection/select-out-of-floated-non-editable-01.html editing/selection/select-out-of-floated-non-editable-12.html editing/selection/select-out-of-floated-non-editable-04.html editing/selection/select-out-of-floated-non-editable-09.html fast/multicol/hit-test-above-or-below.html editing/selection/select-out-of-floated-non-editable-07.html editing/selection/select-out-of-floated-non-editable-06.html editing/selection/select-out-of-floated-non-editable-02.html editing/selection/select-out-of-floated-non-editable-08.html editing/selection/select-out-of-floated-non-editable-11.html editing/selection/select-out-of-floated-non-editable-03.html
Build Bot
Comment 19 2017-09-06 04:33:23 PDT
Created attachment 320007 [details] Archive of layout-test-results from ews121 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews121 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Javier Fernandez
Comment 20 2017-09-06 15:54:26 PDT
Build Bot
Comment 21 2017-09-06 17:34:13 PDT
Comment on attachment 320070 [details] Patch Attachment 320070 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/4468830 New failing tests: editing/selection/select-out-of-floated-non-editable-05.html editing/selection/select-out-of-floated-non-editable-10.html editing/selection/select-out-of-floated-non-editable-01.html editing/selection/select-out-of-floated-non-editable-12.html editing/selection/select-out-of-floated-non-editable-04.html editing/selection/select-out-of-floated-non-editable-09.html editing/selection/select-out-of-floated-non-editable-07.html editing/selection/select-out-of-floated-non-editable-06.html editing/selection/select-out-of-floated-non-editable-02.html editing/selection/select-out-of-floated-non-editable-08.html editing/selection/select-out-of-floated-non-editable-11.html editing/selection/select-out-of-floated-non-editable-03.html
Build Bot
Comment 22 2017-09-06 17:34:14 PDT
Created attachment 320082 [details] Archive of layout-test-results from ews124 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews124 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Dave Hyatt
Comment 23 2017-09-13 13:45:23 PDT
Comment on attachment 320070 [details] Patch r=me
Ryosuke Niwa
Comment 24 2017-09-13 14:02:08 PDT
Comment on attachment 320070 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320070&action=review > Source/WebCore/rendering/RenderBlock.cpp:2714 > + || (blocksAreFlipped && pointInLogicalContents.y() == childLogicalBottom))) { > return positionForPointRespectingEditingBoundaries(*this, *childBox, pointInContents); > + } Nit: This doesn't match our style guideline. PLEASE DON'T ADD curly braces.
Javier Fernandez
Comment 25 2017-09-18 00:43:06 PDT
Build Bot
Comment 26 2017-09-18 02:22:28 PDT
Comment on attachment 321081 [details] Patch Attachment 321081 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/4581447 New failing tests: editing/selection/select-out-of-floated-non-editable-05.html editing/selection/select-out-of-floated-non-editable-10.html editing/selection/select-out-of-floated-non-editable-01.html editing/selection/select-out-of-floated-non-editable-12.html editing/selection/select-out-of-floated-non-editable-04.html editing/selection/select-out-of-floated-non-editable-09.html editing/selection/select-out-of-floated-non-editable-07.html editing/selection/select-out-of-floated-non-editable-06.html editing/selection/select-out-of-floated-non-editable-02.html editing/selection/select-out-of-floated-non-editable-08.html editing/selection/select-out-of-floated-non-editable-11.html editing/selection/select-out-of-floated-non-editable-03.html
Build Bot
Comment 27 2017-09-18 02:22:29 PDT
Created attachment 321085 [details] Archive of layout-test-results from ews123 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews123 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.5
Javier Fernandez
Comment 28 2017-09-20 01:52:38 PDT
Could anybody give any hint about the reason of this io-simulator specific failures ? It looks like the eventSender based selection is not working at all in the simulator. Is that the case ?
Wenson Hsieh
Comment 29 2017-09-20 08:38:01 PDT
(In reply to Javier Fernandez from comment #28) > Could anybody give any hint about the reason of this io-simulator specific > failures ? It looks like the eventSender based selection is not working at > all in the simulator. Is that the case ? Unfortunately, the EventSender.mouseDown() and friends are empty stubs on iOS WebKit2 (see Tools/WebKitTestRunner/InjectedBundle/ios/EventSenderProxyIOS.mm); there are a few existing selection-related LayoutTests that use UIScriptController to synthesize text selection gestures instead, but those don't run in OpenSource. I think you'll need to mark these as [ Fail ] or [ Skip ] in LayoutTests/platform/ios-wk2/TestExpectations.
Simon Fraser (smfr)
Comment 30 2017-09-20 08:52:16 PDT
Right, EventSender does not simulate mouse events on iOS. You should probably skip the tests on iOS.
Wenson Hsieh
Comment 31 2017-09-20 08:53:41 PDT
(In reply to Wenson Hsieh from comment #29) > (In reply to Javier Fernandez from comment #28) > > Could anybody give any hint about the reason of this io-simulator specific > > failures ? It looks like the eventSender based selection is not working at > > all in the simulator. Is that the case ? > > Unfortunately, the EventSender.mouseDown() and friends are empty stubs on > iOS WebKit2 (see > Tools/WebKitTestRunner/InjectedBundle/ios/EventSenderProxyIOS.mm); there are > a few existing selection-related LayoutTests that use UIScriptController to > synthesize text selection gestures instead, but those don't run in > OpenSource. For some examples, see: editing/selection/character-granularity-rect.html, long-press-then-drag-down-to-change-selected-text.html. UIScriptController.longPressAtPoint() is supported in OpenSource and can be used to select text, but any tests that additionally depend on tap gestures (e.g. to begin editing text fields) are skipped.
Javier Fernandez
Comment 32 2017-09-21 02:34:45 PDT
Created attachment 321417 [details] Patch Skip tests on the iOS simulator
WebKit Commit Bot
Comment 33 2017-09-21 06:43:35 PDT
Comment on attachment 321417 [details] Patch Clearing flags on attachment: 321417 Committed r222317: <http://trac.webkit.org/changeset/222317>
WebKit Commit Bot
Comment 34 2017-09-21 06:43:37 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 35 2017-09-27 12:53:51 PDT
Jonathan Bedard
Comment 36 2018-01-19 09:15:28 PST
The iOS Simulator expectations committed in <https://trac.webkit.org/changeset/222317/webkit> should have been placed in the iOS expectations directory. Move them in <https://trac.webkit.org/changeset/227202/webkit>.
Note You need to log in before you can comment on or make changes to this bug.