Bug 104902

Summary: Web Inspector: "Add Attribute" context menu on closing tag should apply on the opening tag on Elements Panel
Product: WebKit Reporter: Vivek Galatage <vivekg>
Component: Web Inspector (Deprecated)Assignee: Vivek Galatage <vivek.vg>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, keishi, loislo, pfeldman, pmuellr, vsevik, web-inspector-bugs, webkit.review.bot, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Vivek Galatage
Reported 2012-12-13 04:14:04 PST
Web Inspector: "Add Attribute" context menu shouldn't appear on closing tag on Elements Panel. Steps: 1. Open any page with inspector open 2. Navigate to Elements panel 3. Expand some nodes so you can view the closing tag separately 4. Perform action (right click for linux/windows) to open context menu on the Closing Tag. 5. "Add Attribute" context menu item is shown 6. Go ahead with adding some attribute value 7. The attribute is seen even on the closing tag e.g. <div id="test"> ... </div id="test"> Expected: The "Add Attribute" on a closing tag shouldn't be shown Patch to follow.
Attachments
Patch (2.06 KB, patch)
2012-12-13 04:17 PST, Vivek Galatage
no flags
Patch (2.55 KB, patch)
2012-12-13 04:59 PST, Vivek Galatage
no flags
Patch (2.55 KB, patch)
2012-12-13 06:41 PST, Vivek Galatage
no flags
Vivek Galatage
Comment 1 2012-12-13 04:17:28 PST
Alexander Pavlov (apavlov)
Comment 2 2012-12-13 04:26:19 PST
Perhaps, instead of forbidding to add attributes on the closing tag, we might automatically add them to the opening tag? If |this| is the closing tag, you can bind this._addNewAttribute() to the opening tag using this.findTreeElement(this.representedObject), something like this: contextMenu.appendItem(..., this._addNewAttribute.bind(this._elementCloseTag ? this.treeOutline.findTreeElement(this.representedObject) : this));
Vivek Galatage
Comment 3 2012-12-13 04:59:27 PST
Alexander Pavlov (apavlov)
Comment 4 2012-12-13 05:05:42 PST
Comment on attachment 179252 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=179252&action=review The code looks good, just a minor ChangeLog fix is needed. > Source/WebCore/ChangeLog:8 > + The context menu action on the Closing Tag takes to the Opening tag for adding the attribute. There should be no caps in the middle of the sentence. Also, "takes" -> "scrolls to" > Source/WebCore/ChangeLog:10 > + No new tests as UI tweak. No new tests, as this is a UI change. (I've seen a guideline somewhere that imposes the use of common English rather than slang-ish/ambiguous terms, like "tweak".)
Vivek Galatage
Comment 5 2012-12-13 06:41:04 PST
Alexander Pavlov (apavlov)
Comment 6 2012-12-13 06:52:18 PST
Comment on attachment 179264 [details] Patch r=me
WebKit Review Bot
Comment 7 2012-12-13 07:25:22 PST
Comment on attachment 179264 [details] Patch Clearing flags on attachment: 179264 Committed r137594: <http://trac.webkit.org/changeset/137594>
WebKit Review Bot
Comment 8 2012-12-13 07:25:26 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.