The Resource Panel's search bar in a JSContext Inspector currently does not work. It should!
<rdar://problem/16531981>
<rdar://problem/13776248>
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...
http://trac.webkit.org/changeset/176358