WebKit Bugzilla
Attachment 372591 Details for
Bug 199052
: Web Inspector: Edit -> Tag doesn't do anything for html, head, and body elements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199052-20190620151219.patch (text/plain), 5.33 KB, created by
Devin Rousso
on 2019-06-20 15:12:20 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-06-20 15:12:20 PDT
Size:
5.33 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 8f5c739891d81a1459c80f335ddda9e4221840c0..76163f5a0d8ee1f31a5b6078cd5f3f617842fb67 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,17 @@ >+2019-06-20 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Edit -> Tag doesn't do anything for html, head, and body elements >+ https://bugs.webkit.org/show_bug.cgi?id=199052 >+ <rdar://problem/51923906> >+ >+ Reviewed by Matt Baker. >+ >+ * UserInterface/Views/DOMTreeElement.js: >+ (WI.DOMTreeElement.prototype.populateDOMNodeContextMenu): >+ - Don't show an "Edit > Tag" for <html>, <head>, and <body> nodes >+ - Disable any "Edit" submenu item if it's target is already being edited >+ - Prevent "Add" submenu items from being shown for text nodes >+ > 2019-06-19 Devin Rousso <drousso@apple.com> > > Web Inspector: REGRESSION: Debugger: current call frame indicator isn't vertically centered >diff --git a/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js b/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js >index aebff03a1caa1eb5ae08276246b71502dbdcb215..85298ed597d06f2385303d4f1c35ab7bf8d7a848 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js >+++ b/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js >@@ -743,12 +743,12 @@ WI.DOMTreeElement = class DOMTreeElement extends WI.TreeElement > > populateDOMNodeContextMenu(contextMenu, subMenus, event) > { >- let attribute = event.target.closest(".html-attribute"); >+ let attributeNode = event.target.closest(".html-attribute"); > let textNode = event.target.closest(".html-text-node"); > > let attributeName = null; >- if (attribute) { >- let attributeNameElement = attribute.getElementsByClassName("html-attribute-name")[0]; >+ if (attributeNode) { >+ let attributeNameElement = attributeNode.getElementsByClassName("html-attribute-name")[0]; > if (attributeNameElement) > attributeName = attributeNameElement.textContent.trim(); > } >@@ -759,23 +759,23 @@ WI.DOMTreeElement = class DOMTreeElement extends WI.TreeElement > contextMenu.appendSeparator(); > > let isEditableNode = this.representedObject.nodeType() === Node.ELEMENT_NODE && this.editable; >- let isNonShadowEditable = !this.representedObject.isInUserAgentShadowTree() && this.editable; >- let forbiddenClosingTag = WI.DOMTreeElement.ForbiddenClosingTagElements.has(this.representedObject.nodeNameInCorrectCase()); >+ let isNonShadowEditable = !this.representedObject.isInUserAgentShadowTree() && isEditableNode; >+ let alreadyEditingHTML = this._htmlEditElement && WI.isBeingEdited(this._htmlEditElement); > > if (isEditableNode) { >- if (!forbiddenClosingTag) { >+ if (!DOMTreeElement.ForbiddenClosingTagElements.has(this.representedObject.nodeNameInCorrectCase())) { > subMenus.add.appendItem(WI.UIString("Child", "A submenu item of 'Add' to append DOM nodes to the selected DOM node"), () => { > this._addHTML(); >- }); >+ }, alreadyEditingHTML); > } > > subMenus.add.appendItem(WI.UIString("Previous Sibling", "A submenu item of 'Add' to add DOM nodes before the selected DOM node"), () => { > this._addPreviousSibling(); >- }); >+ }, alreadyEditingHTML); > > subMenus.add.appendItem(WI.UIString("Next Sibling", "A submenu item of 'Add' to add DOM nodes after the selected DOM node"), () => { > this._addNextSibling(); >- }); >+ }, alreadyEditingHTML); > } > > if (isNonShadowEditable) { >@@ -787,25 +787,29 @@ WI.DOMTreeElement = class DOMTreeElement extends WI.TreeElement > if (this.editable) { > subMenus.edit.appendItem(WI.UIString("HTML"), () => { > this._editAsHTML(); >- }); >+ }, alreadyEditingHTML); > } > > if (isNonShadowEditable) { > if (attributeName) { > subMenus.edit.appendItem(WI.UIString("Attribute"), () => { >- this._startEditingAttribute(attribute, event.target); >- }); >+ this._startEditingAttribute(attributeNode, event.target); >+ }, WI.isBeingEdited(attributeNode)); > } > >- subMenus.edit.appendItem(WI.UIString("Tag", "A submenu item of 'Edit' to change DOM element's tag name"), () => { >- this._startEditingTagName(); >- }); >+ if (!DOMTreeElement.EditTagBlacklist.has(this.representedObject.nodeNameInCorrectCase())) { >+ let tagNameNode = event.target.closest(".html-tag-name"); >+ >+ subMenus.edit.appendItem(WI.UIString("Tag", "A submenu item of 'Edit' to change DOM element's tag name"), () => { >+ this._startEditingTagName(tagNameNode); >+ }, WI.isBeingEdited(tagNameNode)); >+ } > } > > if (textNode && this.editable) { > subMenus.edit.appendItem(WI.UIString("Text"), () => { > this._startEditingTextNode(textNode); >- }); >+ }, WI.isBeingEdited(textNode)); > } > > if (!this.representedObject.isPseudoElement()) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199052
:
372566
| 372591