Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Issue 75253002: DevTools: [Elements] Implement "Copy CSS Path" context menu item for elements (Closed)

Created:
7 years, 1 month ago by apavlov
Modified:
7 years, 1 month ago
CC:
blink-reviews, caseq+blink_chromium.org, loislo+blink_chromium.org, eustas+blink_chromium.org, alph+blink_chromium.org, yurys+blink_chromium.org, lushnikov+blink_chromium.org, vsevik+blink_chromium.org, pfeldman+blink_chromium.org, paulirish+reviews_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, aandrey+blink_chromium.org
Visibility:
Public.

Description

DevTools: [Elements] Implement "Copy CSS Path" context menu item for elements R=pfeldman, vsevik, aandrey, eustas BUG=277286 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162552

Patch Set 1 #

Total comments: 17

Patch Set 2 : Comments addressed #

Total comments: 6

Patch Set 3 : Fixed leading/trailing spaces in the "class" attribute #

Patch Set 4 : Improve JsDoc #

Total comments: 2

Patch Set 5 : Use Boolean filter #

Patch Set 6 : Protect from ridiculous IDs #

Total comments: 5

Patch Set 7 : Implement identifier escaping for id and class attribute values #

Total comments: 18

Patch Set 8 : Move CSS path-building code from DOMAgent to DOMPresentationUtils, reuse in DOMNode.appropriateSeleā€¦ #

Total comments: 10

Patch Set 9 : More comments addressed, __proto__ bug fixed #

Total comments: 2

Patch Set 10 : Resolve the module dependency issue #

Patch Set 11 : Move XPath construction into DOMPresentationUtils #

Patch Set 12 : Tentatively fix xpath test on Windows bot #

Unified diffs Side-by-side diffs Delta from patch set Stats (+511 lines, -159 lines) Patch
A LayoutTests/inspector/elements/elements-css-path.html View 1 2 3 4 5 6 7 8 9 1 chunk +120 lines, -0 lines 0 comments Download
A LayoutTests/inspector/elements/elements-css-path-expected.txt View 1 2 3 4 5 6 7 8 1 chunk +55 lines, -0 lines 0 comments Download
M LayoutTests/inspector/elements/inspect-deep-shadow-element.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/inspector/elements/node-xpath.xhtml View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -3 lines 0 comments Download
M LayoutTests/inspector/elements/node-xpath-expected.txt View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download
M Source/devtools/front_end/DOMAgent.js View 1 2 3 4 5 6 7 8 9 10 3 chunks +0 lines, -141 lines 0 comments Download
M Source/devtools/front_end/DOMPresentationUtils.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +320 lines, -10 lines 0 comments Download
M Source/devtools/front_end/ElementsTreeOutline.js View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -2 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
apavlov
7 years, 1 month ago (2013-11-18 13:12:33 UTC) #1
aandrey
https://codereview.chromium.org/75253002/diff/1/LayoutTests/inspector/elements/elements-css-path.html File LayoutTests/inspector/elements/elements-css-path.html (right): https://codereview.chromium.org/75253002/diff/1/LayoutTests/inspector/elements/elements-css-path.html#newcode10 LayoutTests/inspector/elements/elements-css-path.html:10: var doc; make this a local var of the ...
7 years, 1 month ago (2013-11-18 13:43:50 UTC) #2
apavlov
https://codereview.chromium.org/75253002/diff/1/LayoutTests/inspector/elements/elements-css-path.html File LayoutTests/inspector/elements/elements-css-path.html (right): https://codereview.chromium.org/75253002/diff/1/LayoutTests/inspector/elements/elements-css-path.html#newcode10 LayoutTests/inspector/elements/elements-css-path.html:10: var doc; On 2013/11/18 13:43:51, aandrey wrote: > make ...
7 years, 1 month ago (2013-11-18 15:03:58 UTC) #3
aandrey
https://codereview.chromium.org/75253002/diff/1/Source/devtools/front_end/DOMAgent.js File Source/devtools/front_end/DOMAgent.js (right): https://codereview.chromium.org/75253002/diff/1/Source/devtools/front_end/DOMAgent.js#newcode724 Source/devtools/front_end/DOMAgent.js:724: var uniqueClassNamesArray = (this.getAttribute("class") || "").split(/\s+/g); On 2013/11/18 15:03:59, ...
7 years, 1 month ago (2013-11-18 15:15:56 UTC) #4
aandrey
https://codereview.chromium.org/75253002/diff/70001/LayoutTests/inspector/elements/elements-css-path.html File LayoutTests/inspector/elements/elements-css-path.html (right): https://codereview.chromium.org/75253002/diff/70001/LayoutTests/inspector/elements/elements-css-path.html#newcode16 LayoutTests/inspector/elements/elements-css-path.html:16: InspectorTest.runTestSuite([ I thought every function passed to the suite ...
7 years, 1 month ago (2013-11-18 15:36:25 UTC) #5
apavlov
On 2013/11/18 15:15:56, aandrey wrote: > https://codereview.chromium.org/75253002/diff/1/Source/devtools/front_end/DOMAgent.js > File Source/devtools/front_end/DOMAgent.js (right): > > https://codereview.chromium.org/75253002/diff/1/Source/devtools/front_end/DOMAgent.js#newcode724 > ...
7 years, 1 month ago (2013-11-18 15:36:53 UTC) #6
aandrey
https://codereview.chromium.org/75253002/diff/70001/Source/devtools/front_end/DOMAgent.js File Source/devtools/front_end/DOMAgent.js (right): https://codereview.chromium.org/75253002/diff/70001/Source/devtools/front_end/DOMAgent.js#newcode772 Source/devtools/front_end/DOMAgent.js:772: result += ":nth-child(" + (ownIndex + 1) + ")"; ...
7 years, 1 month ago (2013-11-18 15:43:05 UTC) #7
aandrey
https://codereview.chromium.org/75253002/diff/180001/Source/devtools/front_end/DOMAgent.js File Source/devtools/front_end/DOMAgent.js (right): https://codereview.chromium.org/75253002/diff/180001/Source/devtools/front_end/DOMAgent.js#newcode713 Source/devtools/front_end/DOMAgent.js:713: return new WebInspector.DOMNode.PathStep("#" + this.getAttribute("id"), true); "id" can contain ...
7 years, 1 month ago (2013-11-18 16:27:21 UTC) #8
apavlov
On 2013/11/18 16:27:21, aandrey wrote: > https://codereview.chromium.org/75253002/diff/180001/Source/devtools/front_end/DOMAgent.js > File Source/devtools/front_end/DOMAgent.js (right): > > https://codereview.chromium.org/75253002/diff/180001/Source/devtools/front_end/DOMAgent.js#newcode713 > ...
7 years, 1 month ago (2013-11-19 06:07:45 UTC) #9
aandrey
On 2013/11/19 06:07:45, apavlov wrote: > On 2013/11/18 16:27:21, aandrey wrote: > > > https://codereview.chromium.org/75253002/diff/180001/Source/devtools/front_end/DOMAgent.js ...
7 years, 1 month ago (2013-11-19 07:53:32 UTC) #10
apavlov
On 2013/11/19 07:53:32, aandrey wrote: > On 2013/11/19 06:07:45, apavlov wrote: > > On 2013/11/18 ...
7 years, 1 month ago (2013-11-19 10:34:48 UTC) #11
aandrey
https://codereview.chromium.org/75253002/diff/260001/Source/devtools/front_end/DOMAgent.js File Source/devtools/front_end/DOMAgent.js (right): https://codereview.chromium.org/75253002/diff/260001/Source/devtools/front_end/DOMAgent.js#newcode761 Source/devtools/front_end/DOMAgent.js:761: var hasQuotes = /"/.test(id); indexOf https://codereview.chromium.org/75253002/diff/260001/Source/devtools/front_end/DOMAgent.js#newcode762 Source/devtools/front_end/DOMAgent.js:762: var hasApostrophes ...
7 years, 1 month ago (2013-11-19 11:11:17 UTC) #12
aandrey
https://codereview.chromium.org/75253002/diff/260001/Source/devtools/front_end/DOMAgent.js File Source/devtools/front_end/DOMAgent.js (right): https://codereview.chromium.org/75253002/diff/260001/Source/devtools/front_end/DOMAgent.js#newcode757 Source/devtools/front_end/DOMAgent.js:757: if (/^[A-Za-z0-9_-]+$/.test(id)) FYI. document.querySelectorAll("#---") ===> SyntaxError: Failed to execute ...
7 years, 1 month ago (2013-11-19 11:15:08 UTC) #13
aandrey
On 2013/11/19 11:15:08, aandrey wrote: > https://codereview.chromium.org/75253002/diff/260001/Source/devtools/front_end/DOMAgent.js > File Source/devtools/front_end/DOMAgent.js (right): > > https://codereview.chromium.org/75253002/diff/260001/Source/devtools/front_end/DOMAgent.js#newcode757 > ...
7 years, 1 month ago (2013-11-19 11:16:10 UTC) #14
aandrey
On 2013/11/19 11:16:10, aandrey wrote: > On 2013/11/19 11:15:08, aandrey wrote: > > > https://codereview.chromium.org/75253002/diff/260001/Source/devtools/front_end/DOMAgent.js ...
7 years, 1 month ago (2013-11-19 11:30:23 UTC) #15
apavlov
On 2013/11/19 11:30:23, aandrey wrote: > On 2013/11/19 11:16:10, aandrey wrote: > > On 2013/11/19 ...
7 years, 1 month ago (2013-11-20 09:12:41 UTC) #16
aandrey
overall looks good, but I think my tests won't pass https://codereview.chromium.org/75253002/diff/350001/LayoutTests/inspector/elements/elements-css-path.html File LayoutTests/inspector/elements/elements-css-path.html (right): https://codereview.chromium.org/75253002/diff/350001/LayoutTests/inspector/elements/elements-css-path.html#newcode34 ...
7 years, 1 month ago (2013-11-20 12:49:02 UTC) #17
aandrey
> Implemented identifier escaping for ids and classes, since you cannot do > [class="foo, bar"] ...
7 years, 1 month ago (2013-11-20 12:50:59 UTC) #18
aandrey
On 2013/11/20 12:50:59, aandrey wrote: > > Implemented identifier escaping for ids and classes, since ...
7 years, 1 month ago (2013-11-20 12:54:24 UTC) #19
apavlov
https://codereview.chromium.org/75253002/diff/350001/Source/devtools/front_end/DOMAgent.js File Source/devtools/front_end/DOMAgent.js (right): https://codereview.chromium.org/75253002/diff/350001/Source/devtools/front_end/DOMAgent.js#newcode769 Source/devtools/front_end/DOMAgent.js:769: var shouldEscapeFirst = /^(?:[0-9]|-[0-9-]?)/.test(ident); On 2013/11/20 12:49:02, aandrey wrote: ...
7 years, 1 month ago (2013-11-20 13:15:27 UTC) #20
apavlov
On 2013/11/20 12:54:24, aandrey wrote: > On 2013/11/20 12:50:59, aandrey wrote: > > > Implemented ...
7 years, 1 month ago (2013-11-20 13:17:12 UTC) #21
apavlov
On 2013/11/20 12:49:02, aandrey wrote: > overall looks good, but I think my tests won't ...
7 years, 1 month ago (2013-11-20 13:51:03 UTC) #22
pfeldman
https://codereview.chromium.org/75253002/diff/350001/Source/devtools/front_end/DOMAgent.js File Source/devtools/front_end/DOMAgent.js (right): https://codereview.chromium.org/75253002/diff/350001/Source/devtools/front_end/DOMAgent.js#newcode696 Source/devtools/front_end/DOMAgent.js:696: cssPath: function(optimized) This interesting little feature is about to ...
7 years, 1 month ago (2013-11-20 14:08:48 UTC) #23
apavlov
https://codereview.chromium.org/75253002/diff/350001/Source/devtools/front_end/DOMAgent.js File Source/devtools/front_end/DOMAgent.js (right): https://codereview.chromium.org/75253002/diff/350001/Source/devtools/front_end/DOMAgent.js#newcode696 Source/devtools/front_end/DOMAgent.js:696: cssPath: function(optimized) On 2013/11/20 14:08:48, pfeldman wrote: > This ...
7 years, 1 month ago (2013-11-20 14:23:18 UTC) #24
aandrey
https://codereview.chromium.org/75253002/diff/350001/Source/devtools/front_end/DOMAgent.js File Source/devtools/front_end/DOMAgent.js (right): https://codereview.chromium.org/75253002/diff/350001/Source/devtools/front_end/DOMAgent.js#newcode769 Source/devtools/front_end/DOMAgent.js:769: var shouldEscapeFirst = /^(?:[0-9]|-[0-9-]?)/.test(ident); On 2013/11/20 13:15:28, apavlov wrote: ...
7 years, 1 month ago (2013-11-20 16:20:48 UTC) #25
apavlov
https://codereview.chromium.org/75253002/diff/350001/Source/devtools/front_end/DOMAgent.js File Source/devtools/front_end/DOMAgent.js (right): https://codereview.chromium.org/75253002/diff/350001/Source/devtools/front_end/DOMAgent.js#newcode769 Source/devtools/front_end/DOMAgent.js:769: var shouldEscapeFirst = /^(?:[0-9]|-[0-9-]?)/.test(ident); On 2013/11/20 16:20:49, aandrey wrote: ...
7 years, 1 month ago (2013-11-21 07:31:34 UTC) #26
aandrey
https://codereview.chromium.org/75253002/diff/520001/Source/devtools/front_end/DOMAgent.js File Source/devtools/front_end/DOMAgent.js (right): https://codereview.chromium.org/75253002/diff/520001/Source/devtools/front_end/DOMAgent.js#newcode675 Source/devtools/front_end/DOMAgent.js:675: var step = WebInspector.DOMPresentationUtils.cssPathValue(contextNode, optimized); there is a dependency ...
7 years, 1 month ago (2013-11-21 10:17:32 UTC) #27
apavlov
On 2013/11/21 10:17:32, aandrey wrote: > https://codereview.chromium.org/75253002/diff/520001/Source/devtools/front_end/DOMAgent.js > File Source/devtools/front_end/DOMAgent.js (right): > > https://codereview.chromium.org/75253002/diff/520001/Source/devtools/front_end/DOMAgent.js#newcode675 > ...
7 years, 1 month ago (2013-11-22 12:54:28 UTC) #28
aandrey
LGTM. Thank you for your patience!
7 years, 1 month ago (2013-11-22 13:21:15 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/apavlov@chromium.org/75253002/630001
7 years, 1 month ago (2013-11-22 13:23:55 UTC) #30
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=18447
7 years, 1 month ago (2013-11-22 16:02:45 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/apavlov@chromium.org/75253002/810001
7 years, 1 month ago (2013-11-22 17:05:11 UTC) #32
commit-bot: I haz the power
7 years, 1 month ago (2013-11-22 18:05:15 UTC) #33
Message was sent while issue was closed.
Change committed as 162552

Powered by Google App Engine
This is Rietveld 408576698