| Summary: | Web Inspector: JSContext inspection Resource search does not work | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||
| Component: | Web Inspector | Assignee: | Joseph Pecoraro <joepeck> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | burg, graouts, joepeck, timothy, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
|
Description
Joseph Pecoraro
2014-04-04 19:02:19 PDT
This also affects Extra Scripts, Anonymous Scripts, and Extension Scripts when inspecting a web page. I have a fix. Created attachment 241848 [details]
[PATCH] Proposed Fix
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... |