Bug 180791

Summary: Web Inspector: Styles Redesign: clicking CSS property or selector should always select its text
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nikita Vasilyev <nvasilyev>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, hi, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[Animated GIF] Bug
none
Patch none

Description Nikita Vasilyev 2017-12-13 18:29:03 PST
Created attachment 329304 [details]
[Animated GIF] Bug

Clicking on CSS selector, property name or value sometimes selects the text and sometimes just places text caret where it was clicked. It should always select the text.
Comment 1 Radar WebKit Bug Importer 2017-12-13 18:29:15 PST
<rdar://problem/36038366>
Comment 2 Nikita Vasilyev 2018-01-06 16:06:33 PST
Currently, the editing starts on mousedown. This matches the behavior of a textarea element, contentEditable, etc.

In Chrome DevTools and Firefox DevTools, editing starts on mouseup. This makes copying several CSS properties easier: clicking on a CSS property doesn't immediately start editing. Clicking on a property name and dragging the cursor down can select text of several properties.

Perhaps starting editing on mouseup is the desirable behavior for most cases, and we should do this, too.
Comment 3 Devin Rousso 2019-02-21 14:30:01 PST
Created attachment 362649 [details]
Patch
Comment 4 Nikita Vasilyev 2019-02-21 15:31:41 PST
I've been working[1] towards using SpreadsheetTextField for CSS selectors and getting rid of SpreadsheetSelectorField entirely.

You're welcome to write a patch to use SpreadsheetTextField for CSS selectors. I'd be happy to review it.

1: Bug 194724 - Web Inspector: Move CSS completion logic from SpreadsheetTextField to SpreadsheetStyleProperty
Comment 5 BJ Burg 2019-02-22 14:49:19 PST
Comment on attachment 362649 [details]
Patch

r=me
Comment 6 WebKit Commit Bot 2019-02-22 20:08:04 PST
Comment on attachment 362649 [details]
Patch

Clearing flags on attachment: 362649

Committed r241980: <https://trac.webkit.org/changeset/241980>
Comment 7 WebKit Commit Bot 2019-02-22 20:08:05 PST
All reviewed patches have been landed.  Closing bug.