Commit c75d117b authored by Timothy Gu's avatar Timothy Gu Committed by Commit Bot

Make about:blank page have a charset of UTF-8

This brings us into alignment with the Fetch Standard as well as Firefox and
Edge.

Bug: 165083, 874536
Change-Id: Id06d07d301aeae8bd0c48bfe94df68cf1ed68db9
Reviewed-on: https://chromium-review.googlesource.com/1176263Reviewed-by: default avatarNate Chapin <japhet@chromium.org>
Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Timothy Gu <timothygu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584357}
parent 30fa2a67
......@@ -20,6 +20,7 @@ test(function() {
var win = window.open('', '', 'height=1,width=1');
this.add_cleanup(function() { win.close(); });
assert_equals(win.location.href, 'about:blank', 'win.location.href');
assert_equals(win.document.charset, 'UTF-8', 'win.document.charset');
}, 'first argument: empty url');
test(function () {
......
This is a testharness.js-based test.
FAIL Check that browsing context has new, ready HTML document assert_equals: The document's encoding should be 'UTF-8'. expected "UTF-8" but got "windows-1252"
PASS Check that new document nodes extant, empty
PASS Check the document properties corresponding to the creator browsing context
Harness: the test ran to completion.
......@@ -173,7 +173,7 @@ Tests that DOMSnapshot.getSnapshot records origin url of dom nodes generated by
"layoutNodeIndex": 7,
"documentURL": "<string>",
"baseURL": "<string>",
"documentEncoding": "windows-1252",
"documentEncoding": "UTF-8",
"frameId": "<string>"
},
{
......
......@@ -888,6 +888,7 @@ bool DocumentLoader::MaybeLoadEmpty() {
!GetFrameLoader().StateMachine()->CreatingInitialEmptyDocument())
request_.SetURL(BlankURL());
response_ = ResourceResponse(request_.Url(), "text/html");
response_.SetTextEncodingName("utf-8");
FinishedLoading(CurrentTimeTicks());
return true;
}
......
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