Index: LayoutTests/fast/dom/custom/document-register-basic.html |
diff --git a/LayoutTests/fast/dom/custom/document-register-basic.html b/LayoutTests/fast/dom/custom/document-register-basic.html |
index cf680e500aa53be4e1072e1361656fa19e2c8dbd..a79832f940f021cdb7d163a50e3246aaf655d7a8 100644 |
--- a/LayoutTests/fast/dom/custom/document-register-basic.html |
+++ b/LayoutTests/fast/dom/custom/document-register-basic.html |
@@ -6,7 +6,7 @@ |
<body> |
<div id="container"></div> |
<script> |
-description('Testing document.register() basic behaviors.'); |
+description('Testing document.registerElement() basic behaviors.'); |
if (window.testRunner) |
testRunner.dumpAsText(); |
@@ -18,20 +18,20 @@ function createRegisterParameters() |
}; |
} |
-var fooConstructor = document.register('x-foo', createRegisterParameters()); |
+var fooConstructor = document.registerElement('x-foo', createRegisterParameters()); |
shouldBe('typeof fooConstructor', '"function"'); |
shouldBe('fooConstructor.prototype.__proto__', 'HTMLElement.prototype'); |
shouldBeTrue('fooConstructor.prototype.thisIsPrototype'); |
// Bad prototype: prototype is already a built-in interface prototype object |
-shouldThrow('document.register("x-bad-a", HTMLElement)', '"NotSupportedError: Failed to execute \'register\' on \'Document\': Registration failed for type \'x-bad-a\'. The prototype is already in-use as an interface prototype object."'); |
+shouldThrow('document.registerElement("x-bad-a", HTMLElement)', '"NotSupportedError: Failed to execute \'registerElement\' on \'Document\': Registration failed for type \'x-bad-a\'. The prototype is already in-use as an interface prototype object."'); |
// Bad prototype: prototype is already a Custom Element interface prototype object |
-shouldThrow('document.register("x-bad-b", fooConstructor)', '"NotSupportedError: Failed to execute \'register\' on \'Document\': Registration failed for type \'x-bad-b\'. The prototype is already in-use as an interface prototype object."'); |
+shouldThrow('document.registerElement("x-bad-b", fooConstructor)', '"NotSupportedError: Failed to execute \'registerElement\' on \'Document\': Registration failed for type \'x-bad-b\'. The prototype is already in-use as an interface prototype object."'); |
// Bad prototype: 'constructor' is not configurable |
var proto = Object.create(HTMLElement.prototype, { |
constructor: {configurable: false, writable: true} |
}); |
-shouldThrow('document.register("x-bad-c", { prototype: proto })', '"NotSupportedError: Failed to execute \'register\' on \'Document\': Registration failed for type \'x-bad-c\'. Prototype constructor property is not configurable."'); |
+shouldThrow('document.registerElement("x-bad-c", { prototype: proto })', '"NotSupportedError: Failed to execute \'registerElement\' on \'Document\': Registration failed for type \'x-bad-c\'. Prototype constructor property is not configurable."'); |
// Call as function |
shouldThrow('fooConstructor()', '"TypeError: DOM object constructor cannot be called as a function."') |
@@ -67,13 +67,13 @@ parsedFoo.someProperty = 'hello'; |
shouldBe('parsedFoo.someProperty', 'container.firstChild.someProperty'); |
// Having another constructor |
-var barConstructor = document.register('x-bar', createRegisterParameters()); |
+var barConstructor = document.registerElement('x-bar', createRegisterParameters()); |
shouldBeTrue('barConstructor !== fooConstructor'); |
var createdBar = new barConstructor(); |
shouldBe('createdBar.tagName', '"X-BAR"'); |
// Having a subclass |
-var bazConstructor = document.register('x-baz', { prototype: Object.create(fooConstructor.prototype, { thisIsAlsoPrototype: { value: true } }) }); |
+var bazConstructor = document.registerElement('x-baz', { prototype: Object.create(fooConstructor.prototype, { thisIsAlsoPrototype: { value: true } }) }); |
var createdBaz = new bazConstructor(); |
shouldBe('createdBaz.tagName', '"X-BAZ"'); |
shouldBeTrue('createdBaz.thisIsPrototype'); |