Title: [236885] trunk/Source/WebInspectorUI
- Revision
- 236885
- Author
- [email protected]
- Date
- 2018-10-05 14:12:48 -0700 (Fri, 05 Oct 2018)
Log Message
Web Inspector: use iframe's name attribute for FrameTreeElement
https://bugs.webkit.org/show_bug.cgi?id=190275
Reviewed by Joseph Pecoraro.
* UserInterface/Views/FrameTreeElement.js:
(WI.FrameTreeElement.prototype.get mainTitleText): Added.
* UserInterface/Views/ResourceTreeElement.js:
(WI.ResourceTreeElement.prototype.get mainTitleText): Added.
(WI.ResourceTreeElement.prototype._updateTitles):
Provide a way for subclasses to override what is used for the `mainTitle`.
* UserInterface/Views/QuickConsole.js:
(WI.QuickConsole.prototype._createExecutionContextPathComponentFromFrame):
Update the execution context picker to match what `WI.FrameTreeElement`s show.
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (236884 => 236885)
--- trunk/Source/WebInspectorUI/ChangeLog 2018-10-05 20:08:13 UTC (rev 236884)
+++ trunk/Source/WebInspectorUI/ChangeLog 2018-10-05 21:12:48 UTC (rev 236885)
@@ -1,3 +1,22 @@
+2018-10-05 Devin Rousso <[email protected]>
+
+ Web Inspector: use iframe's name attribute for FrameTreeElement
+ https://bugs.webkit.org/show_bug.cgi?id=190275
+
+ Reviewed by Joseph Pecoraro.
+
+ * UserInterface/Views/FrameTreeElement.js:
+ (WI.FrameTreeElement.prototype.get mainTitleText): Added.
+
+ * UserInterface/Views/ResourceTreeElement.js:
+ (WI.ResourceTreeElement.prototype.get mainTitleText): Added.
+ (WI.ResourceTreeElement.prototype._updateTitles):
+ Provide a way for subclasses to override what is used for the `mainTitle`.
+
+ * UserInterface/Views/QuickConsole.js:
+ (WI.QuickConsole.prototype._createExecutionContextPathComponentFromFrame):
+ Update the execution context picker to match what `WI.FrameTreeElement`s show.
+
2018-10-04 Matt Baker <[email protected]>
Web Inspector: REGRESSION (r236766): Storage tab no longer updates after main frame navigation
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js (236884 => 236885)
--- trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js 2018-10-05 20:08:13 UTC (rev 236884)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js 2018-10-05 21:12:48 UTC (rev 236885)
@@ -195,6 +195,16 @@
this._expandedSetting.value = false;
}
+ // Protected
+
+ get mainTitleText()
+ {
+ // We can't assume that `this._frame` exists since this may be called before that is set.
+ if (this.resource.parentFrame.name)
+ return WI.UIString("%s (%s)").format(this.resource.parentFrame.name, super.mainTitleText);
+ return super.mainTitleText;
+ }
+
// Private
_updateExpandedSetting()
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js (236884 => 236885)
--- trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js 2018-10-05 20:08:13 UTC (rev 236884)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/QuickConsole.js 2018-10-05 21:12:48 UTC (rev 236885)
@@ -209,7 +209,7 @@
_createExecutionContextPathComponentFromFrame(frame)
{
- let preferredName = frame.name ? frame.name + " \u2014 " + frame.mainResource.displayName : frame.mainResource.displayName;
+ let preferredName = frame.name ? WI.UIString("%s (%s)").format(frame.name, frame.mainResource.displayName) : frame.mainResource.displayName;
return this._createExecutionContextPathComponent(frame.pageExecutionContext, preferredName);
}
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js (236884 => 236885)
--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js 2018-10-05 20:08:13 UTC (rev 236884)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js 2018-10-05 21:12:48 UTC (rev 236885)
@@ -133,6 +133,11 @@
// Protected
+ get mainTitleText()
+ {
+ return WI.displayNameForURL(this._resource.url, this._resource.urlComponents);
+ }
+
_updateTitles()
{
var frame = this._resource.parentFrame;
@@ -151,7 +156,7 @@
var urlComponents = this._resource.urlComponents;
var oldMainTitle = this.mainTitle;
- this.mainTitle = WI.displayNameForURL(this._resource.url, urlComponents);
+ this.mainTitle = this.mainTitleText;
// Show the host as the subtitle if it is different from the main resource or if this is the main frame's main resource.
var subtitle = parentResourceHost !== urlComponents.host || frame && frame.isMainFrame() && isMainResource ? WI.displayNameForHost(urlComponents.host) : null;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes