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

Side by Side Diff: pkg/web_components/test/interop_test.html

Issue 333073002: Support upgrading existing elements already on the page. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « pkg/web_components/test/interop_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 4 <meta http-equiv="X-UA-Compatible" content="IE=edge">
5 <meta name="dart.unittest" content="full-stack-traces"> 5 <meta name="dart.unittest" content="full-stack-traces">
6 <title> interop_test.html </title> 6 <title> interop_test.html </title>
7 <style> 7 <style>
8 .unittest-table { font-family:monospace; border:1px; } 8 .unittest-table { font-family:monospace; border:1px; }
9 .unittest-pass { background: #6b3;} 9 .unittest-pass { background: #6b3;}
10 .unittest-fail { background: #d55;} 10 .unittest-fail { background: #d55;}
11 .unittest-error { background: #a11;} 11 .unittest-error { background: #a11;}
12 </style> 12 </style>
13 <script src="/packages/web_components/platform.js"></script> 13 <script src="/packages/web_components/platform.js"></script>
14 <script src="/packages/web_components/dart_support.js"></script> 14 <script src="/packages/web_components/dart_support.js"></script>
15 </head> 15 </head>
16 <body> 16 <body>
17 <h1> Running interop_test </h1> 17 <h1> Running interop_test </h1>
18 <script> 18 <script>
19 var counter = 0; 19 var counter = 0;
20 var A = function() {}; 20 var A = function() {};
21 A.prototype = Object.create(HTMLElement.prototype); 21 A.prototype = Object.create(HTMLElement.prototype);
22 A.prototype.inc = function() { this.x = counter++; }; 22 A.prototype.inc = function() { this.x = counter++; };
23 A.prototype.createdCallback = function() { this.inc(); }; 23 A.prototype.createdCallback = function() { this.inc(); };
24 24
25 var B = function() {}; 25 var B = function() {};
26 B.prototype = Object.create(HTMLDivElement.prototype); 26 B.prototype = Object.create(HTMLDivElement.prototype);
27 B.prototype.createdCallback = function() { this.x = counter++; }; 27 B.prototype.createdCallback = function() { this.x = counter++; };
28 B.extends = 'div'; 28 B.extends = 'div';
29 29
30 var D = function() {};
31 D.prototype = Object.create(HTMLElement.prototype);
32 D.prototype.inc = function() { this.x = counter++; };
33 D.prototype.createdCallback = function() { this.inc(); };
34
30 document.registerElement('x-a', A); 35 document.registerElement('x-a', A);
31 document.registerElement('x-b', B); 36 document.registerElement('x-b', B);
37 document.registerElement('x-d', D);
32 38
33 function registerC() { 39 function registerC() {
34 var proto = Object.create(HTMLElement.prototype, { 40 var proto = Object.create(HTMLElement.prototype, {
35 inc: { value: function() { this.x = counter++; } }, 41 inc: { value: function() { this.x = counter++; } },
36 createdCallback: { 42 createdCallback: {
37 value: function() { this.inc(); }, 43 value: function() { this.inc(); },
38 configurable: true}, 44 configurable: true},
39 }); 45 });
40 document.registerElement('x-c', {prototype: proto}); 46 document.registerElement('x-c', {prototype: proto});
41 } 47 }
42 function addA() { 48 function addA() {
43 document.body.appendChild(document.createElement('x-a')); 49 document.body.appendChild(document.createElement('x-a'));
44 } 50 }
45 function addB() { 51 function addB() {
46 document.body.appendChild(document.createElement('div', 'x-b')); 52 document.body.appendChild(document.createElement('div', 'x-b'));
47 } 53 }
48 function addC() { 54 function addC() {
49 document.body.appendChild(document.createElement('x-c')); 55 document.body.appendChild(document.createElement('x-c'));
50 } 56 }
57 function addD() {
58 document.body.appendChild(document.createElement('x-d'));
59 }
51 </script> 60 </script>
52 <x-a id="i1"></x-a> 61 <x-a id="i1"></x-a>
53 <div is="x-b" id="i2"></div> 62 <div is="x-b" id="i2"></div>
54 <x-c id="i3"></x-b> 63 <x-c id="i3"></x-c>
64 <x-d id="i4"></x-d>
55 <script type="text/javascript" 65 <script type="text/javascript"
56 src="/root_dart/tools/testing/dart/test_controller.js"></script> 66 src="/root_dart/tools/testing/dart/test_controller.js"></script>
57 %TEST_SCRIPTS% 67 %TEST_SCRIPTS%
58 </body> 68 </body>
59 </html> 69 </html>
OLDNEW
« no previous file with comments | « pkg/web_components/test/interop_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698