Bug 16258 - Web Inspector should highlight when clicking a node's closing tag
Summary: Web Inspector should highlight when clicking a node's closing tag
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Enhancement
Assignee: Alexander Pavlov (apavlov)
Keywords: InRadar
Depends on:
Reported: 2007-12-02 11:18 PST by Matt Lilek
Modified: 2010-03-29 10:13 PDT (History)
3 users (show)

See Also:

[PATCH] Proposed solution (12.62 KB, patch)
2010-03-23 09:42 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
[PATCH] Merged conflicting changes (14.55 KB, patch)
2010-03-24 10:54 PDT, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
[PATCH] Fixed test failure (16.97 KB, patch)
2010-03-25 05:19 PDT, Alexander Pavlov (apavlov)
pfeldman: review-
Details | Formatted Diff | Diff
[PATCH] Removed an odd method (13.92 KB, patch)
2010-03-26 07:46 PDT, Alexander Pavlov (apavlov)
pfeldman: review+
pfeldman: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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