FOCUS: Blink should neither accept key stroke nor blink caret when selection doesn't have focus
Reported by
sans...@etouch.net,
Apr 19 2017
|
|||||||||||
Issue descriptionChrome Version : 60.0.3074.0 (Official Build) 147bd1eedea8ce66f162faa43535d60137817d91-refs/heads/master@{#465085} 32/64 bit OS : Windows (7,8,10), Mac (10.11.6, 10.12.1, 10.12), Linux (14.04 LTS) Steps: 1. Launch Chrome and open devtools on NTP 2. Press F1 key to open devtools settings or open via 'Customize and control Devtools' 3. Click on 'Workspace', then click on 'Folder exclude pattern' text-box and clear the text 4. Now click anywhere below 'Add folder' button and observe Actual: Cursor does not disappear from 'Folder exclude pattern' text-box after clicking below 'Add folder' button Expected: Cursor should disappear from 'Folder exclude pattern' text-box after clicking below 'Add folder' button This is a regression issue broken in ‘M-60’, will soon update the bisect info. Good build : 59.0.3071.0 Bad build : 60.0.3072.0
,
Apr 20 2017
Clicking next to the <button> sets an invisible caret. But below the <button>, there's no text node to hold a caret so the selection stays inside the <input>. However, the "hide path" *is* taken ... UpdateAppearance(LayoutSelection::PaintHint::kHide) LayoutSelection::Commit() LayoutSelection::ClearSelection() LayoutSelection::SetSelection() Oops! Leaves the cursor blinking because: // Just return if the selection hasn't changed. To hide the cursor, we cannot return early here. I see another bug; even if we hide the cursor, the <input> still receives keystrokes. It shouldn't because it doesn't have focus. Right, @yosin ?
,
Apr 20 2017
I think this is the minimal test case: <!-- This div can take mouse focus but not tab focus! --> <div style="background: orange; padding: 20%; user-select: none" tabindex="-1"> <input value="click on orange" autofocus> </div> Isn't it weird that a tabindex="-1" disallows tab to focus an area but makes it a focusable area [1] for mouse clicks? :) If I remove the tabindex attributes from that devtools page, the bug does not reproduce. Why does devtools use tabindex on <div>s anyway? Just to make them focusable? And why make the <div>s focusable? :) Just curious. Anyway, of course we should not break such pages. [1] https://html.spec.whatwg.org/multipage/interaction.html#data-model
,
Apr 20 2017
Lower to Pri-3 and remove ReleaseBlock-Stable, because
- Use still enter text and adding folder
- The root cause is introduced on July 2016, but no one complain until this issue.
#c2 >I see another bug; even if we hide the cursor, the <input> still receives keystrokes. It shouldn't because it doesn't have focus. Right, @yosin ?
Yes, keystroke should go focused element.
Here is root cause:
- FrameCaret::shouldBlinkCaret() returns true if
focusedElement->isShadowIncludingInclusiveAncestorOf(caretPosition().position().anchorNode());
Introduced by patch[1] on July 20, 2016
- Editor::HandleEditingKeyboardEvent() executes typing command if
focused_element->ContainsIncludingHostElements(
*frame_->Selection()
.ComputeVisibleSelectionInDOMTreeDeprecated()
.Start()
.ComputeContainerNode()))
Introduced by patch[2] on January 13, 2017
In case of #c3, orange background DIV enclosing INPUT has focus, so we show caret and
executes typing command.
When we change INPUT to DIV w/ contenteditable, we can reproduce on M57
<div style="background: orange; padding: 20%; user-select: none" tabindex="-1">
<div contenteditable>click on orange</div>
</div>
Hence, the patch[3] exposes the root cause for INPUT element and isn't the root cause.
To fix this issue, we should stop traversing ancestor tree after root editable element.
[1] http://crrev.com/2161373002: Make FrameCaret to retrieve caret position from SelectionEditor
[2] http://crrev.com/2628763003: Keyboard event should not insert a character at selection if selection doesn't have focus
[3] http://crrev.com/2616623002: Do not send redundant selectionchange-events
,
Apr 21 2017
Issue 713644 has been merged into this issue.
,
Apr 27 2017
,
May 4 2017
,
May 5 2017
,
May 5 2017
,
May 5 2017
This seems to be the root cause of many regressions so I'm raising to Pri-1 again.
,
May 10 2017
,
May 11 2017
,
May 16 2017
,
May 16 2017
,
May 19 2017
Issue 723671 has been merged into this issue.
,
May 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f56b768202fbf0ea253e350a43259781e453c48d commit f56b768202fbf0ea253e350a43259781e453c48d Author: yoichio <yoichio@chromium.org> Date: Fri May 19 10:48:41 2017 Blink caret only if selection has focus. Use Selection().SelectionHasFocus() in FrameCaret::ShouldBlinkCaret(); BUG= 713051 Review-Url: https://codereview.chromium.org/2887303002 Cr-Commit-Position: refs/heads/master@{#473153} [modify] https://crrev.com/f56b768202fbf0ea253e350a43259781e453c48d/third_party/WebKit/Source/core/editing/FrameCaret.cpp [modify] https://crrev.com/f56b768202fbf0ea253e350a43259781e453c48d/third_party/WebKit/Source/core/editing/FrameCaret.h [modify] https://crrev.com/f56b768202fbf0ea253e350a43259781e453c48d/third_party/WebKit/Source/core/editing/FrameCaretTest.cpp
,
May 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8e46baf867a845e459199e2aefa358ee1e26a559 commit 8e46baf867a845e459199e2aefa358ee1e26a559 Author: yoichio <yoichio@chromium.org> Date: Fri May 19 12:01:58 2017 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} [add] https://crrev.com/8e46baf867a845e459199e2aefa358ee1e26a559/third_party/WebKit/LayoutTests/editing/inserting/insert-on-unfocused-element.html [modify] https://crrev.com/8e46baf867a845e459199e2aefa358ee1e26a559/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp
,
May 22 2017
,
May 23 2017
Tested the issue using Chrome Dev# 60.0.3107.4 on Windows, Mac and Linux and found the issue to be Fixed. Hence adding TE-Verified labels. Adding screen cast for further reference. Thank You. |
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by hdodda@chromium.org
, Apr 19 2017Labels: hasbisect-per-revision ReleaseBlock-Stable
Owner: yosin@chromium.org
Status: Assigned (was: Unconfirmed)