WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
54965
Web Inspector: factor search logic out of inspector.js
https://bugs.webkit.org/show_bug.cgi?id=54965
Summary
Web Inspector: factor search logic out of inspector.js
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-
Details
Formatted Diff
Diff
patch
(29.67 KB, patch)
2011-02-24 10:22 PST
,
Andrey Kosyakov
no flags
Details
Formatted Diff
Diff
patch
(29.24 KB, patch)
2011-02-25 02:24 PST
,
Andrey Kosyakov
pfeldman
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Andrey Kosyakov
Comment 1
2011-02-22 09:17:04 PST
Created
attachment 83332
[details]
patch
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
Created
attachment 83677
[details]
patch
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
Manually committed
r80102
:
http://trac.webkit.org/changeset/80102
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug