RESOLVED FIXED 186792
Restrict Selection in contenteditable to the extent of that contenteditable
https://bugs.webkit.org/show_bug.cgi?id=186792
Summary Restrict Selection in contenteditable to the extent of that contenteditable
Megan Gardner
Reported 2018-06-18 17:40:42 PDT
Restrict Selection in contenteditable the extent of that contenteditable
Attachments
Patch (4.31 KB, patch)
2018-06-18 17:43 PDT, Megan Gardner
no flags
Archive of layout-test-results from ews206 for win-future (12.76 MB, application/zip)
2018-06-19 03:00 PDT, EWS Watchlist
no flags
Patch (4.85 KB, patch)
2018-06-19 10:40 PDT, Megan Gardner
no flags
Archive of layout-test-results from ews106 for mac-sierra-wk2 (2.97 MB, application/zip)
2018-06-19 11:53 PDT, EWS Watchlist
no flags
Patch (5.03 KB, patch)
2018-06-19 15:07 PDT, Megan Gardner
no flags
Megan Gardner
Comment 1 2018-06-18 17:43:57 PDT
EWS Watchlist
Comment 2 2018-06-19 02:59:55 PDT
Comment on attachment 342996 [details] Patch Attachment 342996 [details] did not pass win-ews (win): Output: http://webkit-queues.webkit.org/results/8244791 New failing tests: http/tests/security/canvas-remote-read-remote-video-localhost.html http/tests/preload/onload_event.html
EWS Watchlist
Comment 3 2018-06-19 03:00:06 PDT
Created attachment 343038 [details] Archive of layout-test-results from ews206 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews206 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Megan Gardner
Comment 4 2018-06-19 10:40:10 PDT
EWS Watchlist
Comment 5 2018-06-19 11:53:11 PDT
Comment on attachment 343065 [details] Patch Attachment 343065 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/8249991 New failing tests: accessibility/mac/selection-notification-focus-change.html
EWS Watchlist
Comment 6 2018-06-19 11:53:12 PDT
Created attachment 343071 [details] Archive of layout-test-results from ews106 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Wenson Hsieh
Comment 7 2018-06-19 14:21:44 PDT
Comment on attachment 343065 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343065&action=review This looks reasonable to me. Can we write a test for this? > Source/WebKit/ChangeLog:9 > + a single content editable on iOS. There is functionality to esure this on mac, so it has been Nit - esure > Source/WebKit/ChangeLog:10 > + exposed and utalized for restricting the extent of a selection. Nit - utalized > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:1339 > + VisiblePosition targetPosition = m_page->mainFrame().eventHandler().selectionExtentRespectingEditingBoundary(frame.selection().selection(), result.localPoint(), result.targetNode()); Nit - I don't think this local variable adds much. Also, I don't think we're guaranteed to find a target node when hit-testing, yet selectionExtentRespectingEditingBoundary requires a non-null targetNode. We should probably just make selectionExtentRespectingEditingBoundary take a Node& and add a null check here.
Megan Gardner
Comment 8 2018-06-19 15:05:23 PDT
Comment on attachment 343065 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343065&action=review As I said in the WebCore log, my system currently won't allow me to run any tests, but I will write one as soon as I can update. >> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:1339 >> + VisiblePosition targetPosition = m_page->mainFrame().eventHandler().selectionExtentRespectingEditingBoundary(frame.selection().selection(), result.localPoint(), result.targetNode()); > > Nit - I don't think this local variable adds much. > > Also, I don't think we're guaranteed to find a target node when hit-testing, yet selectionExtentRespectingEditingBoundary requires a non-null targetNode. We should probably just make selectionExtentRespectingEditingBoundary take a Node& and add a null check here. There's too much in selectionExtentRespectingEditingBoundary that relies on taking a Node*, but I will add null checks both here and in the function.
Megan Gardner
Comment 9 2018-06-19 15:07:33 PDT
Megan Gardner
Comment 10 2018-06-20 09:56:01 PDT
WebKit Commit Bot
Comment 11 2018-06-20 10:23:03 PDT
Comment on attachment 343107 [details] Patch Clearing flags on attachment: 343107 Committed r233016: <https://trac.webkit.org/changeset/233016>
WebKit Commit Bot
Comment 12 2018-06-20 10:23:05 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.