Diff
Modified: trunk/LayoutTests/ChangeLog (199262 => 199263)
--- trunk/LayoutTests/ChangeLog 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/LayoutTests/ChangeLog 2016-04-09 02:37:19 UTC (rev 199263)
@@ -1,3 +1,19 @@
+2016-04-08 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: XHRs and Web Worker scripts are not searchable
+ https://bugs.webkit.org/show_bug.cgi?id=154214
+ <rdar://problem/24643587>
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/page/resources/search-script.js: Added.
+ * inspector/page/resources/search-stylesheet.css: Added.
+ * inspector/page/resources/search-worker.js: Added.
+ * inspector/page/resources/search-xhr.txt: Added.
+ * inspector/page/searchInResources-expected.txt: Added.
+ * inspector/page/searchInResources.html: Added.
+ Test for the Page domain's search commands.
+
2016-04-08 Joanmarie Diggs <[email protected]>
AX: "AXLandmarkApplication" is an inappropriate subrole for ARIA "application" since it's no longer a landmark
Added: trunk/LayoutTests/inspector/page/resources/search-script.js (0 => 199263)
--- trunk/LayoutTests/inspector/page/resources/search-script.js (rev 0)
+++ trunk/LayoutTests/inspector/page/resources/search-script.js 2016-04-09 02:37:19 UTC (rev 199263)
@@ -0,0 +1 @@
+// Script resource with the SEARCH-STRING.
Added: trunk/LayoutTests/inspector/page/resources/search-stylesheet.css (0 => 199263)
--- trunk/LayoutTests/inspector/page/resources/search-stylesheet.css (rev 0)
+++ trunk/LayoutTests/inspector/page/resources/search-stylesheet.css 2016-04-09 02:37:19 UTC (rev 199263)
@@ -0,0 +1,4 @@
+/* Stylesheet resource with the SEARCH-STRING */
+body {
+ color: black;
+}
Added: trunk/LayoutTests/inspector/page/resources/search-worker.js (0 => 199263)
--- trunk/LayoutTests/inspector/page/resources/search-worker.js (rev 0)
+++ trunk/LayoutTests/inspector/page/resources/search-worker.js 2016-04-09 02:37:19 UTC (rev 199263)
@@ -0,0 +1,5 @@
+// Worker resource with the SEARCH-STRING.
+
+self.addEventListener("message", (event) => {
+ self.postMessage("echo: " + event.data);
+});
Added: trunk/LayoutTests/inspector/page/resources/search-xhr.txt (0 => 199263)
--- trunk/LayoutTests/inspector/page/resources/search-xhr.txt (rev 0)
+++ trunk/LayoutTests/inspector/page/resources/search-xhr.txt 2016-04-09 02:37:19 UTC (rev 199263)
@@ -0,0 +1,2 @@
+XHR Resource with the SEARCH-STRING.
+XHR Resource with the SEARCH-STRING again!
Added: trunk/LayoutTests/inspector/page/searchInResources-expected.txt (0 => 199263)
--- trunk/LayoutTests/inspector/page/searchInResources-expected.txt (rev 0)
+++ trunk/LayoutTests/inspector/page/searchInResources-expected.txt 2016-04-09 02:37:19 UTC (rev 199263)
@@ -0,0 +1,21 @@
+Tests for the Page.searchInResources and Page.searchInResource commands.
+
+
+== Running test suite: Page.searchInResources and Page.searchInResource
+-- Running test case: SearchAllResources
+PASS: Should find results in multiple resources.
+FOUND: inspector/page/resources/search-script.js (1)
+FOUND: inspector/page/resources/search-stylesheet.css (1)
+FOUND: inspector/page/resources/search-worker.js (1)
+FOUND: inspector/page/resources/search-xhr.txt (2)
+FOUND: inspector/page/searchInResources.html (1)
+
+-- Running test case: SearchInScriptResource
+PASS: Should find previously mentioned number of matches.
+MATCH: {"lineNumber":0,"lineContent":"// Script resource with the SEARCH-STRING.\n"}
+
+-- Running test case: SearchInXHRResource
+PASS: Should find previously mentioned number of matches.
+MATCH: {"lineNumber":0,"lineContent":"XHR Resource with the SEARCH-STRING.\n"}
+MATCH: {"lineNumber":1,"lineContent":"XHR Resource with the SEARCH-STRING again!\n"}
+
Added: trunk/LayoutTests/inspector/page/searchInResources.html (0 => 199263)
--- trunk/LayoutTests/inspector/page/searchInResources.html (rev 0)
+++ trunk/LayoutTests/inspector/page/searchInResources.html 2016-04-09 02:37:19 UTC (rev 199263)
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<link rel="stylesheet" href=""
+<script src=""
+<script>
+function triggerDownloadingResources() {
+ let worker = new Worker("resources/search-worker.js");
+
+ let xhr = new XMLHttpRequest;
+ xhr.open("GET", "resources/search-xhr.txt", true);
+ xhr.addEventListener("load", done);
+ xhr.send();
+
+ function done() {
+ TestPage.dispatchEventToFrontend('PageIsReady');
+ }
+}
+
+function test()
+{
+ function sanitizeURL(url) {
+ return url.replace(/^.*?LayoutTests\//, "");
+ }
+
+ let suite = InspectorTest.createAsyncSuite("Page.searchInResources and Page.searchInResource");
+
+ let searchResults;
+ const searchString = "SEARCH-STRING";
+
+ suite.addTestCase({
+ name: "SearchAllResources",
+ description: "Able to find text results in different resources.",
+ test: (resolve, reject) => {
+ PageAgent.searchInResources(searchString, (error, results) => {
+ InspectorTest.assert(!error, "Should not be a protocol error.");
+ InspectorTest.expectThat(results.length > 0, "Should find results in multiple resources.");
+ searchResults = results.sort((a, b) => a.url.localeCompare(b.url));
+ for (let result of searchResults)
+ InspectorTest.log(`FOUND: ${sanitizeURL(result.url)} (${result.matchesCount})`);
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "SearchInScriptResource",
+ description: "Able to find text results in an individual Script resource.",
+ test: (resolve, reject) => {
+ let result = searchResults.find((result) => /search-script\.js$/.test(result.url));
+ if (!result)
+ reject();
+
+ PageAgent.searchInResource(result.frameId, result.url, searchString, (error, matches) => {
+ InspectorTest.assert(!error, "Should not be a protocol error.");
+ InspectorTest.expectThat(matches.length === result.matchesCount, "Should find previously mentioned number of matches.");
+ for (let match of matches)
+ InspectorTest.log(`MATCH: ${JSON.stringify(match)}`);
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "SearchInXHRResource",
+ description: "Able to find text results in an individual XHR resource.",
+ test: (resolve, reject) => {
+ let result = searchResults.find((result) => /search-xhr\.txt$/.test(result.url));
+ if (!result)
+ reject();
+
+ const isRegex = undefined;
+ const caseSensitive = undefined;
+
+ PageAgent.searchInResource(result.frameId, result.url, searchString, caseSensitive, isRegex, result.requestId, (error, matches) => {
+ InspectorTest.assert(!error, "Should not be a protocol error.");
+ InspectorTest.expectThat(matches.length === result.matchesCount, "Should find previously mentioned number of matches.");
+ for (let match of matches)
+ InspectorTest.log(`MATCH: ${JSON.stringify(match)}`);
+ resolve();
+ });
+ }
+ });
+
+ InspectorTest.evaluateInPage("triggerDownloadingResources()");
+ InspectorTest.singleFireEventListener("PageIsReady", (event) => {
+ suite.runTestCasesAndFinish();
+ });
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>Tests for the Page.searchInResources and Page.searchInResource commands.</p>
+</body>
+</html>
Modified: trunk/Source/_javascript_Core/ChangeLog (199262 => 199263)
--- trunk/Source/_javascript_Core/ChangeLog 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-04-09 02:37:19 UTC (rev 199263)
@@ -1,3 +1,16 @@
+2016-04-08 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: XHRs and Web Worker scripts are not searchable
+ https://bugs.webkit.org/show_bug.cgi?id=154214
+ <rdar://problem/24643587>
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/protocol/Page.json:
+ Add optional requestId to search results properties and search
+ parameters for when the frameId and url are not enough. XHR
+ resources, and "Other" resources will use this.
+
2016-04-08 Guillaume Emont <[email protected]>
MIPS: support Signed cond in branchTest32()
Modified: trunk/Source/_javascript_Core/inspector/protocol/Page.json (199262 => 199263)
--- trunk/Source/_javascript_Core/inspector/protocol/Page.json 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/Source/_javascript_Core/inspector/protocol/Page.json 2016-04-09 02:37:19 UTC (rev 199263)
@@ -58,7 +58,8 @@
"properties": [
{ "name": "url", "type": "string", "description": "Resource URL." },
{ "name": "frameId", "$ref": "Network.FrameId", "description": "Resource frame id." },
- { "name": "matchesCount", "type": "number", "description": "Number of matches in the resource content." }
+ { "name": "matchesCount", "type": "number", "description": "Number of matches in the resource content." },
+ { "name": "requestId", "$ref": "Network.RequestId", "optional": true, "description": "Network request id." }
]
},
{
@@ -164,7 +165,8 @@
{ "name": "url", "type": "string", "description": "URL of the resource to search in." },
{ "name": "query", "type": "string", "description": "String to search for." },
{ "name": "caseSensitive", "type": "boolean", "optional": true, "description": "If true, search is case sensitive." },
- { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." }
+ { "name": "isRegex", "type": "boolean", "optional": true, "description": "If true, treats string parameter as regex." },
+ { "name": "requestId", "$ref": "Network.RequestId", "optional": true, "description": "Request id for resource to search in." }
],
"returns": [
{ "name": "result", "type": "array", "items": { "$ref": "GenericTypes.SearchMatch" }, "description": "List of search matches." }
Modified: trunk/Source/WebCore/ChangeLog (199262 => 199263)
--- trunk/Source/WebCore/ChangeLog 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/Source/WebCore/ChangeLog 2016-04-09 02:37:19 UTC (rev 199263)
@@ -1,3 +1,34 @@
+2016-04-08 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: XHRs and Web Worker scripts are not searchable
+ https://bugs.webkit.org/show_bug.cgi?id=154214
+ <rdar://problem/24643587>
+
+ Reviewed by Timothy Hatcher.
+
+ Test: inspector/page/searchInResources.html
+
+ * inspector/InspectorPageAgent.h:
+ * inspector/InspectorPageAgent.cpp:
+ (WebCore::InspectorPageAgent::searchInResource):
+ (WebCore::InspectorPageAgent::searchInResources):
+ Let the NetworkAgent handle individual search requests
+ with a requestId. And provide global search results for
+ "other" resources and will include requestId properties.
+
+ * inspector/InspectorNetworkAgent.h:
+ * inspector/InspectorNetworkAgent.cpp:
+ (WebCore::InspectorNetworkAgent::didFinishXHRLoading):
+ (WebCore::buildObjectForSearchResult):
+ (WebCore::InspectorNetworkAgent::searchOtherRequests):
+ (WebCore::InspectorNetworkAgent::searchInRequest):
+ Search saved "other" resource data content.
+
+ * inspector/NetworkResourcesData.h:
+ * inspector/NetworkResourcesData.cpp:
+ (WebCore::NetworkResourcesData::resources):
+ Expose the resources for iteration by the NetworkAgent.
+
2016-04-08 Joanmarie Diggs <[email protected]>
AX: "AXLandmarkApplication" is an inappropriate subrole for ARIA "application" since it's no longer a landmark
Modified: trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp (199262 => 199263)
--- trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/Source/WebCore/inspector/InspectorNetworkAgent.cpp 2016-04-09 02:37:19 UTC (rev 199263)
@@ -60,6 +60,7 @@
#include "ThreadableLoaderClient.h"
#include "URL.h"
#include "WebSocketFrame.h"
+#include <inspector/ContentSearchUtilities.h>
#include <inspector/IdentifiersFactory.h>
#include <inspector/InspectorFrontendRouter.h>
#include <inspector/InspectorValues.h>
@@ -452,10 +453,7 @@
void InspectorNetworkAgent::didFinishXHRLoading(ThreadableLoaderClient*, unsigned long identifier, const String& sourceString)
{
- // For Asynchronous XHRs, the inspector can grab the data directly off of the CachedResource. For sync XHRs, we need to
- // provide the data here, since no CachedResource was involved.
- if (m_loadingXHRSynchronously)
- m_resourcesData->setResourceContent(IdentifiersFactory::requestId(identifier), sourceString);
+ m_resourcesData->setResourceContent(IdentifiersFactory::requestId(identifier), sourceString);
}
void InspectorNetworkAgent::didReceiveXHRResponse(unsigned long identifier)
@@ -697,6 +695,45 @@
inspectorThreadableLoaderClient->setLoader(loader.release());
}
+static Ref<Inspector::Protocol::Page::SearchResult> buildObjectForSearchResult(const String& requestId, const String& frameId, const String& url, int matchesCount)
+{
+ auto searchResult = Inspector::Protocol::Page::SearchResult::create()
+ .setUrl(url)
+ .setFrameId(frameId)
+ .setMatchesCount(matchesCount)
+ .release();
+ searchResult->setRequestId(requestId);
+ return searchResult;
+}
+
+void InspectorNetworkAgent::searchOtherRequests(const JSC::Yarr::RegularExpression& regex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::SearchResult>>& result)
+{
+ Vector<NetworkResourcesData::ResourceData*> resources = m_resourcesData->resources();
+ for (auto* resourceData : resources) {
+ if (resourceData->hasContent()) {
+ int matchesCount = ContentSearchUtilities::countRegularExpressionMatches(regex, resourceData->content());
+ if (matchesCount)
+ result->addItem(buildObjectForSearchResult(resourceData->requestId(), resourceData->frameId(), resourceData->url(), matchesCount));
+ }
+ }
+}
+
+void InspectorNetworkAgent::searchInRequest(ErrorString& errorString, const String& requestId, const String& query, bool caseSensitive, bool isRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>& results)
+{
+ NetworkResourcesData::ResourceData const* resourceData = m_resourcesData->data(requestId);
+ if (!resourceData) {
+ errorString = ASCIILiteral("No resource with given identifier found");
+ return;
+ }
+
+ if (!resourceData->hasContent()) {
+ errorString = ASCIILiteral("No resource content");
+ return;
+ }
+
+ results = ContentSearchUtilities::searchInTextByLines(resourceData->content(), query, caseSensitive, isRegex);
+}
+
void InspectorNetworkAgent::mainFrameNavigated(DocumentLoader& loader)
{
if (m_cacheDisabled)
Modified: trunk/Source/WebCore/inspector/InspectorNetworkAgent.h (199262 => 199263)
--- trunk/Source/WebCore/inspector/InspectorNetworkAgent.h 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/Source/WebCore/inspector/InspectorNetworkAgent.h 2016-04-09 02:37:19 UTC (rev 199263)
@@ -37,6 +37,7 @@
#include <inspector/InspectorFrontendDispatchers.h>
#include <wtf/HashSet.h>
#include <wtf/text/WTFString.h>
+#include <yarr/RegularExpression.h>
namespace Inspector {
class InspectorObject;
@@ -100,6 +101,9 @@
void setInitialScriptContent(unsigned long identifier, const String& sourceString);
void didScheduleStyleRecalculation(Document&);
+ void searchOtherRequests(const JSC::Yarr::RegularExpression&, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::SearchResult>>&);
+ void searchInRequest(ErrorString&, const String& requestId, const String& query, bool caseSensitive, bool isRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>&);
+
RefPtr<Inspector::Protocol::Network::Initiator> buildInitiatorObject(Document*);
// Called from frontend.
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (199262 => 199263)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2016-04-09 02:37:19 UTC (rev 199263)
@@ -55,6 +55,7 @@
#include "ImageBuffer.h"
#include "InspectorClient.h"
#include "InspectorDOMAgent.h"
+#include "InspectorNetworkAgent.h"
#include "InspectorOverlay.h"
#include "InspectorTimelineAgent.h"
#include "InstrumentingAgents.h"
@@ -115,7 +116,10 @@
static bool hasTextContent(CachedResource* cachedResource)
{
InspectorPageAgent::ResourceType type = InspectorPageAgent::cachedResourceType(*cachedResource);
- return type == InspectorPageAgent::DocumentResource || type == InspectorPageAgent::StylesheetResource || type == InspectorPageAgent::ScriptResource || type == InspectorPageAgent::XHRResource;
+ return type == InspectorPageAgent::DocumentResource
+ || type == InspectorPageAgent::StylesheetResource
+ || type == InspectorPageAgent::ScriptResource
+ || type == InspectorPageAgent::XHRResource;
}
static RefPtr<TextResourceDecoder> createXHRTextDecoder(const String& mimeType, const String& textEncodingName)
@@ -566,18 +570,25 @@
return false;
}
-void InspectorPageAgent::searchInResource(ErrorString&, const String& frameId, const String& url, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>& results)
+void InspectorPageAgent::searchInResource(ErrorString& errorString, const String& frameId, const String& url, const String& query, const bool* const optionalCaseSensitive, const bool* const optionalIsRegex, const String* optionalRequestId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>& results)
{
results = Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>::create();
bool isRegex = optionalIsRegex ? *optionalIsRegex : false;
bool caseSensitive = optionalCaseSensitive ? *optionalCaseSensitive : false;
- Frame* frame = frameForId(frameId);
+ if (optionalRequestId) {
+ if (InspectorNetworkAgent* networkAgent = m_instrumentingAgents.inspectorNetworkAgent()) {
+ networkAgent->searchInRequest(errorString, *optionalRequestId, query, caseSensitive, isRegex, results);
+ return;
+ }
+ }
+
+ Frame* frame = assertFrame(errorString, frameId);
if (!frame)
return;
- DocumentLoader* loader = frame->loader().documentLoader();
+ DocumentLoader* loader = assertDocumentLoader(errorString, frame);
if (!loader)
return;
@@ -634,6 +645,9 @@
result->addItem(buildObjectForSearchResult(frameId(frame), frame->document()->url(), matchesCount));
}
}
+
+ if (InspectorNetworkAgent* networkAgent = m_instrumentingAgents.inspectorNetworkAgent())
+ networkAgent->searchOtherRequests(regex, result);
}
void InspectorPageAgent::setDocumentContent(ErrorString& errorString, const String& frameId, const String& html)
Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (199262 => 199263)
--- trunk/Source/WebCore/inspector/InspectorPageAgent.h 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h 2016-04-09 02:37:19 UTC (rev 199263)
@@ -102,7 +102,7 @@
void deleteCookie(ErrorString&, const String& cookieName, const String& url) override;
void getResourceTree(ErrorString&, RefPtr<Inspector::Protocol::Page::FrameResourceTree>&) override;
void getResourceContent(ErrorString&, const String& frameId, const String& url, String* content, bool* base64Encoded) override;
- void searchInResource(ErrorString&, const String& frameId, const String& url, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>&) override;
+ void searchInResource(ErrorString&, const String& frameId, const String& url, const String& query, const bool* optionalCaseSensitive, const bool* optionalIsRegex, const String* optionalRequestId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>>&) override;
void searchInResources(ErrorString&, const String&, const bool* caseSensitive, const bool* isRegex, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Page::SearchResult>>&) override;
void setDocumentContent(ErrorString&, const String& frameId, const String& html) override;
void setShowPaintRects(ErrorString&, bool show) override;
Modified: trunk/Source/WebCore/inspector/NetworkResourcesData.cpp (199262 => 199263)
--- trunk/Source/WebCore/inspector/NetworkResourcesData.cpp 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/Source/WebCore/inspector/NetworkResourcesData.cpp 2016-04-09 02:37:19 UTC (rev 199263)
@@ -283,6 +283,13 @@
m_requestIdToResourceDataMap.swap(preservedMap);
}
+Vector<NetworkResourcesData::ResourceData*> NetworkResourcesData::resources()
+{
+ Vector<NetworkResourcesData::ResourceData*> resources;
+ copyValuesToVector(m_requestIdToResourceDataMap, resources);
+ return resources;
+}
+
NetworkResourcesData::ResourceData* NetworkResourcesData::resourceDataForRequestId(const String& requestId)
{
if (requestId.isNull())
Modified: trunk/Source/WebCore/inspector/NetworkResourcesData.h (199262 => 199263)
--- trunk/Source/WebCore/inspector/NetworkResourcesData.h 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/Source/WebCore/inspector/NetworkResourcesData.h 2016-04-09 02:37:19 UTC (rev 199263)
@@ -127,6 +127,7 @@
ResourceData const* data(const String& requestId);
Vector<String> removeCachedResource(CachedResource*);
void clear(const String& preservedLoaderId = String());
+ Vector<ResourceData*> resources();
private:
ResourceData* resourceDataForRequestId(const String& requestId);
Modified: trunk/Source/WebInspectorUI/ChangeLog (199262 => 199263)
--- trunk/Source/WebInspectorUI/ChangeLog 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/Source/WebInspectorUI/ChangeLog 2016-04-09 02:37:19 UTC (rev 199263)
@@ -1,5 +1,18 @@
2016-04-08 Joseph Pecoraro <[email protected]>
+ Web Inspector: XHRs and Web Worker scripts are not searchable
+ https://bugs.webkit.org/show_bug.cgi?id=154214
+ <rdar://problem/24643587>
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Views/SearchSidebarPanel.js:
+ (WebInspector.SearchSidebarPanel.prototype.performSearch.resourceCallback):
+ (WebInspector.SearchSidebarPanel.prototype.performSearch.resourcesCallback):
+ Carry forward the requestId property if it is available.
+
+2016-04-08 Joseph Pecoraro <[email protected]>
+
Web Inspector: Allocation snapshot hover persists after switching tabs
https://bugs.webkit.org/show_bug.cgi?id=156430
<rdar://problem/25633800>
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js (199262 => 199263)
--- trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js 2016-04-09 02:32:16 UTC (rev 199262)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js 2016-04-09 02:37:19 UTC (rev 199263)
@@ -124,14 +124,14 @@
if (error)
return;
- function resourceCallback(url, error, resourceMatches)
+ function resourceCallback(frameId, url, error, resourceMatches)
{
updateEmptyContentPlaceholderSoon.call(this);
if (error || !resourceMatches || !resourceMatches.length)
return;
- var frame = WebInspector.frameResourceManager.frameForIdentifier(searchResult.frameId);
+ var frame = WebInspector.frameResourceManager.frameForIdentifier(frameId);
if (!frame)
return;
@@ -160,7 +160,8 @@
if (!searchResult.url || !searchResult.frameId)
continue;
- PageAgent.searchInResource(searchResult.frameId, searchResult.url, searchQuery, isCaseSensitive, isRegex, resourceCallback.bind(this, searchResult.url));
+ // COMPATIBILITY (iOS 9): Page.searchInResources did not have the optional requestId parameter.
+ PageAgent.searchInResource(searchResult.frameId, searchResult.url, searchQuery, isCaseSensitive, isRegex, searchResult.requestId, resourceCallback.bind(this, searchResult.frameId, searchResult.url));
}
}