Bug 112689 - Web Inspector: factor out node search controller from inspector.js
Summary: Web Inspector: factor out node search controller from inspector.js
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andrey Kosyakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-19 06:24 PDT by Andrey Kosyakov
Modified: 2013-03-28 06:25 PDT (History)
12 users (show)

See Also:


Attachments
Patch (17.70 KB, patch)
2013-03-19 06:34 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
Patch (13.08 KB, patch)
2013-03-19 10:28 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
Patch (16.37 KB, patch)
2013-03-19 10:49 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
Patch (17.52 KB, patch)
2013-03-20 06:31 PDT, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
Patch (16.37 KB, patch)
2013-03-22 10:46 PDT, Andrey Kosyakov
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Kosyakov 2013-03-19 06:24:13 PDT
This extracts the node search logic from inspector.js into a separate file, so it's easier to extend.
Comment 1 Andrey Kosyakov 2013-03-19 06:34:30 PDT
Created attachment 193810 [details]
Patch
Comment 2 Pavel Feldman 2013-03-19 09:34:34 PDT
Comment on attachment 193810 [details]
Patch

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

> Source/WebCore/inspector/front-end/AdvancedSearchController.js:47
> +    return WebInspector.KeyboardShortcut.makeDescriptor("f", WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta | WebInspector.KeyboardShortcut.Modifiers.Shift);

It was Alt

> Source/WebCore/inspector/front-end/InspectorFrontendAPI.js:110
> +        if (WebInspector.nodeSearchController)

This is now called inspectElementMode
Comment 3 Andrey Kosyakov 2013-03-19 10:28:15 PDT
Created attachment 193854 [details]
Patch
Comment 4 Andrey Kosyakov 2013-03-19 10:28:54 PDT
(In reply to comment #2)
> (From update of attachment 193810 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=193810&action=review
> 
> > Source/WebCore/inspector/front-end/AdvancedSearchController.js:47
> > +    return WebInspector.KeyboardShortcut.makeDescriptor("f", WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta | WebInspector.KeyboardShortcut.Modifiers.Shift);
> 
> It was Alt

Oops! Thanks, rolled this part out.

> > Source/WebCore/inspector/front-end/InspectorFrontendAPI.js:110
> > +        if (WebInspector.nodeSearchController)
> 
> This is now called inspectElementMode

Renamed to elementInspectionController.
Comment 5 WebKit Review Bot 2013-03-19 10:33:14 PDT
Comment on attachment 193854 [details]
Patch

Attachment 193854 [details] did not pass cr-linux-debug-ews (chromium-xvfb):
Output: http://webkit-commit-queue.appspot.com/results/17192608
Comment 6 Early Warning System Bot 2013-03-19 10:33:27 PDT
Comment on attachment 193854 [details]
Patch

Attachment 193854 [details] did not pass qt-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17213648
Comment 7 WebKit Review Bot 2013-03-19 10:33:50 PDT
Comment on attachment 193854 [details]
Patch

Attachment 193854 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://webkit-commit-queue.appspot.com/results/17242092
Comment 8 Early Warning System Bot 2013-03-19 10:37:00 PDT
Comment on attachment 193854 [details]
Patch

Attachment 193854 [details] did not pass qt-wk2-ews (qt):
Output: http://webkit-commit-queue.appspot.com/results/17181606
Comment 9 Peter Beverloo (cr-android ews) 2013-03-19 10:47:31 PDT
Comment on attachment 193854 [details]
Patch

Attachment 193854 [details] did not pass cr-android-ews (chromium-android):
Output: http://webkit-commit-queue.appspot.com/results/17196514
Comment 10 Andrey Kosyakov 2013-03-19 10:49:58 PDT
Created attachment 193860 [details]
Patch
Comment 11 Pavel Feldman 2013-03-20 00:44:45 PDT
Comment on attachment 193860 [details]
Patch

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

> Source/WebCore/WebCore.vcproj/WebCore.vcproj:77701
> +					RelativePath="..\inspector\front-end\ElementInspectionController.js"

InspectElementModeController?

> Source/WebCore/inspector/front-end/ElementInspectionController.js:34
> +    this.toggleSearchButton = new WebInspector.StatusBarButton(WebInspector.UIString("Select an element in the page to inspect it."), "node-search-status-bar-item");

Lets hide it.

> Source/WebCore/inspector/front-end/inspector.js:97
> +            mainStatusBar.insertBefore(this.elementInspectionController.toggleSearchButton.element, bottomStatusBarContainer);

You should encapsulate (hide) toggleSearchButton.

> Source/WebCore/inspector/front-end/inspector.js:677
> +    section.addKey(elementInspectionShortcut, WebInspector.UIString("Select node to inspect"));

Why is "Select node to inspect" string here?

> Source/WebCore/inspector/front-end/inspector.js:969
> +    if (WebInspector.elementInspectionController && WebInspector.elementInspectionController.enabled()) {

Can it be missing?
Comment 12 Andrey Kosyakov 2013-03-20 06:31:50 PDT
Created attachment 194038 [details]
Patch
Comment 13 Andrey Kosyakov 2013-03-20 06:33:11 PDT
(In reply to comment #11)
> View in context: https://bugs.webkit.org/attachment.cgi?id=193860&action=review
> 
> > Source/WebCore/WebCore.vcproj/WebCore.vcproj:77701
> > +					RelativePath="..\inspector\front-end\ElementInspectionController.js"
> 
> InspectElementModeController?

Done.

> > Source/WebCore/inspector/front-end/ElementInspectionController.js:34
> > +    this.toggleSearchButton = new WebInspector.StatusBarButton(WebInspector.UIString("Select an element in the page to inspect it."), "node-search-status-bar-item");
> 
> Lets hide it.

Done.

> > Source/WebCore/inspector/front-end/inspector.js:97
> > +            mainStatusBar.insertBefore(this.elementInspectionController.toggleSearchButton.element, bottomStatusBarContainer);
> 
> You should encapsulate (hide) toggleSearchButton.

Done.

> > Source/WebCore/inspector/front-end/inspector.js:677
> > +    section.addKey(elementInspectionShortcut, WebInspector.UIString("Select node to inspect"));
> 
> Why is "Select node to inspect" string here?

This is done consistently with other shortcuts there. Am I missing something?

> > Source/WebCore/inspector/front-end/inspector.js:969
> > +    if (WebInspector.elementInspectionController && WebInspector.elementInspectionController.enabled()) {
> 
> Can it be missing?

Yes, worker inspectors don't have it.
Comment 14 Pavel Feldman 2013-03-20 23:03:47 PDT
Comment on attachment 194038 [details]
Patch

Wrong patch?
Comment 15 Andrey Kosyakov 2013-03-22 10:46:54 PDT
Created attachment 194593 [details]
Patch
Comment 16 Andrey Kosyakov 2013-03-22 10:47:25 PDT
(In reply to comment #14)
> (From update of attachment 194038 [details])
> Wrong patch?

Yup, sorry for the mess. Fixed!
Comment 17 Andrey Kosyakov 2013-03-28 06:25:59 PDT
Committed r147105: <http://trac.webkit.org/changeset/147105>