Commit afedd691 authored by Bhagirathi Satpathy's avatar Bhagirathi Satpathy Committed by Commit Bot

Modify url type from DOMString to USVString to match the specification

Modify url type from DOMString to USVString to match the specification.
https://html.spec.whatwg.org/multipage/dom.html#documents

Bug: 
Change-Id: I61cf2d2eee439675607504bdc048844e236b7310
Reviewed-on: https://chromium-review.googlesource.com/790117Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Commit-Queue: Bhagirathi Satpathy <bhagirathi.s@samsung.com>
Cr-Commit-Position: refs/heads/master@{#519960}
parent 6addbe80
<!DOCTYPE HTML>
<title>document.open test for USVString url</title>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<body>
<script>
test(function() {
// USVString is equivalent to DOMString except for not allowing unpaired surrogate codepoints.
// U+D800 to U+DFFF code point values are reserved as high and low surrogates, so no UTF forms, including UTF-16, can encode these code points.
// Unpaired surrogate codepoints present in USVString are converted by the browser to Unicode 'replacement character' U+FFFD.
w = document.open("data:text/html,<span>\ud801 is an unpaired surrogate codepoint</span>", "", "");
// w should be a window object in case of url as USVString type, otherwise in case of DOMString type
// javascript execution stops after throwing syntax error "Unable to open a window with invalid URL".
assert_equals(typeof(w), 'object', 'w should be a window object');
}, "unpaired surrogate codepoint should be replaced with U+FFFD");
</script>
</body>
......@@ -119,7 +119,7 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
// dynamic markup insertion
[CallWith=EnteredWindow, CEReactions, CustomElementCallbacks, RaisesException, MeasureAs=DocumentOpen] Document open(optional DOMString type = "text/html", optional DOMString replace = "");
[CallWith=(CurrentWindow,EnteredWindow), RaisesException, MeasureAs=DocumentOpen] Window open(DOMString url, DOMString name, DOMString features);
[CallWith=(CurrentWindow,EnteredWindow), RaisesException, MeasureAs=DocumentOpen] Window open(USVString url, DOMString name, DOMString features);
[CEReactions, RaisesException] void close();
[CallWith=EnteredWindow, CEReactions, CustomElementCallbacks, RaisesException] void write(DOMString... text);
[CallWith=EnteredWindow, CEReactions, CustomElementCallbacks, RaisesException] void writeln(DOMString... text);
......
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