Bug 117600 - Web Inspector: New Rule button doesn't reveal the newly added rule if not visible upon creation
Summary: Web Inspector: New Rule button doesn't reveal the newly added rule if not vis...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-06-13 10:05 PDT by Antoine Quint
Modified: 2015-06-18 10:59 PDT (History)
6 users (show)

See Also:


Attachments
Patch (3.92 KB, patch)
2015-06-12 15:58 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 Antoine Quint 2013-06-13 10:05:15 PDT
If you have the Styles sidebar scrolled such that the New Rule button is at the top of the bar, adding a new rule may not scroll to reveal the newly added rule further up in the sidebar.
Comment 1 Radar WebKit Bug Importer 2013-06-13 10:05:44 PDT
<rdar://problem/14143547>
Comment 2 Timothy Hatcher 2014-01-10 15:37:19 PST
Moving to the right component.
Comment 3 Devin Rousso 2015-06-04 14:15:00 PDT
Is this still an issue?  Every time I add a new rule I always see the newly added rule appear right below the "New Rule" button.  Could you possibly elaborate more as to what the specific issue is?  Thanks.
Comment 4 Devin Rousso 2015-06-12 15:58:49 PDT
Created attachment 254832 [details]
Patch
Comment 5 Timothy Hatcher 2015-06-13 00:56:12 PDT
Comment on attachment 254832 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js:305
> +        if (this._previousFocusedSection && this._visible) {

What if the previous focused section is no longer in the sidebar after a refresh? Can that happen?
Comment 6 Devin Rousso 2015-06-15 11:44:43 PDT
Comment on attachment 254832 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Views/RulesStyleDetailsPanel.js:305
>> +        if (this._previousFocusedSection && this._visible) {
> 
> What if the previous focused section is no longer in the sidebar after a refresh? Can that happen?

From what I can see, no it is not.  nodeStylesRefreshed is called whenever the node changes and refresh is called before nodeStylesRefreshed.  previousFocusedSection is set (unless there was no previously focused section) by refresh and then used (if set) immediately after in nodeStylesRefreshed.  Once used, it is set back to null so it can't be reused until another refresh.
Comment 7 WebKit Commit Bot 2015-06-18 10:59:29 PDT
Comment on attachment 254832 [details]
Patch

Clearing flags on attachment: 254832

Committed r185709: <http://trac.webkit.org/changeset/185709>
Comment 8 WebKit Commit Bot 2015-06-18 10:59:33 PDT
All reviewed patches have been landed.  Closing bug.