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

Side by Side Diff: LayoutTests/fast/dom/custom/class-side-inheritance.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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/custom/exception-from-constructor.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "use strict";
8
9 class Foo extends HTMLDivElement {
10 static staticFunction () { return "static function called"; }
11 }
12
13 var customFoo = document.registerElement("custom-foo", {
14 prototype: Foo.prototype,
15 });
16
17 assert_equals(Object.getPrototypeOf(customFoo), Foo,
18 'generated constructor prototype should be base element constructor');
19
20 assert_equals(customFoo.staticFunction(), "static function called",
21 'static function should be called using inherited element');
22
23 assert_equals(Object.getPrototypeOf(customFoo).__proto__, HTMLDivElement,
24 'prototype chain should have base constructor\'s prototype');
25 }, 'should inherit from passed constructor');
26 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/custom/exception-from-constructor.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698