Modified: trunk/Source/WebInspectorUI/ChangeLog (225894 => 225895)
--- trunk/Source/WebInspectorUI/ChangeLog 2017-12-14 07:00:57 UTC (rev 225894)
+++ trunk/Source/WebInspectorUI/ChangeLog 2017-12-14 07:45:29 UTC (rev 225895)
@@ -1,5 +1,40 @@
2017-12-13 Joseph Pecoraro <[email protected]>
+ Web Inspector: Network Tab - Make text filter just a URL filter and update incrementally
+ https://bugs.webkit.org/show_bug.cgi?id=180796
+
+ Reviewed by Brian Burg.
+
+ Revert the Network Tab's text filter back to being just a URL filter with the
+ normal behaviors of our other text filters that update as you type (incremental).
+ This also renames the "text filter" to "url filter" everywhere in the ContentView
+ for clarity. A follow-up change will make the url filter be case-insensitive
+ to fully match the filter bars in other tabs.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ * UserInterface/Views/NetworkTableContentView.js:
+ (WI.NetworkTableContentView):
+ (WI.NetworkTableContentView.prototype.get filterNavigationItems):
+ (WI.NetworkTableContentView.prototype._checkURLFilterAgainstFinishedResource):
+ (WI.NetworkTableContentView.prototype._updateURLFilterActiveIndicator):
+ (WI.NetworkTableContentView.prototype._resourceLoadingDidFinish):
+ (WI.NetworkTableContentView.prototype._resourceLoadingDidFail):
+ (WI.NetworkTableContentView.prototype._hasURLFilter):
+ (WI.NetworkTableContentView.prototype._hasActiveFilter):
+ (WI.NetworkTableContentView.prototype._passURLFilter):
+ (WI.NetworkTableContentView.prototype._passFilter):
+ (WI.NetworkTableContentView.prototype._updateFilteredEntries):
+ (WI.NetworkTableContentView.prototype._resetFilters):
+ (WI.NetworkTableContentView.prototype._urlFilterDidChange):
+ (WI.NetworkTableContentView.prototype._checkTextFilterAgainstFinishedResource): Deleted.
+ (WI.NetworkTableContentView.prototype._checkTextFilterAgainstFailedResource): Deleted.
+ (WI.NetworkTableContentView.prototype._updateTextFilterActiveIndicator): Deleted.
+ (WI.NetworkTableContentView.prototype._hasTextFilter): Deleted.
+ (WI.NetworkTableContentView.prototype._passTextFilter): Deleted.
+ (WI.NetworkTableContentView.prototype._textFilterDidChange): Deleted.
+
+2017-12-13 Joseph Pecoraro <[email protected]>
+
REGRESSION: Web Inspector: Opening inspector crashes page if there are empty resources
https://bugs.webkit.org/show_bug.cgi?id=180787
<rdar://problem/35934838>
Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (225894 => 225895)
--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2017-12-14 07:00:57 UTC (rev 225894)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2017-12-14 07:45:29 UTC (rev 225895)
@@ -414,7 +414,7 @@
localizedStrings["Fill"] = "Fill";
localizedStrings["Fill Mode"] = "Fill Mode";
localizedStrings["Filter"] = "Filter";
-localizedStrings["Filter Full URL and Text"] = "Filter Full URL and Text";
+localizedStrings["Filter Full URL"] = "Filter Full URL";
localizedStrings["Flexbox"] = "Flexbox";
localizedStrings["Float"] = "Float";
localizedStrings["Float and Clear"] = "Float and Clear";
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js (225894 => 225895)
--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js 2017-12-14 07:00:57 UTC (rev 225894)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js 2017-12-14 07:45:29 UTC (rev 225895)
@@ -82,17 +82,15 @@
this._typeFilterScopeBar = new WI.ScopeBar("network-type-filter-scope-bar", typeFilterScopeBarItems, typeFilterScopeBarItems[0]);
this._typeFilterScopeBar.addEventListener(WI.ScopeBar.Event.SelectionChanged, this._typeFilterScopeBarSelectionChanged, this);
- this._textFilterSearchId = 0;
- this._textFilterSearchText = null;
- this._textFilterIsActive = false;
+ this._urlFilterSearchText = null;
+ this._urlFilterIsActive = false;
- this._textFilterNavigationItem = new WI.FilterBarNavigationItem;
- this._textFilterNavigationItem.filterBar.incremental = false;
- this._textFilterNavigationItem.filterBar.addEventListener(WI.FilterBar.Event.FilterDidChange, this._textFilterDidChange, this);
- this._textFilterNavigationItem.filterBar.placeholder = WI.UIString("Filter Full URL and Text");
+ this._urlFilterNavigationItem = new WI.FilterBarNavigationItem;
+ this._urlFilterNavigationItem.filterBar.addEventListener(WI.FilterBar.Event.FilterDidChange, this._urlFilterDidChange, this);
+ this._urlFilterNavigationItem.filterBar.placeholder = WI.UIString("Filter Full URL");
this._activeTypeFilters = this._generateTypeFilter();
- this._activeTextFilterResources = new Set;
+ this._activeURLFilterResources = new Set;
this._emptyFilterResultsMessageElement = null;
@@ -201,11 +199,7 @@
get filterNavigationItems()
{
- let items = [];
- if (window.PageAgent)
- items.push(this._textFilterNavigationItem);
- items.push(this._typeFilterScopeBar);
- return items;
+ return [this._urlFilterNavigationItem, this._typeFilterScopeBar];
}
get supportsSave()
@@ -910,41 +904,11 @@
this.needsLayout();
}
- _checkTextFilterAgainstFinishedResource(resource)
+ _checkURLFilterAgainstFinishedResource(resource)
{
- let frame = resource.parentFrame;
- if (!frame)
- return;
-
- let searchQuery = this._textFilterSearchText;
- if (resource.url.includes(searchQuery)) {
- this._activeTextFilterResources.add(resource);
- return;
- }
-
- let searchId = this._textFilterSearchId;
-
- const isCaseSensitive = true;
- const isRegex = false;
- PageAgent.searchInResource(frame.id, resource.url, searchQuery, isCaseSensitive, isRegex, resource.requestIdentifier, (error, searchResults) => {
- if (searchId !== this._textFilterSearchId)
- return;
-
- if (error || !searchResults || !searchResults.length)
- return;
-
- this._activeTextFilterResources.add(resource);
-
- this._pendingFilter = true;
- this.needsLayout();
- });
- }
-
- _checkTextFilterAgainstFailedResource(resource)
- {
- let searchQuery = this._textFilterSearchText;
+ let searchQuery = this._urlFilterSearchText;
if (resource.url.includes(searchQuery))
- this._activeTextFilterResources.add(resource);
+ this._activeURLFilterResources.add(resource);
}
_rowIndexForResource(resource)
@@ -1026,9 +990,9 @@
this._table.scrollContainer.style.width = this._nameColumn.width + "px";
}
- _updateTextFilterActiveIndicator()
+ _updateURLFilterActiveIndicator()
{
- this._textFilterNavigationItem.filterBar.indicatingActive = this._hasTextFilter();
+ this._urlFilterNavigationItem.filterBar.indicatingActive = this._hasURLFilter();
}
_updateEmptyFilterResultsMessage()
@@ -1112,8 +1076,8 @@
if (resource.timingData.responseEnd > this._waterfallEndTime)
this._waterfallEndTime = resource.timingData.responseEnd;
- if (this._hasTextFilter())
- this._checkTextFilterAgainstFinishedResource(resource);
+ if (this._hasURLFilter())
+ this._checkURLFilterAgainstFinishedResource(resource);
this.needsLayout();
}
@@ -1128,8 +1092,8 @@
if (resource.timingData.responseEnd > this._waterfallEndTime)
this._waterfallEndTime = resource.timingData.responseEnd;
- if (this._hasTextFilter())
- this._checkTextFilterAgainstFailedResource(resource);
+ if (this._hasURLFilter())
+ this._checkURLFilterAgainstFinishedResource(resource);
this.needsLayout();
}
@@ -1245,15 +1209,15 @@
return !!this._activeTypeFilters;
}
- _hasTextFilter()
+ _hasURLFilter()
{
- return this._textFilterIsActive;
+ return this._urlFilterIsActive;
}
_hasActiveFilter()
{
return this._hasTypeFilter()
- || this._hasTextFilter();
+ || this._hasURLFilter();
}
_passTypeFilter(entry)
@@ -1263,17 +1227,17 @@
return this._activeTypeFilters.some((checker) => checker(entry.resource.type));
}
- _passTextFilter(entry)
+ _passURLFilter(entry)
{
- if (!this._hasTextFilter())
+ if (!this._hasURLFilter())
return true;
- return this._activeTextFilterResources.has(entry.resource);
+ return this._activeURLFilterResources.has(entry.resource);
}
_passFilter(entry)
{
return this._passTypeFilter(entry)
- && this._passTextFilter(entry);
+ && this._passURLFilter(entry);
}
_updateSortAndFilteredEntries()
@@ -1291,7 +1255,7 @@
this._restoreSelectedRow();
- this._updateTextFilterActiveIndicator();
+ this._updateURLFilterActiveIndicator();
this._updateEmptyFilterResultsMessage();
}
@@ -1308,14 +1272,12 @@
{
console.assert(this._hasActiveFilter());
- // Clear text filter.
- this._textFilterSearchId++;
- this._textFilterNavigationItem.filterBar.indicatingProgress = false;
- this._textFilterSearchText = null;
- this._textFilterIsActive = false;
- this._activeTextFilterResources.clear();
- this._textFilterNavigationItem.filterBar.clear();
- console.assert(!this._hasTextFilter());
+ // Clear url filter.
+ this._urlFilterSearchText = null;
+ this._urlFilterIsActive = false;
+ this._activeURLFilterResources.clear();
+ this._urlFilterNavigationItem.filterBar.clear();
+ console.assert(!this._hasURLFilter());
// Clear type filter.
this._typeFilterScopeBar.resetToDefault();
@@ -1361,23 +1323,20 @@
this._table.reloadData();
}
- _textFilterDidChange(event)
+ _urlFilterDidChange(event)
{
- let searchQuery = this._textFilterNavigationItem.filterBar.filters.text;
- if (searchQuery === this._textFilterSearchText)
+ let searchQuery = this._urlFilterNavigationItem.filterBar.filters.text;
+ if (searchQuery === this._urlFilterSearchText)
return;
// Even if the selected resource would still be visible, lets close the detail view if a filter changes.
this._hideResourceDetailView();
- let searchId = ++this._textFilterSearchId;
-
// Search cleared.
if (!searchQuery) {
- this._textFilterNavigationItem.filterBar.indicatingProgress = false;
- this._textFilterSearchText = null;
- this._textFilterIsActive = false;
- this._activeTextFilterResources.clear();
+ this._urlFilterSearchText = null;
+ this._urlFilterIsActive = false;
+ this._activeURLFilterResources.clear();
this._updateFilteredEntries();
this._table.reloadData();
@@ -1384,64 +1343,18 @@
return;
}
- this._textFilterSearchText = searchQuery;
- this._textFilterNavigationItem.filterBar.indicatingProgress = true;
+ this._urlFilterIsActive = true;
+ this._urlFilterSearchText = searchQuery;
+ this._activeURLFilterResources.clear();
- // NetworkTable text filter currently searches:
- // - Resource URL
- // - Resource Text Content
- // It does not search all the content in the table (like mimeType, headers, etc).
- // For those we should provide more custom filters.
+ for (let entry of this._entries) {
+ let resource = entry.resource;
+ if (resource.url.includes(searchQuery))
+ this._activeURLFilterResources.add(resource);
+ }
- const isCaseSensitive = true;
- const isRegex = false;
- PageAgent.searchInResources(searchQuery, isCaseSensitive, isRegex, (error, searchResults) => {
- if (searchId !== this._textFilterSearchId)
- return;
-
- this._textFilterIsActive = true;
- this._activeTextFilterResources.clear();
- this._textFilterNavigationItem.filterBar.indicatingProgress = false;
-
- // Add resources based on URL.
- for (let entry of this._entries) {
- let resource = entry.resource;
- if (resource.url.includes(searchQuery))
- this._activeTextFilterResources.add(resource);
- }
-
- // Add resources based on content.
- if (!error) {
- for (let {url, frameId, requestId} of searchResults) {
- if (requestId) {
- let resource = WI.frameResourceManager.resourceForRequestIdentifier(requestId);
- if (resource) {
- this._activeTextFilterResources.add(resource);
- continue;
- }
- }
-
- if (frameId && url) {
- let frame = WI.frameResourceManager.frameForIdentifier(frameId);
- if (frame) {
- if (frame.mainResource.url ="" url) {
- this._activeTextFilterResources.add(frame.mainResource);
- continue;
- }
- let resource = frame.resourceForURL(url);
- if (resource) {
- this._activeTextFilterResources.add(resource);
- continue;
- }
- }
- }
- }
- }
-
- // Apply.
- this._updateFilteredEntries();
- this._table.reloadData();
- });
+ this._updateFilteredEntries();
+ this._table.reloadData();
}
_restoreSelectedRow()