Bug 77619 - Web Inspector: Introduce "Copy XPath" popup menu item for DOM elements
Summary: Web Inspector: Introduce "Copy XPath" popup menu item for DOM elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on: 77749
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-02 02:11 PST by Alexander Pavlov (apavlov)
Modified: 2012-02-03 10:03 PST (History)
10 users (show)

See Also:


Attachments
Patch (12.09 KB, patch)
2012-02-02 08:02 PST, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
Patch (12.13 KB, patch)
2012-02-03 08:19 PST, Alexander Pavlov (apavlov)
vsevik: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov (apavlov) 2012-02-02 02:11:36 PST
Patch to follow
Comment 1 Alexander Pavlov (apavlov) 2012-02-02 08:02:33 PST
Created attachment 125134 [details]
Patch
Comment 2 Vsevolod Vlasov 2012-02-03 08:04:09 PST
Comment on attachment 125134 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=125134&action=review

> Source/WebCore/inspector/front-end/DOMAgent.js:539
> +    xPathValue: function(optimized)

Should be private as well as _xPathIndex()?

> Source/WebCore/inspector/front-end/DOMAgent.js:549
> +                return new  WebInspector.DOMNode.XPathStep("//*[@id=\"" + this.getAttribute("id") + "\"]", true);

double space between new and WebInspector.

> Source/WebCore/inspector/front-end/DOMAgent.js:580
> +     * @return -1 in case of error, 0 if no siblings matching the same expression, <XPath index among the same expression-matching sibling nodes> otherwise.

Please add type annotation here and move description to a separate comment inside function.

> Source/WebCore/inspector/front-end/ElementsTreeOutline.js:1710
> +        this.representedObject.copyXPath(true);

Please add this argument to copyXPath() method, r- for that.
Comment 3 Alexander Pavlov (apavlov) 2012-02-03 08:19:17 PST
Created attachment 125333 [details]
Patch
Comment 4 Vsevolod Vlasov 2012-02-03 08:25:06 PST
Comment on attachment 125333 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=125333&action=review

> Source/WebCore/inspector/front-end/DOMAgent.js:300
> +    copyXPath: function(optimized)

Please add @param annotation for optimized.

> Source/WebCore/inspector/front-end/DOMAgent.js:520
> +    xPath: function(optimized)

ditto

> Source/WebCore/inspector/front-end/DOMAgent.js:544
> +    _xPathValue: function(optimized)

ditto
Comment 5 Alexander Pavlov (apavlov) 2012-02-03 08:43:44 PST
Committed r106664: <http://trac.webkit.org/changeset/106664>