Bug 77619

Summary: Web Inspector: Introduce "Copy XPath" popup menu item for DOM elements
Product: WebKit Reporter: Alexander Pavlov (apavlov) <apavlov>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 77749    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch vsevik: review+

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>