|
|
DescriptionAccept text input only if selection has focus.
At Editor::HandleEditingKeyboardEvent(), use
FrameSelection::SelectionHasFocus() to check editability.
BUG=713051
Review-Url: https://codereview.chromium.org/2889763003
Cr-Commit-Position: refs/heads/master@{#473163}
Committed: https://chromium.googlesource.com/chromium/src/+/8e46baf867a845e459199e2aefa358ee1e26a559
Patch Set 1 #Patch Set 2 : update #
Total comments: 19
Patch Set 3 : update #
Total comments: 6
Patch Set 4 : update #
Total comments: 2
Patch Set 5 : nit #
Messages
Total messages: 44 (28 generated)
The CQ bit was checked by yoichio@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Click on user-select:none clears selection BUG=713051 ========== to ========== Click on user-select:none clears selection at SelectionController::HandleSingleClick() UpdateSelectionForMouseDownDispatchingSelectStart(<null selection>) doesn't clear selection if |event.InnerNode()| is not selectable. However if no VisiblePosition in the |event.InnerNode()|, anyway we should clear selection. BUG=713051 ==========
yoichio@chromium.org changed reviewers: + yosin@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
yosin@chromium.org changed reviewers: + xiaochengh@chromium.org
+xiaochengh@ for second eye. https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html (right): https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:9: var outer_isClicked = false; nit: %s/outer_isClicked/outerIsClicked/ https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:13: assert_true(outer_isClicked, 'outer div is clicked'); Please add assert_exists(window, 'eventSender', 'This test requires eventSender.'); https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:16: assert_equals(input.value, "foo", ''); nit: s/"/'/ https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:23: [{source: "mouse", nit: s/"/'/ https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:25: { name: "pointerDown", x: 20, y: 20, button:'left' }, nit: s/"/'/ https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:26: { name: "pointerUp", button:'left' },]}]; nit: s/"/'/
https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html (right): https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:1: <script src="../../../resources/testharness.js"></script> nit: Please add <!doctype html> https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:27: chrome.gpuBenchmarking.pointerActionSequence(pointerActions, step2); nit: Please add check for |chrome| and |chrome.gpuBenchmarking|. See http://crrev.com/2891693002 to use |chrome.gpuBenchmarking| with |Promise|.
- Summary and description are unclear. - Please find out the place we should check FS::SelectionHasFocus() to identify where unfocus selection affected, before introducing new behavior about user-select:none. Summary and description could be: Clear selection when clicking at user-select::none This patch blah... https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/SelectionController.cpp (right): https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/SelectionController.cpp:238: Selection().SetSelection(SelectionInFlatTree()); Do other browser clear selection at clicking user-select:none?
https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html (right): https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:25: { name: "pointerDown", x: 20, y: 20, button:'left' }, On 2017/05/17 at 10:15:39, yosin_UTC9 wrote: > nit: s/"/'/ nit: For readability, please add a comment that this is a mouse click in the padding of |outer|.
The CQ bit was checked by yoichio@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #3 (id:40001) has been deleted
The CQ bit was checked by yoichio@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Click on user-select:none clears selection at SelectionController::HandleSingleClick() UpdateSelectionForMouseDownDispatchingSelectStart(<null selection>) doesn't clear selection if |event.InnerNode()| is not selectable. However if no VisiblePosition in the |event.InnerNode()|, anyway we should clear selection. BUG=713051 ========== to ========== Clear selection when clicking on user-select:none while input is focused. UpdateSelectionForMouseDownDispatchingSelectStart(<null selection>) doesn't clear selection if |event.InnerNode()| is not selectable. However if no VisiblePosition in the |event.InnerNode()|, anyway we should clear selection. BUG=713051 ==========
The CQ bit was checked by yoichio@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
Patchset #3 (id:60001) has been deleted
Description was changed from ========== Clear selection when clicking on user-select:none while input is focused. UpdateSelectionForMouseDownDispatchingSelectStart(<null selection>) doesn't clear selection if |event.InnerNode()| is not selectable. However if no VisiblePosition in the |event.InnerNode()|, anyway we should clear selection. BUG=713051 ========== to ========== Accept text input only if selection has focus. At Editor::HandleEditingKeyboardEvent(), use FrameSelection::SelectionHasFocus() to check editability. BUG=713051 ==========
Change implement all. PTAL. https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html (right): https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:1: <script src="../../../resources/testharness.js"></script> On 2017/05/17 10:17:58, yosin_UTC9 wrote: > nit: Please add <!doctype html> Done. https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:9: var outer_isClicked = false; On 2017/05/17 10:15:39, yosin_UTC9 wrote: > nit: %s/outer_isClicked/outerIsClicked/ Acknowledged. https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:13: assert_true(outer_isClicked, 'outer div is clicked'); On 2017/05/17 10:15:39, yosin_UTC9 wrote: > Please add > > assert_exists(window, 'eventSender', 'This test requires eventSender.'); Done. https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:16: assert_equals(input.value, "foo", ''); On 2017/05/17 10:15:39, yosin_UTC9 wrote: > nit: s/"/'/ Done. https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:23: [{source: "mouse", On 2017/05/17 10:15:39, yosin_UTC9 wrote: > nit: s/"/'/ Done. https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:25: { name: "pointerDown", x: 20, y: 20, button:'left' }, On 2017/05/17 19:29:25, Xiaocheng wrote: > On 2017/05/17 at 10:15:39, yosin_UTC9 wrote: > > nit: s/"/'/ > > nit: For readability, please add a comment that this is a mouse click in the > padding of |outer|. Done. https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:25: { name: "pointerDown", x: 20, y: 20, button:'left' }, On 2017/05/17 10:15:39, yosin_UTC9 wrote: > nit: s/"/'/ Done. https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:26: { name: "pointerUp", button:'left' },]}]; On 2017/05/17 10:15:39, yosin_UTC9 wrote: > nit: s/"/'/ Done. https://codereview.chromium.org/2889763003/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:27: chrome.gpuBenchmarking.pointerActionSequence(pointerActions, step2); On 2017/05/17 10:17:58, yosin_UTC9 wrote: > nit: Please add check for |chrome| and |chrome.gpuBenchmarking|. > > See http://crrev.com/2891693002 to use |chrome.gpuBenchmarking| with |Promise|. Done.
https://codereview.chromium.org/2889763003/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html (right): https://codereview.chromium.org/2889763003/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:24: chrome.gpuBenchmarking.pointerActionSequence(pointerActions, resolve); I think |input.blur()| is enough. https://codereview.chromium.org/2889763003/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:26: console.log("end"); nit: We don't need to have |console.log()|.
https://codereview.chromium.org/2889763003/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html (right): https://codereview.chromium.org/2889763003/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:24: chrome.gpuBenchmarking.pointerActionSequence(pointerActions, resolve); On 2017/05/18 10:00:14, yosin_UTC9 wrote: > I think |input.blur()| is enough. No, we need focus on |user-select:none, tabindex=-1| element, which is parent of input element, with click. https://codereview.chromium.org/2889763003/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:26: console.log("end"); On 2017/05/18 10:00:14, yosin_UTC9 wrote: > nit: We don't need to have |console.log()|. Done.
https://codereview.chromium.org/2889763003/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html (right): https://codereview.chromium.org/2889763003/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:24: chrome.gpuBenchmarking.pointerActionSequence(pointerActions, resolve); On 2017/05/19 at 01:51:23, yoichio wrote: > On 2017/05/18 10:00:14, yosin_UTC9 wrote: > > I think |input.blur()| is enough. > No, we need focus on |user-select:none, tabindex=-1| element, > which is parent of input element, with click. How about move to focus to |user-select:none, tabindex=-1| element, e.g. |outer.focus()|. It is better to avoid to use testRunner specific object. See bug[1], it provides simpler reproduce case, e.g. <div id="container" tabindex="-1"> <div contenteditable></div> </div> Move focus from cE to container[2] [1] http://crbug.com/723671 Caret stays visible inside contentEditable when other element is focused [2] Sample in 723671: view-source:https://output.jsbin.com/roposes/2
Patchset #4 (id:100001) has been deleted
https://codereview.chromium.org/2889763003/diff/80001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html (right): https://codereview.chromium.org/2889763003/diff/80001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/selection/mouse/click-user-select-none-loose-input-focus.html:24: chrome.gpuBenchmarking.pointerActionSequence(pointerActions, resolve); On 2017/05/19 02:06:40, yosin_UTC9 wrote: > On 2017/05/19 at 01:51:23, yoichio wrote: > > On 2017/05/18 10:00:14, yosin_UTC9 wrote: > > > I think |input.blur()| is enough. > > No, we need focus on |user-select:none, tabindex=-1| element, > > which is parent of input element, with click. > > How about move to focus to |user-select:none, tabindex=-1| element, e.g. > |outer.focus()|. > It is better to avoid to use testRunner specific object. > > See bug[1], it provides simpler reproduce case, e.g. > > <div id="container" tabindex="-1"> > <div contenteditable></div> > </div> > > Move focus from cE to container[2] > > > > [1] http://crbug.com/723671 Caret stays visible inside contentEditable when > other element is focused > [2] Sample in 723671: view-source:https://output.jsbin.com/roposes/2 > > Done.
The CQ bit was checked by yoichio@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm w/ nit https://codereview.chromium.org/2889763003/diff/120001/third_party/WebKit/Lay... File third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html (right): https://codereview.chromium.org/2889763003/diff/120001/third_party/WebKit/Lay... third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html:9: if (window.eventSender === undefined) nit: we found new way. assert_not_exists(window, 'eventSender', 'this test requires window.eventSender');
The CQ bit was checked by yoichio@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from yosin@chromium.org Link to the patchset: https://codereview.chromium.org/2889763003/#ps140001 (title: "nit")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2889763003/diff/120001/third_party/WebKit/Lay... File third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html (right): https://codereview.chromium.org/2889763003/diff/120001/third_party/WebKit/Lay... third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html:9: if (window.eventSender === undefined) On 2017/05/19 05:50:33, yosin_UTC9 wrote: > nit: we found new way. > > assert_not_exists(window, 'eventSender', 'this test requires > window.eventSender'); Done.
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by yosin@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 140001, "attempt_start_ts": 1495189151463410, "parent_rev": "1e41ff6a3d29ebd4fb42b3540464a723ae3cbef9", "commit_rev": "8e46baf867a845e459199e2aefa358ee1e26a559"}
Message was sent while issue was closed.
Description was changed from ========== Accept text input only if selection has focus. At Editor::HandleEditingKeyboardEvent(), use FrameSelection::SelectionHasFocus() to check editability. BUG=713051 ========== to ========== Accept text input only if selection has focus. At Editor::HandleEditingKeyboardEvent(), use FrameSelection::SelectionHasFocus() to check editability. BUG=713051 Review-Url: https://codereview.chromium.org/2889763003 Cr-Commit-Position: refs/heads/master@{#473163} Committed: https://chromium.googlesource.com/chromium/src/+/8e46baf867a845e459199e2aefa3... ==========
Message was sent while issue was closed.
Committed patchset #5 (id:140001) as https://chromium.googlesource.com/chromium/src/+/8e46baf867a845e459199e2aefa3... |