Bug 16258

Summary: Web Inspector should highlight when clicking a node's closing tag
Product: WebKit Reporter: Matt Lilek <dev+webkit>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Severity: Enhancement CC: eric, pfeldman, timothy
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
[PATCH] Proposed solution
[PATCH] Merged conflicting changes
[PATCH] Fixed test failure
pfeldman: review-
[PATCH] Removed an odd method pfeldman: review+, pfeldman: commit-queue-

Description Matt Lilek 2007-12-02 11:18:22 PST
Right now, in the web inspector, if you click an element's closing tag in the tree list, nothing happens. We should at least select or point to the opening tag for it, but it would be awesome if we did some kind of spiffy highlighting or something - maybe like XCode 3 does? http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/art/code_focus.jpg
Comment 1 Timothy Hatcher 2007-12-02 13:36:09 PST
I think jumping to the open tag would be good. We would need to not do this when arrowing through the tree.
Comment 2 Adam Roben (:aroben) 2008-01-29 11:06:20 PST
Comment 3 Eric Fields 2009-04-30 08:05:56 PDT

This specifically references Inspect > Elements.

To reiterate, clicking on a closing tag should have the exact same behavior to clicking on the opening tag: highlight, get all applied CSS styles, DOM path…
Comment 4 Alexander Pavlov (apavlov) 2010-03-23 09:42:09 PDT
Created attachment 51430 [details]
[PATCH] Proposed solution

The closing tag itself is selected when clicked/keyboard-traversed.
Comment 5 Alexander Pavlov (apavlov) 2010-03-24 10:54:36 PDT
Created attachment 51524 [details]
[PATCH] Merged conflicting changes
Comment 6 Alexander Pavlov (apavlov) 2010-03-25 05:19:34 PDT
Created attachment 51630 [details]
[PATCH] Fixed test failure
Comment 7 Pavel Feldman 2010-03-25 10:08:37 PDT
Comment on attachment 51630 [details]
[PATCH] Fixed test failure

As we agreed verbally, let us remove the singleOrPairedTreeElements method. It would simplify code a lot, while the only thing we would lose is highlighting closing tag as a part of search results.
Comment 8 Alexander Pavlov (apavlov) 2010-03-26 07:46:25 PDT
Created attachment 51740 [details]
[PATCH] Removed an odd method
Comment 9 Pavel Feldman 2010-03-28 05:26:24 PDT
Comment on attachment 51740 [details]
[PATCH] Removed an odd method

> +WebInspector.ElementsTreeElement = function(node, elementCloseTag)

Please merge it carefully with Joe's changes.

>  {
> -    var hasChildrenOverride = node.hasChildNodes() && !this._showInlineText(node);
> +    this.elementCloseTag = elementCloseTag;


> -        if (this._expandedChildrenLimit === x)
> +        if (this._expandedChildrenLimit === x || this.elementCloseTag)

Why this change?
Comment 10 Alexander Pavlov (apavlov) 2010-03-29 10:13:53 PDT
Code merged, comments addressed.

Committing to http://svn.webkit.org/repository/webkit/trunk ...
        M       LayoutTests/ChangeLog
        M       LayoutTests/inspector/elements-panel-limited-children.html
        M       WebCore/ChangeLog
        M       WebCore/inspector/front-end/ElementsTreeOutline.js
Committed r56727