Bug 168709 - Web Inspector: Don't show the Search tab if it's open and matches the representedObject
Summary: Web Inspector: Don't show the Search tab if it's open and matches the represe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords:
Depends on:
Blocks: 171259
  Show dependency treegraph
 
Reported: 2017-02-21 22:04 PST by Devin Rousso
Modified: 2017-04-24 20:08 PDT (History)
5 users (show)

See Also:


Attachments
Patch (54.07 KB, patch)
2017-02-21 22:13 PST, Devin Rousso
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-elcapitan (847.33 KB, application/zip)
2017-02-22 03:14 PST, Build Bot
no flags Details
Patch (56.42 KB, patch)
2017-04-04 22:40 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 2017-02-21 22:04:40 PST
If the Search tab is currently open and was the previously selected tab, clicking on a `showRepresentedObject` link/button/contextmenu will display the contentView within the Search tab instead of the Resources/Elements tab.
Comment 1 Devin Rousso 2017-02-21 22:13:19 PST
Created attachment 302369 [details]
Patch
Comment 2 Build Bot 2017-02-22 03:14:09 PST
Comment on attachment 302369 [details]
Patch

Attachment 302369 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/3171715

New failing tests:
editing/spelling/spellcheck-async.html
Comment 3 Build Bot 2017-02-22 03:14:12 PST
Created attachment 302382 [details]
Archive of layout-test-results from ews100 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 4 BJ Burg 2017-03-30 10:01:22 PDT
Comment on attachment 302369 [details]
Patch

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

Let's see one more iteration on this patch. I think we can make the options less distracting with my suggestions.

> Source/WebInspectorUI/UserInterface/Base/Main.js:813
> +    this.openURL(anchorElement.href, frame, Object.shallowMerge(options, {

I don't think this needs to be line wrapped. There is only one property.

> Source/WebInspectorUI/UserInterface/Base/Main.js:851
> +            positionToReveal,

Ditto.

> Source/WebInspectorUI/UserInterface/Base/Main.js:1406
> +        this.showSourceCodeForFrame(frame.id, {

I prefer using `let options = { ... }` rather than line wrapping function calls. I'd prefer we only wrap function call sites when passing a callback/completion handler.

> Source/WebInspectorUI/UserInterface/Base/Main.js:-2321
> -        anchor.lineNumber = lineNumber;

Line and column numbers do not appear to be optional so they should be a positional argument. BTW, we should use WebInspector.SourceCodePosition in place of line+col.

> Source/WebInspectorUI/UserInterface/Base/Main.js:2337
> +        dontFloat: true,

No line wrap.

> Source/WebInspectorUI/UserInterface/Controllers/BreakpointPopoverController.js:70
> +            WebInspector.showOriginalOrFormattedSourceCodeLocation(breakpoint.sourceCodeLocation, {

I would not wrap, or use a local.

> Source/WebInspectorUI/UserInterface/Protocol/InspectorFrontendAPI.js:113
> +            ignoreNetworkTab: true,

Ditto.

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js:252
> +                    ignoreNetworkTab: true,

Ditto.

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:1675
> +                ignoreNetworkTab: true,

Ditto.

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:1687
> +                ignoreNetworkTab: true,

Ditto.

> Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.js:707
> +            columnNumber,

use WebInspector.SourceCodePosition

> Source/WebInspectorUI/UserInterface/Views/ErrorObjectView.js:62
> +            columnNunber: parseInt(columnNumber),

Typo: columnNunber

use WebInspector.SourceCodePosition instead.

> Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:318
> +                        ignoreNetworkTab: true,

Are there any cases where we don't pass ignoreNetworkTab? Perhaps it would be easier to negate the option to be allowsNetworkTab or usesNetworkTab. This would draw more attention to the exceptional cases, which are currently hard to see.
Comment 5 Devin Rousso 2017-04-04 22:39:02 PDT
Comment on attachment 302369 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:318
>> +                        ignoreNetworkTab: true,
> 
> Are there any cases where we don't pass ignoreNetworkTab? Perhaps it would be easier to negate the option to be allowsNetworkTab or usesNetworkTab. This would draw more attention to the exceptional cases, which are currently hard to see.

There are some cases, mainly in sidebar/CodeMirror code that is used by the Network tab.  I usually prefer a blacklist approach over whitelisting, but if you would prefer I can change this (both ignoreNetworkTab and ignoreSearchTab) to be "allow*Tab".
Comment 6 Devin Rousso 2017-04-04 22:40:15 PDT
Created attachment 306255 [details]
Patch
Comment 7 BJ Burg 2017-04-21 10:32:50 PDT
Comment on attachment 306255 [details]
Patch

r=me!
Comment 8 WebKit Commit Bot 2017-04-21 13:05:35 PDT
Comment on attachment 306255 [details]
Patch

Clearing flags on attachment: 306255

Committed r215630: <http://trac.webkit.org/changeset/215630>
Comment 9 WebKit Commit Bot 2017-04-21 13:05:37 PDT
All reviewed patches have been landed.  Closing bug.