Skip to content

Commit

Permalink
Fix tests for customized built-in elements in custom-elements/htmlcon…
Browse files Browse the repository at this point in the history
…structor/newtarget.html (web-platform-tests#4082)

According to the spec, https://html.spec.whatwg.org/multipage/dom.html#htmlconstructor,
the fallback prototype of customized built-in element is the interface prototype object
from NewTarget's realm, instead of the interface object.
  • Loading branch information
EdgarChen authored and jgraham committed Oct 26, 2016
1 parent d06d731 commit ac12d9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom-elements/htmlconstructor/newtarget.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@
function TestElement() {
const o = Reflect.construct(w.HTMLParagraphElement, [], new.target);

assert_equals(Object.getPrototypeOf(o), window.HTMLParagraphElement,
assert_equals(Object.getPrototypeOf(o), window.HTMLParagraphElement.prototype,
"Must use the HTMLParagraphElement from the realm of NewTarget");
assert_not_equals(Object.getPrototypeOf(o), w.HTMLParagraphElement,
assert_not_equals(Object.getPrototypeOf(o), w.HTMLParagraphElement.prototype,
"Must not use the HTMLParagraphElement from the realm of the active function object (w.HTMLParagraphElement)");

return o;
Expand Down

0 comments on commit ac12d9a

Please sign in to comment.