HTMLFormElement::Elements should honor [SameObject] attribute

Ideally, this would get tested by web-platform-tests, but that has yet
to be implemented:

https://github.com/w3c/web-platform-tests/issues/2462
This commit is contained in:
Corey Farwell 2016-01-10 18:27:07 -05:00
parent 4056716ecd
commit 1ff1ec69dd
3 changed files with 36 additions and 2 deletions

View file

@ -0,0 +1,20 @@
<!doctype html>
<meta charset="utf-8">
<title>Testing [SameObject] on the 'elements' attribute on the 'form' element</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<form>
<input>
</form>
<script>
test(function() {
var form = document.querySelector('form');
var elements = form.elements;
assert_true(elements === form.elements);
form.appendChild(document.createElement('input'));
assert_true(elements === form.elements);
}, "[SameObject] should apply to 'elements' attr on <form>");
</script>