Commit a4406936 authored by Erik Hendriks's avatar Erik Hendriks Committed by Commit Bot

Add title and document content width/height to DOMSnapshot.captureSnapshot results.

Add a test to see that misc details are showing up ok. Also, make
stabilization of the string table in the pseudo element test more
robust.

Change-Id: I3e5500c8095f41e4dc15ce3d6181c9fa8c5d33a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827180
Commit-Queue: Erik Hendriks <hendriks@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701328}
parent ba0a4527
......@@ -2400,6 +2400,8 @@ experimental domain DOMSnapshot
properties
# Document URL that `Document` or `FrameOwner` node points to.
StringIndex documentURL
# Document title.
StringIndex title
# Base URL that `Document` or `FrameOwner` node uses for URL completion.
StringIndex baseURL
# Contains the document's content language.
......@@ -2422,6 +2424,10 @@ experimental domain DOMSnapshot
optional number scrollOffsetX
# Vertical scroll offset.
optional number scrollOffsetY
# Document content width.
optional number contentWidth
# Document content height.
optional number contentHeight
# Table containing nodes.
type NodeTreeSnapshot extends object
......
......@@ -324,6 +324,7 @@ void InspectorDOMSnapshotAgent::VisitDocument(Document* document) {
AddString(InspectorDOMAgent::DocumentURLString(document)))
.setBaseURL(
AddString(InspectorDOMAgent::DocumentBaseURLString(document)))
.setTitle(AddString(document->title()))
.setContentLanguage(AddString(document->ContentLanguage()))
.setEncodingName(AddString(document->EncodingName()))
.setFrameId(
......@@ -373,6 +374,9 @@ void InspectorDOMSnapshotAgent::VisitDocument(Document* document) {
auto offset = document->View()->LayoutViewport()->GetScrollOffset();
document_->setScrollOffsetX(offset.Width());
document_->setScrollOffsetY(offset.Height());
auto contents_size = document->View()->LayoutViewport()->ContentsSize();
document_->setContentWidth(contents_size.Width());
document_->setContentHeight(contents_size.Height());
}
if (paint_order_map_) {
......
Tests that DOMSnapshot.captureSnapshot fills document details: title, size, etc.
{
documents : [
[0] : {
baseURL : 1
contentHeight : 2000
contentLanguage : 3
contentWidth : 2000
documentURL : <number>
encodingName : 4
frameId : <number>
layout : {
bounds : [
[0] : [
[0] : 0
[1] : 0
[2] : 800
[3] : 600
]
[1] : [
[0] : 0
[1] : 0
[2] : 785
[3] : 2000
]
[2] : [
[0] : 0
[1] : 0
[2] : 785
[3] : 2000
]
[3] : [
[0] : 0
[1] : 0
[2] : 2000
[3] : 2000
]
[4] : [
[0] : 0
[1] : 0
[2] : 190
[3] : 10
]
]
nodeIndex : [
[0] : 0
[1] : 2
[2] : 15
[3] : 17
[4] : 18
]
stackingContexts : {
index : [
[0] : 0
[1] : 1
]
}
styles : [
[0] : [
]
[1] : [
]
[2] : [
]
[3] : [
]
[4] : [
]
]
text : [
[0] : -1
[1] : -1
[2] : -1
[3] : -1
[4] : 31
]
}
nodes : {
attributes : [
[0] : [
]
[1] : [
]
[2] : [
]
[3] : [
]
[4] : [
]
[5] : [
]
[6] : [
]
[7] : [
]
[8] : [
[0] : 16
[1] : 17
[2] : 18
[3] : 19
]
[9] : [
]
[10] : [
[0] : 16
[1] : 20
[2] : 18
[3] : 3
]
[11] : [
]
[12] : [
[0] : 22
[1] : 1
]
[13] : [
]
[14] : [
]
[15] : [
[0] : 25
[1] : 26
[2] : 27
[3] : 28
]
[16] : [
]
[17] : [
[0] : 25
[1] : 30
]
[18] : [
]
[19] : [
]
]
backendNodeId : <object>
contentDocumentIndex : {
index : [
]
value : [
]
}
currentSourceURL : {
index : [
]
value : [
]
}
inputChecked : {
index : [
]
}
inputValue : {
index : [
]
value : [
]
}
isClickable : {
index : [
]
}
nodeName : [
[0] : 8
[1] : 9
[2] : 10
[3] : 11
[4] : 12
[5] : 14
[6] : 12
[7] : 12
[8] : 15
[9] : 12
[10] : 15
[11] : 12
[12] : 21
[13] : 12
[14] : 12
[15] : 24
[16] : 12
[17] : 29
[18] : 12
[19] : 12
]
nodeType : [
[0] : 9
[1] : 10
[2] : 1
[3] : 1
[4] : 3
[5] : 1
[6] : 3
[7] : 3
[8] : 1
[9] : 3
[10] : 1
[11] : 3
[12] : 1
[13] : 3
[14] : 3
[15] : 1
[16] : 3
[17] : 1
[18] : 3
[19] : 3
]
nodeValue : [
[0] : -1
[1] : -1
[2] : -1
[3] : -1
[4] : 13
[5] : -1
[6] : 2
[7] : 13
[8] : -1
[9] : 13
[10] : -1
[11] : 13
[12] : -1
[13] : 23
[14] : 23
[15] : -1
[16] : 13
[17] : -1
[18] : 31
[19] : 32
]
optionSelected : {
index : [
]
}
originURL : {
index : [
]
value : [
]
}
parentIndex : [
[0] : -1
[1] : 0
[2] : 0
[3] : 2
[4] : 3
[5] : 3
[6] : 5
[7] : 3
[8] : 3
[9] : 3
[10] : 3
[11] : 3
[12] : 3
[13] : 3
[14] : 2
[15] : 2
[16] : 15
[17] : 15
[18] : 17
[19] : 15
]
pseudoType : {
index : [
]
value : [
]
}
textValue : {
index : [
]
value : [
]
}
}
publicId : 6
scrollOffsetX : 300
scrollOffsetY : 400
systemId : 7
textBoxes : {
bounds : [
[0] : [
[0] : 0
[1] : 0
[2] : 190
[3] : 10
]
]
layoutIndex : [
[0] : 4
]
length : [
[0] : 19
]
start : [
[0] : 7
]
}
title : 2
}
]
strings : [
[0] :
[1] : http://example.com/
[2] : Document Title
[3] : nl-NL
[4] : UTF-8
[5] :
[6] : -//W3C//DTD HTML 4.01//EN
[7] : http://www.w3.org/TR/html4/strict.dtd
[8] : #document
[9] : html
[10] : HTML
[11] : HEAD
[12] : #text
[13] :
[14] : TITLE
[15] : META
[16] : http-equiv
[17] : Content-Type
[18] : content
[19] : text/html; charset=utf-8
[20] : Content-Language
[21] : BASE
[22] : href
[23] :
[24] : BODY
[25] : style
[26] : margin: 0px
[27] : onload
[28] : window.scrollTo(300, 400)
[29] : DIV
[30] : width: 2000px; height: 2000px; font: 10px Ahem;
[31] : Een heel grote div.
[32] :
]
}
(async function(testRunner) {
var {page, session, dp} = await testRunner.startURL('../resources/dom-snapshot-captureSnapshot-details.html', 'Tests that DOMSnapshot.captureSnapshot fills document details: title, size, etc.');
var response = await dp.DOMSnapshot.captureSnapshot({computedStyles: []});
if (response.error) {
testRunner.log(response);
} else {
// Remove unstable strings from the string table.
response.result.strings[response.result.documents[0].documentURL] = '';
response.result.strings[response.result.documents[0].frameId] = '';
testRunner.log(
response.result, undefined,
['documentURL', 'frameId', 'backendNodeId']);
}
testRunner.completeTest();
})
......@@ -3,6 +3,7 @@ Tests DOMSnapshot.getSnapshot reports offset, scroll, and client rects of each n
"documents": [
{
"documentURL": 0,
"title": -1,
"baseURL": 0,
"contentLanguage": -1,
"encodingName": 1,
......@@ -116,7 +117,9 @@ Tests DOMSnapshot.getSnapshot reports offset, scroll, and client rects of each n
},
"textBoxes": "<object>",
"scrollOffsetX": 0,
"scrollOffsetY": 0
"scrollOffsetY": 0,
"contentWidth": 800,
"contentHeight": 600
}
],
"strings": "<object>"
......
Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo elements.
{
"documents": [
{
"documentURL": "<number>",
"baseURL": "<number>",
"contentLanguage": -1,
"encodingName": 1,
"publicId": -1,
"systemId": -1,
"frameId": "<number>",
"nodes": {
"parentIndex": [
-1,
0,
1,
2,
3,
2,
2,
2,
1,
8,
8,
10,
10,
8,
8,
14,
14,
16,
8,
8,
19,
19,
19,
8
],
"nodeType": [
9,
1,
1,
1,
3,
3,
1,
3,
1,
3,
1,
1,
3,
3,
1,
1,
1,
3,
3,
1,
1,
1,
3,
3
],
"nodeName": [
3,
4,
7,
8,
9,
9,
12,
9,
15,
9,
17,
20,
9,
9,
17,
20,
27,
9,
9,
17,
20,
34,
9,
9
],
"nodeValue": [
-1,
-1,
-1,
-1,
10,
11,
-1,
11,
-1,
16,
-1,
-1,
25,
16,
-1,
-1,
-1,
28,
16,
-1,
-1,
-1,
39,
40
],
"backendNodeId": "<object>",
"attributes": [
[],
[],
[],
[],
[],
[],
[
13,
14
],
[],
[],
[],
[
18,
19
],
[],
[],
[],
[
18,
19
],
[],
[],
[],
[],
[
18,
30
],
[],
[],
[],
[]
],
"textValue": {
"index": [],
"value": []
},
"inputValue": {
"index": [],
"value": []
},
"inputChecked": {
"index": []
},
"optionSelected": {
"index": []
},
"contentDocumentIndex": {
"index": [],
"value": []
},
"pseudoType": {
"index": [
11,
15,
20,
21
],
"value": [
24,
24,
24,
38
]
},
"isClickable": {
"index": []
},
"currentSourceURL": {
"index": [],
"value": []
},
"originURL": {
"index": [],
"value": []
documents : [
[0] : {
baseURL : <number>
contentHeight : 600
contentLanguage : -1
contentWidth : 800
documentURL : <number>
encodingName : 1
frameId : <number>
layout : {
bounds : [
[0] : [
[0] : 0
[1] : 0
[2] : 800
[3] : 600
]
[1] : [
[0] : 0
[1] : 0
[2] : 800
[3] : 600
]
[2] : [
[0] : 8
[1] : 8
[2] : 784
[3] : 584
]
[3] : [
[0] : 8
[1] : 18
[2] : 200
[3] : 200
]
[4] : [
[0] : 8
[1] : 18
[2] : 10
[3] : 10
]
[5] : [
[0] : 8
[1] : 18
[2] : 10
[3] : 10
]
[6] : [
[0] : 8
[1] : 18
[2] : 140
[3] : 20
]
[7] : [
[0] : 8
[1] : 18
[2] : 200
[3] : 200
]
[8] : [
[0] : 8
[1] : 18
[2] : 10
[3] : 10
]
[9] : [
[0] : 8
[1] : 18
[2] : 10
[3] : 10
]
[10] : [
[0] : 8
[1] : 18
[2] : 200
[3] : 30
]
[11] : [
[0] : 8
[1] : 18
[2] : 200
[3] : 30
]
[12] : [
[0] : 8
[1] : 18
[2] : 200
[3] : 200
]
[13] : [
[0] : 8
[1] : 110
[2] : 10
[3] : 10
]
[14] : [
[0] : 8
[1] : 110
[2] : 10
[3] : 10
]
[15] : [
[0] : 8
[1] : 110
[2] : 200
[3] : 10
]
[16] : [
[0] : 18
[1] : 110
[2] : 70
[3] : 10
]
[17] : [
[0] : 88
[1] : 110
[2] : 10
[3] : 10
]
[18] : [
[0] : 98
[1] : 18
[2] : 100
[3] : 100
]
[19] : [
[0] : 198
[1] : 110
[2] : 10
[3] : 10
]
[20] : [
[0] : 8
[1] : 120
[2] : 190
[3] : 30
]
]
nodeIndex : [
[0] : 0
[1] : 1
[2] : 8
[3] : 10
[4] : 11
[5] : 11
[6] : 12
[7] : 14
[8] : 15
[9] : 15
[10] : 16
[11] : 17
[12] : 19
[13] : 20
[14] : 20
[15] : 21
[16] : 21
[17] : 21
[18] : 21
[19] : 21
[20] : 22
]
stackingContexts : {
index : [
[0] : 0
[1] : 1
]
}
styles : [
[0] : [
[0] : -1
[1] : -1
]
[1] : [
[0] : 5
[1] : 6
]
[2] : [
[0] : 5
[1] : 6
]
[3] : [
[0] : 5
[1] : 6
]
[4] : [
[0] : 21
[1] : 22
]
[5] : [
[0] : 21
[1] : 22
]
[6] : [
[0] : 5
[1] : 6
]
[7] : [
[0] : 5
[1] : 6
]
[8] : [
[0] : 21
[1] : 22
]
[9] : [
[0] : 21
[1] : 22
]
[10] : [
[0] : 5
[1] : 6
]
[11] : [
[0] : 5
[1] : 6
]
[12] : [
[0] : 5
[1] : 6
]
[13] : [
[0] : 31
[1] : 32
]
[14] : [
[0] : 31
[1] : 32
]
[15] : [
[0] : 5
[1] : 6
]
[16] : [
[0] : 5
[1] : 6
]
[17] : [
[0] : 5
[1] : 6
]
[18] : [
[0] : 5
[1] : 6
]
[19] : [
[0] : 5
[1] : 6
]
[20] : [
[0] : 5
[1] : 6
]
]
text : [
[0] : -1
[1] : -1
[2] : -1
[3] : -1
[4] : -1
[5] : 23
[6] : 26
[7] : -1
[8] : -1
[9] : 23
[10] : -1
[11] : 29
[12] : -1
[13] : -1
[14] : 33
[15] : -1
[16] : 35
[17] : 36
[18] : -1
[19] : 37
[20] : 39
]
}
nodes : {
attributes : [
[0] : [
]
[1] : [
]
[2] : [
]
[3] : [
]
[4] : [
]
[5] : [
]
[6] : [
[0] : 13
[1] : 14
]
[7] : [
]
[8] : [
]
[9] : [
]
[10] : [
[0] : 18
[1] : 19
]
[11] : [
]
[12] : [
]
[13] : [
]
[14] : [
[0] : 18
[1] : 19
]
[15] : [
]
[16] : [
]
[17] : [
]
[18] : [
]
[19] : [
[0] : 18
[1] : 30
]
[20] : [
]
[21] : [
]
[22] : [
]
[23] : [
]
]
backendNodeId : <object>
contentDocumentIndex : {
index : [
]
value : [
]
}
currentSourceURL : {
index : [
]
value : [
]
}
inputChecked : {
index : [
]
}
inputValue : {
index : [
]
value : [
]
}
isClickable : {
index : [
]
}
nodeName : [
[0] : 3
[1] : 4
[2] : 7
[3] : 8
[4] : 9
[5] : 9
[6] : 12
[7] : 9
[8] : 15
[9] : 9
[10] : 17
[11] : 20
[12] : 9
[13] : 9
[14] : 17
[15] : 20
[16] : 27
[17] : 9
[18] : 9
[19] : 17
[20] : 20
[21] : 34
[22] : 9
[23] : 9
]
nodeType : [
[0] : 9
[1] : 1
[2] : 1
[3] : 1
[4] : 3
[5] : 3
[6] : 1
[7] : 3
[8] : 1
[9] : 3
[10] : 1
[11] : 1
[12] : 3
[13] : 3
[14] : 1
[15] : 1
[16] : 1
[17] : 3
[18] : 3
[19] : 1
[20] : 1
[21] : 1
[22] : 3
[23] : 3
]
nodeValue : [
[0] : -1
[1] : -1
[2] : -1
[3] : -1
[4] : 10
[5] : 11
[6] : -1
[7] : 11
[8] : -1
[9] : 16
[10] : -1
[11] : -1
[12] : 25
[13] : 16
[14] : -1
[15] : -1
[16] : -1
[17] : 28
[18] : 16
[19] : -1
[20] : -1
[21] : -1
[22] : 39
[23] : 40
]
optionSelected : {
index : [
]
}
originURL : {
index : [
]
value : [
]
}
parentIndex : [
[0] : -1
[1] : 0
[2] : 1
[3] : 2
[4] : 3
[5] : 2
[6] : 2
[7] : 2
[8] : 1
[9] : 8
[10] : 8
[11] : 10
[12] : 10
[13] : 8
[14] : 8
[15] : 14
[16] : 14
[17] : 16
[18] : 8
[19] : 8
[20] : 19
[21] : 19
[22] : 19
[23] : 8
]
pseudoType : {
index : [
[0] : 11
[1] : 15
[2] : 20
[3] : 21
]
value : [
[0] : 24
[1] : 24
[2] : 24
[3] : 38
]
}
textValue : {
index : [
]
value : [
]
}
}
publicId : -1
scrollOffsetX : 0
scrollOffsetY : 0
systemId : -1
textBoxes : {
bounds : [
[0] : [
[0] : 8
[1] : 18
[2] : 10
[3] : 10
]
[1] : [
[0] : 18
[1] : 18
[2] : 130
[3] : 10
]
[2] : [
[0] : 8
[1] : 28
[2] : 70
[3] : 10
]
[3] : [
[0] : 8
[1] : 18
[2] : 10
[3] : 10
]
[4] : [
[0] : 18
[1] : 18
[2] : 130
[3] : 10
]
[5] : [
[0] : 8
[1] : 28
[2] : 200
[3] : 10
]
[6] : [
[0] : 8
[1] : 38
[2] : 70
[3] : 10
]
[7] : [
[0] : 8
[1] : 110
[2] : 10
[3] : 10
]
[8] : [
[0] : 18
[1] : 110
[2] : 70
[3] : 10
]
[9] : [
[0] : 88
[1] : 110
[2] : 10
[3] : 10
]
[10] : [
[0] : 198
[1] : 110
[2] : 10
[3] : 10
]
[11] : [
[0] : 8
[1] : 120
[2] : 190
[3] : 10
]
[12] : [
[0] : 8
[1] : 130
[2] : 160
[3] : 10
]
[13] : [
[0] : 8
[1] : 140
[2] : 130
[3] : 10
]
]
layoutIndex : [
[0] : 5
[1] : 6
[2] : 6
[3] : 9
[4] : 11
[5] : 11
[6] : 11
[7] : 14
[8] : 16
[9] : 17
[10] : 19
[11] : 20
[12] : 20
[13] : 20
]
length : [
[0] : 1
[1] : 13
[2] : 7
[3] : 1
[4] : 13
[5] : 20
[6] : 7
[7] : 1
[8] : 7
[9] : 1
[10] : 1
[11] : 19
[12] : 16
[13] : 13
]
start : [
[0] : 0
[1] : 0
[2] : 14
[3] : 0
[4] : 0
[5] : 14
[6] : 35
[7] : 0
[8] : 0
[9] : 0
[10] : 0
[11] : 0
[12] : 20
[13] : 37
]
}
title : -1
}
},
"layout": {
"nodeIndex": [
0,
1,
8,
10,
11,
11,
12,
14,
15,
15,
16,
17,
19,
20,
20,
21,
21,
21,
21,
21,
22
],
"styles": [
[
-1,
-1
],
[
5,
6
],
[
5,
6
],
[
5,
6
],
[
21,
22
],
[
21,
22
],
[
5,
6
],
[
5,
6
],
[
21,
22
],
[
21,
22
],
[
5,
6
],
[
5,
6
],
[
5,
6
],
[
31,
32
],
[
31,
32
],
[
5,
6
],
[
5,
6
],
[
5,
6
],
[
5,
6
],
[
5,
6
],
[
5,
6
]
],
"bounds": [
[
0,
0,
800,
600
],
[
0,
0,
800,
600
],
[
8,
8,
784,
584
],
[
8,
18,
200,
200
],
[
8,
18,
10,
10
],
[
8,
18,
10,
10
],
[
8,
18,
140,
20
],
[
8,
18,
200,
200
],
[
8,
18,
10,
10
],
[
8,
18,
10,
10
],
[
8,
18,
200,
30
],
[
8,
18,
200,
30
],
[
8,
18,
200,
200
],
[
8,
110,
10,
10
],
[
8,
110,
10,
10
],
[
8,
110,
200,
10
],
[
18,
110,
70,
10
],
[
88,
110,
10,
10
],
[
98,
18,
100,
100
],
[
198,
110,
10,
10
],
[
8,
120,
190,
30
]
],
"text": [
-1,
-1,
-1,
-1,
-1,
23,
26,
-1,
-1,
23,
-1,
29,
-1,
-1,
33,
-1,
35,
36,
-1,
37,
39
],
"stackingContexts": {
"index": [
0,
1
]
}
},
"textBoxes": {
"layoutIndex": [
5,
6,
6,
9,
11,
11,
11,
14,
16,
17,
19,
20,
20,
20
],
"bounds": [
[
8,
18,
10,
10
],
[
18,
18,
130,
10
],
[
8,
28,
70,
10
],
[
8,
18,
10,
10
],
[
18,
18,
130,
10
],
[
8,
28,
200,
10
],
[
8,
38,
70,
10
],
[
8,
110,
10,
10
],
[
18,
110,
70,
10
],
[
88,
110,
10,
10
],
[
198,
110,
10,
10
],
[
8,
120,
190,
10
],
[
8,
130,
160,
10
],
[
8,
140,
130,
10
]
],
"start": [
0,
0,
14,
0,
0,
14,
35,
0,
0,
0,
0,
0,
20,
37
],
"length": [
1,
13,
7,
1,
13,
20,
7,
1,
7,
1,
1,
19,
16,
13
]
},
"scrollOffsetX": 0,
"scrollOffsetY": 0
}
],
"strings": [
"",
"",
"",
"#document",
"HTML",
"400",
"rgb(0, 0, 0)",
"HEAD",
"STYLE",
"#text",
"\n p {\n position: absolute;\n height: 200px;\n width: 200px;\n font: 10px Ahem;\n }\n .c1::first-letter { font-weight: lighter; color: green; }\n .c2::first-letter { font-weight: bold; color: blue; }\n .c2::before { counter-increment: square; content: 'square: ' counter(square) url(square.png) '! '; }\n ",
"\n ",
"SCRIPT",
"src",
"../../resources/ahem.js",
"BODY",
"\n ",
"P",
"class",
"c1",
"<pseudo:first-letter>",
"100",
"rgb(0, 128, 0)",
"I",
"first-letter",
"I have a first letter.",
" have a first letter.",
"SPAN",
"I have a first letter because of my parent.",
" have a first letter because of my parent.",
"c2",
"700",
"rgb(0, 0, 255)",
"s",
"<pseudo:before>",
"quare: ",
"1",
"! ",
"before",
"I have some content before me with a first letter.",
"\n \n\n"
]
]
strings : [
[0] :
[1] : windows-1252
[2] :
[3] : #document
[4] : HTML
[5] : 400
[6] : rgb(0, 0, 0)
[7] : HEAD
[8] : STYLE
[9] : #text
[10] : p { position: absolute; height: 200px; width: 200px; font: 10px Ahem; } .c1::first-letter { font-weight: lighter; color: green; } .c2::first-letter { font-weight: bold; color: blue; } .c2::before { counter-increment: square; content: 'square: ' counter(square) url(square.png) '! '; }
[11] :
[12] : SCRIPT
[13] : src
[14] : ../../resources/ahem.js
[15] : BODY
[16] :
[17] : P
[18] : class
[19] : c1
[20] : <pseudo:first-letter>
[21] : 100
[22] : rgb(0, 128, 0)
[23] : I
[24] : first-letter
[25] : I have a first letter.
[26] : have a first letter.
[27] : SPAN
[28] : I have a first letter because of my parent.
[29] : have a first letter because of my parent.
[30] : c2
[31] : 700
[32] : rgb(0, 0, 255)
[33] : s
[34] : <pseudo:before>
[35] : quare:
[36] : 1
[37] : !
[38] : before
[39] : I have some content before me with a first letter.
[40] :
]
}
(async function(testRunner) {
var {page, session, dp} = await testRunner.startURL('../resources/dom-snapshot-pseudo-element.html', 'Tests DOMSnapshot.getSnapshot exports layout tree nodes associated with pseudo elements.');
function stabilize(key, value) {
var unstableKeys = ['documentURL', 'baseURL', 'frameId', 'backendNodeId'];
if (unstableKeys.indexOf(key) !== -1)
return '<' + typeof(value) + '>';
return value;
}
var response = await dp.DOMSnapshot.captureSnapshot({'computedStyles': ['font-weight', 'color'], 'includeEventListeners': true});
if (response.error) {
testRunner.log(response);
} else {
response.result.strings[0] = '';
response.result.strings[1] = '';
response.result.strings[2] = '';
testRunner.log(JSON.stringify(response.result, stabilize, 2));
// Remove unstable strings from the string table.
response.result.strings[response.result.documents[0].documentURL] = '';
response.result.strings[response.result.documents[0].baseURL] = '';
response.result.strings[response.result.documents[0].frameId] = '';
testRunner.log(
response.result, undefined,
['documentURL', 'baseURL', 'frameId', 'backendNodeId']);
}
testRunner.completeTest();
})
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Document Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="nl-NL">
<base href="http://example.com/">
</head>
<body style="margin: 0px" onload="window.scrollTo(300, 400)">
<div style="width: 2000px; height: 2000px; font: 10px Ahem;">
Een heel grote div.
</div>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment