From 0e9ac9495f8f867264dcdfd9d9eda1e94c245695 Mon Sep 17 00:00:00 2001 From: Rafael Weinstein Date: Tue, 14 Jan 2014 16:02:09 -0800 Subject: [PATCH] remove unused code in fixTemplateElementPrototype we no longer attempt to fix the prototype of a semantic template element. instead, we "extract" an actual template element. the invariant with this method is that it is always called with an element with tagName 'template' in the HTML namespace. R=arv BUG= Review URL: https://codereview.appspot.com/52430043 --- src/TemplateBinding.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/TemplateBinding.js b/src/TemplateBinding.js index 8db0e8a..369dd3f 100644 --- a/src/TemplateBinding.js +++ b/src/TemplateBinding.js @@ -357,21 +357,10 @@ } function fixTemplateElementPrototype(el) { - // Note: because we need to treat some semantic elements as template - // elements (like tr or td), but don't want to reassign their proto (gecko - // doesn't like that), we mixin the properties for those elements. - if (el.tagName === 'TEMPLATE') { - if (!hasTemplateElement) { - if (hasProto) - el.__proto__ = HTMLTemplateElement.prototype; - else - mixin(el, HTMLTemplateElement.prototype); - } - } else { + if (hasProto) + el.__proto__ = HTMLTemplateElement.prototype; + else mixin(el, HTMLTemplateElement.prototype); - // FIXME: Won't need this when webkit methods move to the prototype. - Object.defineProperty(el, 'content', contentDescriptor); - } } function ensureSetModelScheduled(template) {