Bug 154404

Summary: Web Inspector: Styles Sidebar focus jumps when trying to edit a color
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: Web InspectorAssignee: Devin Rousso <hi>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, graouts, hi, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Video of the Bug
none
Patch none

Description Timothy Hatcher 2016-02-18 12:19:14 PST
Created attachment 271680 [details]
Video of the Bug

Steps:
1) Inspect the Inspector
2) Click on a Rule near the top of the sidebar to give it keyboard focus
3) Scroll down to the variables section
4) Click to edit a color

Results: The fist click on the swatch fails sometimes with a small scroll jump. Subsequent clicks work, but when the color changes in the popover the sidebar jumps to the previous focus rule, closing the popover.
Expected: No scrolling and the color popover should stay open.

See attached video.
Comment 1 Radar WebKit Bug Importer 2016-02-18 12:20:25 PST
<rdar://problem/24725744>
Comment 2 Timothy Hatcher 2016-02-18 12:39:57 PST
I had a heck of a time recording the video for this Tweet because of this bug. https://twitter.com/webkit/status/700412341368844288
Comment 3 Devin Rousso 2016-02-18 20:27:44 PST
Created attachment 271725 [details]
Patch
Comment 4 Devin Rousso 2016-02-18 20:29:40 PST
Comment on attachment 271725 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=271725&action=review

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:1308
> +        if (this._delegate && typeof this._delegate.cssStyleDeclarationTextEditorBlurActiveEditor === "function")

So I'm not really sure that "cssStyleDeclarationTextEditorBlurActiveEditor" is the right name for this function as it really only drops the previously saved section, but "cssStyleDeclarationTextEditorClearActiveSection" or "cssStyleDeclarationTextEditorForgetPreviouslyActiveSection" sound a bit unwieldy and ridiculous.
Comment 5 WebKit Commit Bot 2016-02-18 21:26:50 PST
Comment on attachment 271725 [details]
Patch

Clearing flags on attachment: 271725

Committed r196798: <http://trac.webkit.org/changeset/196798>
Comment 6 WebKit Commit Bot 2016-02-18 21:26:53 PST
All reviewed patches have been landed.  Closing bug.