From 7f1f897f0536a2a48d44251de237b7cb03ab159e Mon Sep 17 00:00:00 2001 From: Andres Rios Date: Thu, 17 Mar 2016 09:34:09 +0300 Subject: [PATCH] Fix typo in '2.1.1 Creating a custom tag' --- spec/custom/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/custom/index.html b/spec/custom/index.html index 1a5d37d8..99731e0e 100644 --- a/spec/custom/index.html +++ b/spec/custom/index.html @@ -176,7 +176,7 @@

Creating a custom tag

We then need to use this class to define the element:

-document.defineElement("flag-icon", FlagIcon);
+document.registerElement("flag-icon", FlagIcon);

At this point, our above code will work! The parser, whenever it sees the flag-icon tag, will construct a new instance of our FlagIcon class, and tell our code about its new country attribute, which we then use to set the element's internal state and update its rendering (when appropriate).

@@ -219,7 +219,7 @@

Creating a type extension

When registering our custom element, we have to also specify the extends option:

-document.defineElement("plastic-button", PlasticButton, { extends: "button" });
+document.registerElement("plastic-button", PlasticButton, { extends: "button" });

In general, the name of the element being extended cannot be determined simply by looking at what element interface it extends, as many elements share the same interface (such as q and blockquote both sharing HTMLQuoteElement).