Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: LayoutTests/fast/dom/custom/inherited-prototype.html

Issue 1097243002: [Reland] Implement Custom Element's class side inheritance (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Nits Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <body>
5 <script>
6 test(function () {
7 var protoA = Object.create(HTMLDivElement.prototype);
8 var A = document.registerElement('x-a', {
9 extends: 'div', prototype: protoA});
10
11 assert_equals(
12 Object.getPrototypeOf(A), HTMLDivElement,
13 'generated constructor prototype should be base element constructor ' +
14 '(extend built-in element)');
15
16 assert_equals(
17 A.__proto__, HTMLDivElement,
18 'Internal prototype should also be base element function object ' +
19 '(extend built-in element)');
20
21 assert_equals(
22 A.prototype.__proto__, HTMLDivElement.prototype,
23 'Internal prototype of generated constructor prototype should be ' +
24 'prototype of base element function object (extend built-in element)');
25
26 var protoB = Object.create(protoA);
27 var B = document.registerElement('x-b', {prototype: protoB});
28 assert_equals(
29 Object.getPrototypeOf(B), A,
30 'generated constructor prototype should be base element constructor ' +
31 '(extend Custom Element)');
32
33 assert_equals(
34 B.__proto__, A,
35 'Internal prototype should also be base element function object ' +
36 '(extend Custom Element)');
37
38 assert_equals(
39 B.prototype.__proto__, A.prototype,
40 'Internal prototype of generated constructor prototype should be ' +
41 'prototype of base element function object (extend Custom Element)');
42 }, 'generated constructor prototype property');
43 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698