RESOLVED FIXED Bug 131252
Web Inspector: JSContext inspection Resource search does not work
https://bugs.webkit.org/show_bug.cgi?id=131252
Summary Web Inspector: JSContext inspection Resource search does not work
Joseph Pecoraro
Reported 2014-04-04 19:02:19 PDT
The Resource Panel's search bar in a JSContext Inspector currently does not work. It should!
Attachments
[PATCH] Proposed Fix (30.21 KB, patch)
2014-11-18 23:10 PST, Joseph Pecoraro
timothy: review+
Radar WebKit Bug Importer
Comment 1 2014-04-04 19:02:47 PDT
Joseph Pecoraro
Comment 2 2014-11-18 23:01:11 PST
Joseph Pecoraro
Comment 3 2014-11-18 23:01:47 PST
This also affects Extra Scripts, Anonymous Scripts, and Extension Scripts when inspecting a web page. I have a fix.
Joseph Pecoraro
Comment 4 2014-11-18 23:10:11 PST
Created attachment 241848 [details] [PATCH] Proposed Fix
Timothy Hatcher
Comment 5 2014-11-19 09:48:33 PST
Comment on attachment 241848 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=241848&action=review > Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js:422 > + var lineMatch; > + var searchRegex = new RegExp(searchTerm.escapeForRegExp(), "gi"); > + while ((searchRegex.lastIndex < match.lineContent.length) && (lineMatch = searchRegex.exec(match.lineContent))) { > + var matchObject = new WebInspector.SourceCodeSearchMatchObject(script, match.lineContent, searchTerm, new WebInspector.TextRange(match.lineNumber, lineMatch.index, match.lineNumber, searchRegex.lastIndex)); > + var matchTreeElement = new WebInspector.SearchResultTreeElement(matchObject); > + scriptTreeElement.appendChild(matchTreeElement); > } We should make this a helper that returns an array of matches or calls a function for each match. We have written this about 3-4 times in out codebase. > Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js:737 > + var children = folderTreeElement.children; > + for (var treeElement of children) { > + if (treeElement instanceof WebInspector.ScriptTreeElement) > + nonResourceScripts.push(treeElement.script); > + } Assert that there are no sub-folders or any tree elements that have children that might need searched? > Source/WebInspectorUI/UserInterface/Views/ResourceSidebarPanel.js:742 > + if (WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript && !WebInspector.hasExtraDomains) > + collectFromTreeElement(this._resourcesContentTreeOutline); > + else { I hate no braces in this case, but it is our style...
Joseph Pecoraro
Comment 6 2014-11-19 15:50:33 PST
Note You need to log in before you can comment on or make changes to this bug.