Bug 54965

Summary: Web Inspector: factor search logic out of inspector.js
Product: WebKit Reporter: Andrey Kosyakov <caseq>
Component: Web Inspector (Deprecated)Assignee: Andrey Kosyakov <caseq>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch
pfeldman: review-, pfeldman: commit-queue-
patch
none
patch pfeldman: review+

Andrey Kosyakov
Reported 2011-02-22 09:06:06 PST
inspector.js is quite overcrowded, getting search logic moved to a separate class might get it a bit more readable.
Attachments
patch (29.51 KB, patch)
2011-02-22 09:17 PST, Andrey Kosyakov
pfeldman: review-
pfeldman: commit-queue-
patch (29.67 KB, patch)
2011-02-24 10:22 PST, Andrey Kosyakov
no flags
patch (29.24 KB, patch)
2011-02-25 02:24 PST, Andrey Kosyakov
pfeldman: review+
Andrey Kosyakov
Comment 1 2011-02-22 09:17:04 PST
Pavel Feldman
Comment 2 2011-02-22 10:48:09 PST
Comment on attachment 83332 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=83332&action=review > Source/WebCore/inspector/front-end/Object.js:92 > +WebInspector.declareSingleton = function(constructor) I don't see why search controller is different from domAgent, debuggerAgent, etc. We should simply initialize it onload. > Source/WebCore/inspector/front-end/ScriptsPanel.js:-1029 > - WebInspector.updateSearchMatchesCount(0, this); I think this call is still needed. > Source/WebCore/inspector/front-end/SearchController.js:198 > + for (var panelName in this.panels) { I don't think your controller has panels. Please test this change thoroughly. > Source/WebCore/inspector/front-end/SearchController.js:224 > + this.currentQuery = query; Could you encapsulate this?
Andrey Kosyakov
Comment 3 2011-02-24 10:22:12 PST
Andrey Kosyakov
Comment 4 2011-02-24 10:23:12 PST
(In reply to comment #2) > (From update of attachment 83332 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=83332&action=review > > > Source/WebCore/inspector/front-end/Object.js:92 > > +WebInspector.declareSingleton = function(constructor) > > I don't see why search controller is different from domAgent, debuggerAgent, etc. We should simply initialize it onload. done. > > > Source/WebCore/inspector/front-end/ScriptsPanel.js:-1029 > > - WebInspector.updateSearchMatchesCount(0, this); > > I think this call is still needed. Yup, indeed -- we're still calling it directly. Brought it back. > > Source/WebCore/inspector/front-end/SearchController.js:198 > > + for (var panelName in this.panels) { > > I don't think your controller has panels. Please test this change thoroughly. Thanks, fixed! > > > Source/WebCore/inspector/front-end/SearchController.js:224 > > + this.currentQuery = query; > > Could you encapsulate this? done.
Pavel Feldman
Comment 5 2011-02-24 10:38:34 PST
Comment on attachment 83677 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=83677&action=review > Source/WebCore/WebCore.gypi:4772 > + 'inspector/front-end/SearchController.js', Sc < Se > Source/WebCore/WebCore.vcproj/WebCore.vcproj:66104 > + RelativePath="..\inspector\front-end\SearchController.js" ditto > Source/WebCore/inspector/front-end/inspector.js:244 > + if (!this._initializationComplete) Why do we need this?
Andrey Kosyakov
Comment 6 2011-02-25 00:21:41 PST
(In reply to comment #5) > (From update of attachment 83677 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=83677&action=review > > > Source/WebCore/WebCore.gypi:4772 > > + 'inspector/front-end/SearchController.js', > > Sc < Se > > > Source/WebCore/WebCore.vcproj/WebCore.vcproj:66104 > > + RelativePath="..\inspector\front-end\SearchController.js" > > ditto > > > Source/WebCore/inspector/front-end/inspector.js:244 > > + if (!this._initializationComplete) > > Why do we need this? we create bulk of WebInspector objects in doLoadedDone, and set attached() is occasionally called before that. We used to check for individual fields there, but as their number is growing, I thought we'd better replace it with a single check for initialization being complete (thought we discussed it).
Andrey Kosyakov
Comment 7 2011-02-25 02:24:39 PST
Created attachment 83788 [details] patch - removed calls to resize() methods from set attached() (resize is supposed to be called along with set attached() in case we change attach mode) - fixed files ordering
Andrey Kosyakov
Comment 8 2011-03-03 07:46:05 PST
Note You need to log in before you can comment on or make changes to this bug.