Commit 7f1ee984 authored by Alex Clarke's avatar Alex Clarke Committed by Commit Bot

DOMSnapshot.getSnapshot to expose the document character encoding format

Bug: 
Change-Id: I44f80c51d5e96816bf937eb46f000c0fdcfe271f
Reviewed-on: https://chromium-review.googlesource.com/591670
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490736}
parent b2795ddb
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
"y": 0.0 "y": 0.0
}, },
"childNodeIndexes": [ 1 ], "childNodeIndexes": [ 1 ],
"documentEncoding": "windows-1252",
"documentURL": "http://127.0.0.1/dom_tree_test.html", "documentURL": "http://127.0.0.1/dom_tree_test.html",
"layoutNodeIndex": 0, "layoutNodeIndex": 0,
"nodeName": "#document", "nodeName": "#document",
...@@ -222,6 +223,7 @@ ...@@ -222,6 +223,7 @@
"y": 0.0 "y": 0.0
}, },
"childNodeIndexes": [ 19 ], "childNodeIndexes": [ 19 ],
"documentEncoding": "windows-1252",
"documentURL": "http://127.0.0.1/iframe.html", "documentURL": "http://127.0.0.1/iframe.html",
"layoutNodeIndex": 7, "layoutNodeIndex": 7,
"nodeName": "#document", "nodeName": "#document",
......
...@@ -12,7 +12,8 @@ Tests DOMSnapshot.getSnapshot method. ...@@ -12,7 +12,8 @@ Tests DOMSnapshot.getSnapshot method.
"layoutNodeIndex": 0, "layoutNodeIndex": 0,
"documentURL": "<string>", "documentURL": "<string>",
"baseURL": "<string>", "baseURL": "<string>",
"contentLanguage": "de" "contentLanguage": "de",
"documentEncoding": "windows-1252"
}, },
{ {
"nodeType": 1, "nodeType": 1,
...@@ -361,7 +362,8 @@ Tests DOMSnapshot.getSnapshot method. ...@@ -361,7 +362,8 @@ Tests DOMSnapshot.getSnapshot method.
], ],
"layoutNodeIndex": 19, "layoutNodeIndex": 19,
"documentURL": "<string>", "documentURL": "<string>",
"baseURL": "<string>" "baseURL": "<string>",
"documentEncoding": "windows-1252"
}, },
{ {
"nodeType": 1, "nodeType": 1,
......
...@@ -11,7 +11,8 @@ Tests DOMSnapshot.getSnapshot method returning input values. ...@@ -11,7 +11,8 @@ Tests DOMSnapshot.getSnapshot method returning input values.
], ],
"layoutNodeIndex": 0, "layoutNodeIndex": 0,
"documentURL": "<string>", "documentURL": "<string>",
"baseURL": "<string>" "baseURL": "<string>",
"documentEncoding": "windows-1252"
}, },
{ {
"nodeType": 1, "nodeType": 1,
......
...@@ -246,6 +246,8 @@ int InspectorDOMSnapshotAgent::VisitNode(Node* node) { ...@@ -246,6 +246,8 @@ int InspectorDOMSnapshotAgent::VisitNode(Node* node) {
value->setBaseURL(InspectorDOMAgent::DocumentBaseURLString(document)); value->setBaseURL(InspectorDOMAgent::DocumentBaseURLString(document));
if (document->ContentLanguage()) if (document->ContentLanguage())
value->setContentLanguage(document->ContentLanguage().Utf8().data()); value->setContentLanguage(document->ContentLanguage().Utf8().data());
if (document->EncodingName())
value->setDocumentEncoding(document->EncodingName().Utf8().data());
} else if (node->IsDocumentTypeNode()) { } else if (node->IsDocumentTypeNode()) {
DocumentType* doc_type = ToDocumentType(node); DocumentType* doc_type = ToDocumentType(node);
value->setPublicId(doc_type->publicId()); value->setPublicId(doc_type->publicId());
......
...@@ -3432,6 +3432,7 @@ ...@@ -3432,6 +3432,7 @@
{ "name": "documentURL", "type": "string", "optional": true, "description": "Document URL that <code>Document</code> or <code>FrameOwner</code> node points to." }, { "name": "documentURL", "type": "string", "optional": true, "description": "Document URL that <code>Document</code> or <code>FrameOwner</code> node points to." },
{ "name": "baseURL", "type": "string", "optional": true, "description": "Base URL that <code>Document</code> or <code>FrameOwner</code> node uses for URL completion." }, { "name": "baseURL", "type": "string", "optional": true, "description": "Base URL that <code>Document</code> or <code>FrameOwner</code> node uses for URL completion." },
{ "name": "contentLanguage", "type": "string", "optional": true, "description": "Only set for documents, contains the document's content language." }, { "name": "contentLanguage", "type": "string", "optional": true, "description": "Only set for documents, contains the document's content language." },
{ "name": "documentEncoding", "type": "string", "optional": true, "description": "Only set for documents, contains the document's character set encoding." },
{ "name": "publicId", "type": "string", "optional": true, "description": "<code>DocumentType</code> node's publicId." }, { "name": "publicId", "type": "string", "optional": true, "description": "<code>DocumentType</code> node's publicId." },
{ "name": "systemId", "type": "string", "optional": true, "description": "<code>DocumentType</code> node's systemId." }, { "name": "systemId", "type": "string", "optional": true, "description": "<code>DocumentType</code> node's systemId." },
{ "name": "frameId", "$ref": "Page.FrameId", "optional": true, "description": "Frame ID for frame owner elements." }, { "name": "frameId", "$ref": "Page.FrameId", "optional": true, "description": "Frame ID for frame owner elements." },
......
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