OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
4 <body> | 4 <body> |
5 <script> | 5 <script> |
6 test(function () { | 6 test(function () { |
7 var proto = Object.create(SVGGElement.prototype); | 7 var proto = Object.create(SVGGElement.prototype); |
8 | 8 |
9 assert_throws('INVALID_CHARACTER_ERR', function() { | 9 assert_throws('INVALID_CHARACTER_ERR', function() { |
10 document.register('x-foo', {prototype: proto}); | 10 document.registerElement('x-foo', {prototype: proto}); |
11 }, 'register of an SVG element requires the extends parameter'); | 11 }, 'register of an SVG element requires the extends parameter'); |
12 | 12 |
13 var XFoo = document.register('x-foo', {prototype: proto, extends: 'g'}); | 13 var XFoo = document.registerElement('x-foo', {prototype: proto, extends: 'g'
}); |
14 | 14 |
15 var created = new XFoo(); | 15 var created = new XFoo(); |
16 assert_true(created instanceof SVGGElement, 'created element should be an SV
G element'); | 16 assert_true(created instanceof SVGGElement, 'created element should be an SV
G element'); |
17 | 17 |
18 }, 'registration of SVG types'); | 18 }, 'registration of SVG types'); |
19 </script> | 19 </script> |
OLD | NEW |