Bug 145399 - Web Inspector: Highlighting a CSS section does not deselect previously highlighted CSS sections
Summary: Web Inspector: Highlighting a CSS section does not deselect previously highli...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Minor
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-05-26 18:31 PDT by Devin Rousso
Modified: 2015-06-05 18:16 PDT (History)
9 users (show)

See Also:


Attachments
Patch (5.64 KB, patch)
2015-06-02 14:14 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (5.96 KB, patch)
2015-06-05 15:16 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2015-05-26 18:31:58 PDT
In Elements > Styles > Rules, it is possible to highlight one section (such as the CSS applied to the "body") and then highlight another section (such as a specific div element) without de-highlighting the first section.  In a section with highlighted content, the only way to de-highlight that content is to click again within that section.  Clicking outside that section will not effect the highlighted content in any way.  It should instead be that clicking outside of one section will de-highlight all content in any other content so that only one piece of content is highlighted/selected at any given time.
Comment 1 Radar WebKit Bug Importer 2015-05-26 18:32:38 PDT
<rdar://problem/21116228>
Comment 2 Devin Rousso 2015-06-02 14:14:30 PDT
Created attachment 254102 [details]
Patch
Comment 3 Timothy Hatcher 2015-06-05 11:16:59 PDT
Comment on attachment 254102 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js:287
> +        this._delegate.editorFocused(this);

This should check for existence of the auction before calling it. This would also be "cssStyleDeclarationSectionEditorFocused".

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

Delegate methods should be prefixed with the class name, so they can't conflict with others or built-in methods. So this should be "cssStyleDeclarationTextEditorFocused" to match the other delegate methods on this class.

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:330
> +        if (typeof this._delegate.editorFocused === "function")
> +            this._delegate.editorFocused();

Ditto.

> Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js:260
> +    editorFocused(ignoredSection)

This would be cssStyleDeclarationSectionEditorFocused.
Comment 4 Devin Rousso 2015-06-05 15:16:35 PDT
Created attachment 254391 [details]
Patch
Comment 5 WebKit Commit Bot 2015-06-05 18:16:51 PDT
Comment on attachment 254391 [details]
Patch

Clearing flags on attachment: 254391

Committed r185279: <http://trac.webkit.org/changeset/185279>
Comment 6 WebKit Commit Bot 2015-06-05 18:16:55 PDT
All reviewed patches have been landed.  Closing bug.