Some iframe use the `srcdoc` attribute to set their content instead of a URL. As a result, the main resource has no "real" URL, meaning we are unable to show anything meaningful. For those cases (and those that have a `name` regardless), we should show the `name` somewhere in the `FrameTreeElement`s text.
Created attachment 351582 [details] Patch
<rdar://problem/44998609>
Comment on attachment 351582 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351582&action=review I like the idea of this. Seems we could have a test for this. Do you have a screenshot of a before/after with this as well? > Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js:203 > + // We can't assume that `this._frame` exists since this may be called before that is set. > + if (this.resource.parentFrame.name) Is this.resource.parentFrame guaranteed to not be null?
Comment on attachment 351582 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351582&action=review >> Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js:203 >> + if (this.resource.parentFrame.name) > > Is this.resource.parentFrame guaranteed to not be null? It should always be valid. `WI.Frame.prototype.initialize` sets the `_parentFrame`, and `this.resource` is equal to the `WI.Frame.prototype.mainResource`. Additionally, every resource that get's added to a frame has it's `_parentFrame` set as well.
Created attachment 351658 [details] [Image] After Patch is applied Any `WI.TreeElement` that follows a "%s (%s)" pattern is affected by this patch, where the first "%s" is the `name` of the `WI.Frame` and the second is the previously shown `url`.
Comment on attachment 351582 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351582&action=review r=me > Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js:136 > + get _mainTitleText() I think the underscore is unnecessary. I think of underscore'd things as properties, not as getters, so this messes with my brain a bit.
You may want to move the Execution Context Picker in the Quick Console to this kind of formatting so we are consistent.
Created attachment 351696 [details] Patch
Comment on attachment 351696 [details] Patch Clearing flags on attachment: 351696 Committed r236885: <https://trac.webkit.org/changeset/236885>
All reviewed patches have been landed. Closing bug.