Bug 190114

Summary: Web Inspector: Styles: start editing property name/value on mouseup instead of mousedown
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, inspector-bugzilla-changes, mattbaker, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 190053    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
[Animated GIF] With patch applied none

Description Nikita Vasilyev 2018-09-29 20:00:07 PDT
To enable multi-property selection, I suggest entering editing mode for property names and values on mouseup:

Example:

    color: black;
    font-size: 14px;

1. mousedown on "color"
2. Move the mouse cursor to "font-size"
3. mouseup on "font-size" (or anywhere on the second line)

Expected:
Both properties are selected.

---

This is NOT the matter of replacing "mousedown" to "mouseup" somewhere in the code. This is far more complex.

SpreadsheetTextField, which is used by property names and values, enters editing mode on focus. Since name & value fields have tabIndex=0,
mousedown on them triggers the focus event. Focusing on an element via the keyboard (e.g. by pressing Tab key) triggers the focus event as well - great,
we have the same code path for keyboard and mouse navigation! It's VoiceOver-friendly, too!

It was all great until now. Focus change always happens on mousedown, which means I can no longer rely on it for mouse navigation.
Comment 1 Radar WebKit Bug Importer 2018-09-29 20:33:26 PDT
<rdar://problem/44891030>
Comment 2 Nikita Vasilyev 2018-10-02 11:53:48 PDT
Created attachment 351425 [details]
Patch
Comment 3 Nikita Vasilyev 2018-10-02 12:00:25 PDT
(In reply to Nikita Vasilyev from comment #0)
> SpreadsheetTextField, which is used by property names and values, enters
> editing mode on focus. Since name & value fields have tabIndex=0,
> mousedown on them triggers the focus event. Focusing on an element via the
> keyboard (e.g. by pressing Tab key) triggers the focus event as well - great,
> we have the same code path for keyboard and mouse navigation! It's
> VoiceOver-friendly, too!
> 
> It was all great until now. Focus change always happens on mousedown, which
> means I can no longer rely on it for mouse navigation.

The current version of the style editor doesn't rely on tabIndex for keyboard navigation between property names and values - it's already a separate code path.
Comment 4 Nikita Vasilyev 2018-10-02 12:02:38 PDT
Created attachment 351427 [details]
[Animated GIF] With patch applied
Comment 5 Matt Baker 2018-10-02 17:04:46 PDT
Comment on attachment 351425 [details]
Patch

r=me
Comment 6 WebKit Commit Bot 2018-10-02 17:29:49 PDT
Comment on attachment 351425 [details]
Patch

Clearing flags on attachment: 351425

Committed r236780: <https://trac.webkit.org/changeset/236780>
Comment 7 WebKit Commit Bot 2018-10-02 17:29:51 PDT
All reviewed patches have been landed.  Closing bug.