Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/permission-element/geolocation-element/no-children-rendered.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset=utf-8>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<!-- The geolocation element is not a void element. Its children do not render. -->
<!-- This tests for implementations that used to have no end tag for the geolocation element
In those implementations there would be 2 geolocation elements in this div. -->
<div id="geolocation-element-div">
<geolocation>
<geolocation>
</div>
<geolocation id="el1">This is some text</geolocation>
<!-- The geolocation element does not automatically close <p> tags -->
<p id="paragraph">Foo <geolocation>bar</geolocation> baz</p>
<script>
test(function(){
assert_equals(1, document.getElementById("geolocation-element-div").childElementCount);
assert_equals('', document.getElementById("el1").innerText);
assert_equals('This is some text', document.getElementById("el1").textContent);
assert_equals('This is some text', document.getElementById("el1").innerHTML);
assert_equals(4, document.body.childElementCount); //div, geolocation, script, p
assert_equals('Foo bar baz', document.getElementById("paragraph").textContent);
}, "The geolocation element should have no end tag or contents");
</script>
</body>