gecko-dev/testing/web-platform/tests/domparsing/outerhtml-02.html
James Graham feaf3e9468 Bug 1274534 - Update web-platform-tests to revision e806420984568cd76da78de27c832b0a927d9fc6, a=testonly
MozReview-Commit-ID: 1KVr5OLKI3


--HG--
rename : testing/web-platform/tests/uievents/ClickFakeEvent.nondocument.html => testing/web-platform/tests/dom/events/Event-dispatch-detached-click.html
rename : testing/web-platform/tests/uievents/order-of-events/init-event-while-dispatching.html => testing/web-platform/tests/dom/events/Event-init-while-dispatching.html
rename : testing/web-platform/tests/uievents/constructors/constructors.html => testing/web-platform/tests/dom/events/Event-subclasses-constructors.html
rename : testing/web-platform/tests/DOM-parsing/createContextualFragment.html => testing/web-platform/tests/domparsing/createContextualFragment.html
rename : testing/web-platform/tests/DOM-parsing/innerhtml-01.xhtml => testing/web-platform/tests/domparsing/innerhtml-01.xhtml
rename : testing/web-platform/tests/DOM-parsing/innerhtml-03.xhtml => testing/web-platform/tests/domparsing/innerhtml-03.xhtml
rename : testing/web-platform/tests/DOM-parsing/innerhtml-04.html => testing/web-platform/tests/domparsing/innerhtml-04.html
rename : testing/web-platform/tests/DOM-parsing/innerhtml-05.xhtml => testing/web-platform/tests/domparsing/innerhtml-05.xhtml
rename : testing/web-platform/tests/DOM-parsing/innerhtml-07.html => testing/web-platform/tests/domparsing/innerhtml-07.html
rename : testing/web-platform/tests/DOM-parsing/insert_adjacent_html.html => testing/web-platform/tests/domparsing/insert_adjacent_html.html
rename : testing/web-platform/tests/DOM-parsing/insert_adjacent_html.js => testing/web-platform/tests/domparsing/insert_adjacent_html.js
rename : testing/web-platform/tests/DOM-parsing/insert_adjacent_html.xhtml => testing/web-platform/tests/domparsing/insert_adjacent_html.xhtml
rename : testing/web-platform/tests/DOM-parsing/outerhtml-01.html => testing/web-platform/tests/domparsing/outerhtml-01.html
rename : testing/web-platform/tests/DOM-parsing/outerhtml-02.html => testing/web-platform/tests/domparsing/outerhtml-02.html
rename : testing/web-platform/tests/DOM-parsing/xml-serialization.xhtml => testing/web-platform/tests/domparsing/xml-serialization.xhtml
2016-05-24 08:41:15 +01:00

54 lines
1.8 KiB
HTML

<!DOCTYPE html>
<title>outerHTML and string conversion</title>
<link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com">
<link rel="help" href="http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
var div = document.createElement("div");
var p = div.appendChild(document.createElement("p"));
p.outerHTML = null;
assert_equals(div.innerHTML, "");
assert_equals(div.textContent, "");
}, "outerHTML and string conversion: null.")
test(function() {
var div = document.createElement("div");
var p = div.appendChild(document.createElement("p"));
p.outerHTML = undefined;
assert_equals(div.innerHTML, "undefined");
assert_equals(div.textContent, "undefined");
}, "outerHTML and string conversion: undefined.")
test(function() {
var div = document.createElement("div");
var p = div.appendChild(document.createElement("p"));
p.outerHTML = 42;
assert_equals(div.innerHTML, "42");
assert_equals(div.textContent, "42");
}, "outerHTML and string conversion: number.")
test(function() {
var div = document.createElement("div");
var p = div.appendChild(document.createElement("p"));
p.outerHTML = {
toString: function() { return "pass"; },
valueOf: function() { return "fail"; }
};
assert_equals(div.innerHTML, "pass");
assert_equals(div.textContent, "pass");
}, "outerHTML and string conversion: toString.")
test(function() {
var div = document.createElement("div");
var p = div.appendChild(document.createElement("p"));
p.outerHTML = {
toString: undefined,
valueOf: function() { return "pass"; }
};
assert_equals(div.innerHTML, "pass");
assert_equals(div.textContent, "pass");
}, "outerHTML and string conversion: valueOf.")
</script>