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

Issue 2882193002: [devtools] Add DOMSnapshot domain for dom+layout+style snapshots. (Closed)

Created:
3 years, 7 months ago by Eric Seckler
Modified:
3 years, 6 months ago
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, kinuko+watch, kozyatinskiy+blink_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[devtools] Add DOMSnapshot domain for dom+layout+style snapshots. Introduces a new DOMSnapshot.getSnapshot command, which returns a flattened dom tree together with layout objects and computed styles. By combining all trees in one command's result, we avoid the potential for inconsistencies between them. The patch also removes the unused DomTreeExtractor wrapper in headless/. In a subsequent patch, we'll further remove the now obsolete FlatDomTreeExtractor and CSS.getLayoutTreeAndStyles. BUG=546953 Review-Url: https://codereview.chromium.org/2882193002 Cr-Commit-Position: refs/heads/master@{#478513} Committed: https://chromium.googlesource.com/chromium/src/+/5a101abbe0fd58cfa3fdadfeacde86c8dd108ec7

Patch Set 1 #

Patch Set 2 : add domain to schema agent #

Total comments: 4

Patch Set 3 : move to CSS domain, remove getLayoutTreeAndStyles #

Total comments: 3

Patch Set 4 : back to DOMSnapshot domain, with custom node types + traversal. #

Total comments: 21

Patch Set 5 : address comments #

Patch Set 6 : revert removal of getLayoutTreeAndStyles #

Patch Set 7 : rebase #

Patch Set 8 : rebase #

Total comments: 4

Patch Set 9 : add todo #

Total comments: 2

Patch Set 10 : move aux properties back to node type #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3602 lines, -1157 lines) Patch
M content/browser/devtools/protocol/schema_handler.cc View 1 2 3 1 chunk +9 lines, -31 lines 0 comments Download
M headless/BUILD.gn View 1 2 3 4 5 6 7 8 9 3 chunks +1 line, -3 lines 0 comments Download
M headless/lib/browser/headless_devtools_client_impl.h View 1 2 3 3 chunks +4 lines, -1 line 0 comments Download
M headless/lib/browser/headless_devtools_client_impl.cc View 1 2 3 2 chunks +8 lines, -3 lines 0 comments Download
M headless/lib/headless_devtools_client_browsertest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +1052 lines, -0 lines 0 comments Download
M headless/public/headless_devtools_client.h View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
D headless/public/util/dom_tree_extractor.h View 1 2 1 chunk +0 lines, -90 lines 0 comments Download
D headless/public/util/dom_tree_extractor.cc View 1 2 1 chunk +0 lines, -109 lines 0 comments Download
D headless/public/util/dom_tree_extractor_browsertest.cc View 1 2 1 chunk +0 lines, -918 lines 0 comments Download
M third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/FlagExpectations/root-layer-scrolls View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.html View 1 2 3 4 5 1 chunk +63 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-expected.txt View 1 2 3 4 5 6 7 8 9 1 chunk +1904 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/BUILD.gn View 1 2 3 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
A third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.h View 1 2 3 4 1 chunk +86 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +380 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/browser_protocol.json View 1 2 3 4 5 6 7 8 9 1 chunk +75 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/inspector/inspector_protocol_config.json View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 58 (35 generated)
Eric Seckler
I'm also happy to later remove the getFlattenedDocument and getLayoutTreeAndStyles commands from the public DevTools ...
3 years, 7 months ago (2017-05-15 10:10:43 UTC) #4
alex clarke (OOO till 29th)
non owner LGTM
3 years, 7 months ago (2017-05-15 10:18:36 UTC) #5
pfeldman
https://codereview.chromium.org/2882193002/diff/20001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp (right): https://codereview.chromium.org/2882193002/diff/20001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp#newcode2305 third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp:2305: Response InspectorCSSAgent::getLayoutTreeAndStyles( Do we still need it? https://codereview.chromium.org/2882193002/diff/20001/third_party/WebKit/Source/core/inspector/browser_protocol.json File ...
3 years, 7 months ago (2017-05-15 18:42:18 UTC) #12
Eric Seckler
Thanks, Pavel! https://codereview.chromium.org/2882193002/diff/20001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp File third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp (right): https://codereview.chromium.org/2882193002/diff/20001/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp#newcode2305 third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp:2305: Response InspectorCSSAgent::getLayoutTreeAndStyles( On 2017/05/15 18:42:18, pfeldman wrote: ...
3 years, 7 months ago (2017-05-17 10:44:31 UTC) #13
pfeldman
> Ah, I see. I think the only thing that's not really necessary for headless ...
3 years, 7 months ago (2017-05-18 20:12:27 UTC) #14
Eric Seckler
On 2017/05/18 20:12:27, pfeldman wrote: > > Ah, I see. I think the only thing ...
3 years, 7 months ago (2017-05-19 15:57:16 UTC) #15
pfeldman
> > Ideally, I think, we'd put the snapshot command in the DOM domain (where ...
3 years, 7 months ago (2017-05-19 23:21:12 UTC) #16
Eric Seckler
On 2017/05/19 23:21:12, pfeldman wrote: > Ah, you are asking all the right and tough ...
3 years, 7 months ago (2017-05-22 10:26:05 UTC) #17
alex clarke (OOO till 29th)
Still LGTM
3 years, 7 months ago (2017-05-22 13:27:42 UTC) #21
Eric Seckler
Pavel, friendly ping :)
3 years, 7 months ago (2017-05-25 08:03:04 UTC) #22
pfeldman
https://codereview.chromium.org/2882193002/diff/40001/third_party/WebKit/Source/core/inspector/browser_protocol.json File third_party/WebKit/Source/core/inspector/browser_protocol.json (right): https://codereview.chromium.org/2882193002/diff/40001/third_party/WebKit/Source/core/inspector/browser_protocol.json#newcode3002 third_party/WebKit/Source/core/inspector/browser_protocol.json:3002: { "name": "nodeId", "$ref": "DOM.NodeId", "description": "The id of ...
3 years, 6 months ago (2017-05-31 17:56:37 UTC) #23
Eric Seckler
Based on our offline chat, I moved the snapshot command back into the DOMSnapshot domain ...
3 years, 6 months ago (2017-06-06 15:01:27 UTC) #24
Eric Seckler
+dgozman - thanks! :)
3 years, 6 months ago (2017-06-06 21:51:31 UTC) #26
pfeldman
I like this a lot. Some comments below, but overall looks very good. https://codereview.chromium.org/2882193002/diff/60001/content/browser/devtools/protocol/schema_handler.cc File ...
3 years, 6 months ago (2017-06-06 22:54:29 UTC) #27
Eric Seckler
Thanks! PTAL. Alex, probably makes sense for you to take another peek, too. FYI, I ...
3 years, 6 months ago (2017-06-07 10:23:37 UTC) #28
alex clarke (OOO till 29th)
Still looks fine functionality wise although I didn't do a detailed review. https://codereview.chromium.org/2882193002/diff/140001/headless/lib/headless_devtools_client_browsertest.cc File headless/lib/headless_devtools_client_browsertest.cc ...
3 years, 6 months ago (2017-06-07 12:56:44 UTC) #41
Eric Seckler
thanks! https://codereview.chromium.org/2882193002/diff/140001/headless/lib/headless_devtools_client_browsertest.cc File headless/lib/headless_devtools_client_browsertest.cc (right): https://codereview.chromium.org/2882193002/diff/140001/headless/lib/headless_devtools_client_browsertest.cc#newcode1328 headless/lib/headless_devtools_client_browsertest.cc:1328: const std::vector<std::string> expected_dom_nodes = { On 2017/06/07 12:56:44, ...
3 years, 6 months ago (2017-06-07 13:05:17 UTC) #42
pfeldman
devtools lgtm https://codereview.chromium.org/2882193002/diff/160001/third_party/WebKit/Source/core/inspector/browser_protocol.json File third_party/WebKit/Source/core/inspector/browser_protocol.json (right): https://codereview.chromium.org/2882193002/diff/160001/third_party/WebKit/Source/core/inspector/browser_protocol.json#newcode3356 third_party/WebKit/Source/core/inspector/browser_protocol.json:3356: "id": "AuxiliaryProperties", There is no point in ...
3 years, 6 months ago (2017-06-07 21:33:35 UTC) #43
Eric Seckler
Thanks, Pavel! :) https://codereview.chromium.org/2882193002/diff/160001/third_party/WebKit/Source/core/inspector/browser_protocol.json File third_party/WebKit/Source/core/inspector/browser_protocol.json (right): https://codereview.chromium.org/2882193002/diff/160001/third_party/WebKit/Source/core/inspector/browser_protocol.json#newcode3356 third_party/WebKit/Source/core/inspector/browser_protocol.json:3356: "id": "AuxiliaryProperties", On 2017/06/07 21:33:35, pfeldman ...
3 years, 6 months ago (2017-06-09 13:01:54 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2882193002/180001
3 years, 6 months ago (2017-06-09 15:12:16 UTC) #51
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/475451)
3 years, 6 months ago (2017-06-09 17:19:47 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2882193002/180001
3 years, 6 months ago (2017-06-10 09:02:50 UTC) #55
commit-bot: I haz the power
3 years, 6 months ago (2017-06-10 09:46:26 UTC) #58
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/5a101abbe0fd58cfa3fdadfeacde...

Powered by Google App Engine
This is Rietveld 408576698