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

Side by Side Diff: third_party/polymer/polymer/polymer.js

Issue 98583008: Checkout Polymer using bower instead of the raw repository. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years 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 | « third_party/polymer/polymer/polymer.html ('k') | third_party/polymer/polymer/polymer.js.map » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Polymer Authors. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 // @version: 0.1.1
29 Polymer={},"function"==typeof window.Polymer&&(Polymer={}),function(a){function b(a,b){return a&&b&&Object.getOwnPropertyNames(b).forEach(function(c){var d=Obje ct.getOwnPropertyDescriptor(b,c);d&&(Object.defineProperty(a,c,d),"function"==ty peof d.value&&(d.value.nom=c))}),a}a.extend=b}(Polymer),function(a){function b(a ,b,d){return a?a.stop():a=new c(this),a.go(b,d),a}var c=function(a){this.context =a};c.prototype={go:function(a,b){this.callback=a,this.handle=setTimeout(this.co mplete.bind(this),b)},stop:function(){this.handle&&(clearTimeout(this.handle),th is.handle=null)},complete:function(){this.handle&&(this.stop(),this.callback.cal l(this.context))}},a.job=b}(Polymer),function(){var a={};HTMLElement.register=fu nction(b,c){a[b]=c},HTMLElement.getPrototypeForTag=function(b){var c=b?a[b]:HTML Element.prototype;return c||Object.getPrototypeOf(document.createElement(b))};va r b=Event.prototype.stopPropagation;Event.prototype.stopPropagation=function(){t his.cancelBubble=!0,b.apply(this,arguments)},HTMLImports.importer.preloadSelecto rs+=", polymer-element link[rel=stylesheet]"}(Polymer),function(a){function b(a) {var c=b.caller,g=c.nom,h=c._super;if(h||(g||(g=c.nom=e.call(this,c)),g||console .warn("called super() on a method not installed declaratively (has no .nom prope rty)"),h=d(c,g,f(this))),h){var i=h[g];return i._super||d(i,g,h),i.apply(this,a| |[])}}function c(a,b,c){for(;a;){if(a[b]!==c&&a[b])return a;a=f(a)}}function d(a ,b,d){return a._super=c(d,b,a),a._super&&(a._super[b].nom=b),a._super}function e (a){for(var b=this.__proto__;b&&b!==HTMLElement.prototype;){for(var c,d=Object.g etOwnPropertyNames(b),e=0,f=d.length;f>e&&(c=d[e]);e++){var g=Object.getOwnPrope rtyDescriptor(b,c);if("function"==typeof g.value&&g.value===a)return c}b=b.__pro to__}}function f(a){return a.__proto__}a.super=b}(Polymer),function(a){function b(a,b){var d=typeof b;return b instanceof Date&&(d="date"),c[d](a,b)}var c={stri ng:function(a){return a},date:function(a){return new Date(Date.parse(a)||Date.no w())},"boolean":function(a){return""===a?!0:"false"===a?!1:!!a},number:function( a){var b=parseFloat(a);return String(b)===a?b:a},object:function(a,b){if(null=== b)return a;try{return JSON.parse(a.replace(/'/g,'"'))}catch(c){return a}},"funct ion":function(a,b){return b}};a.deserializeValue=b}(Polymer),function(a){var b={ };b.declaration={},b.instance={},a.api=b}(Polymer),function(a){var b={async:func tion(a,b,c){Platform.flush(),b=b&&b.length?b:[b];var d=function(){(this[a]||a).a pply(this,b)}.bind(this);return c?setTimeout(d,c):requestAnimationFrame(d)},fire :function(a,b,c,d){var e=c||this;return e.dispatchEvent(new CustomEvent(a,{bubbl es:void 0!==d?d:!0,detail:b})),b},asyncFire:function(){this.async("fire",argumen ts)},classFollows:function(a,b,c){b&&b.classList.remove(c),a&&a.classList.add(c) }};b.asyncMethod=b.async,a.api.instance.utils=b}(Polymer),function(a){function b (a){for(;a.parentNode;)a=a.parentNode;return a.host}var c=window.logFlags||{},d= "on-",e={EVENT_PREFIX:d,hasEventPrefix:function(a){return a&&"o"===a[0]&&"n"===a [1]&&"-"===a[2]},removeEventPrefix:function(a){return a.slice(f)},addHostListene rs:function(){var a=this.eventDelegates;c.events&&Object.keys(a).length>0&&conso le.log("[%s] addHostListeners:",this.localName,a),this.addNodeListeners(this,a,t his.hostEventListener)},addNodeListeners:function(a,b,c){var d;for(var e in b)d| |(d=c.bind(this)),this.addNodeListener(a,e,d)},addNodeListener:function(a,b,c){a .addEventListener(b,c)},hostEventListener:function(a){if(!a.cancelBubble){c.even ts&&console.group("[%s]: hostEventListener(%s)",this.localName,a.type);var b=thi s.findEventDelegate(a);b&&(c.events&&console.log("[%s] found host handler name [ %s]",this.localName,b),this.dispatchMethod(this,b,[a,a.detail,this])),c.events&& console.groupEnd()}},findEventDelegate:function(a){return this.eventDelegates[a. type]},dispatchMethod:function(a,b,d){if(a){c.events&&console.group("[%s] dispat ch [%s]",a.localName,b);var e="function"==typeof b?b:a[b];e&&e[d?"apply":"call"] (a,d),c.events&&console.groupEnd(),Platform.flush()}},prepareBinding:function(a, d){return e.hasEventPrefix(d)?function(f,g){c.events&&console.log('event: [%s].% s => [%s].%s()"',g.localName,f.localName,a);var h=function(c){var d=b(g);if(d&&d .dispatchMethod){var e=d,h=a;"@"==a[0]&&(e=f,h=Path.get(a.slice(1)).getValueFrom (f)),d.dispatchMethod(e,h,[c,c.detail,g])}},i=e.removeEventPrefix(d);return g.ad dEventListener(i,h,!1),{close:function(){c.events&&console.log('event.remove: [% s].%s => [%s].%s()"',g.localName,d,f.localName,a),g.removeEventListener(i,h,!1)} }}:void 0}},f=d.length;a.api.instance.events=e}(Polymer),function(a){var b={copy InstanceAttributes:function(){var a=this._instanceAttributes;for(var b in a)this .hasAttribute(b)||this.setAttribute(b,a[b])},takeAttributes:function(){if(this._ publishLC)for(var a,b=0,c=this.attributes,d=c.length;(a=c[b])&&d>b;b++)this.attr ibuteToProperty(a.name,a.value)},attributeToProperty:function(b,c){var b=this.pr opertyForAttribute(b);if(b){if(c&&c.search(a.bindPattern)>=0)return;var d=this[b ],c=this.deserializeValue(c,d);c!==d&&(this[b]=c)}},propertyForAttribute:functio n(a){var b=this._publishLC&&this._publishLC[a];return b},deserializeValue:functi on(b,c){return a.deserializeValue(b,c)},serializeValue:function(a,b){return"bool ean"===b?a?"":void 0:"object"!==b&&"function"!==b&&void 0!==a?a:void 0},reflectP ropertyToAttribute:function(a){var b=typeof this[a],c=this.serializeValue(this[a ],b);void 0!==c?this.setAttribute(a,c):"boolean"===b&&this.removeAttribute(a)}}; a.api.instance.attributes=b}(Polymer),function(a){function b(a){return new Compo undPathObserver(a.notifyPropertyChanges,a)}function c(a,b,c,e){d.bind&&console.l og(f,c.localName||"object",e,a.localName,b);var g=Path.get(e),h=g.getValueFrom(c );return(null===h||void 0===h)&&g.setValueFrom(c,a[b]),PathObserver.defineProper ty(a,b,c,e)}var d=window.logFlags||{},e={observeProperties:function(){var a=this ._observeNames,c=this._publishNames;if(a&&a.length||c&&c.length){for(var d,e=thi s._propertyObserver=b(this),f=0,g=a.length;g>f&&(d=a[f]);f++){e.addPath(this,d); var h=Object.getOwnPropertyDescriptor(this.__proto__,d);h&&h.value&&this.observe ArrayValue(d,h.value,null)}for(var d,f=0,g=c.length;g>f&&(d=c[f]);f++)this.obser ve&&void 0!==this.observe[d]||e.addPath(this,d);e.start()}},notifyPropertyChange s:function(a,b,c,d){for(var e,f,g={},h=0,i=c.length;i>h;h++)c[h]&&(e=d[2*h+1],vo id 0!==this.publish[e]&&this.reflectPropertyToAttribute(e),f=this.observe[e],f&& (this.observeArrayValue(e,a[h],b[h]),g[f]||(g[f]=!0,this.invokeMethod(f,[b[h],a[ h],arguments]))))},observeArrayValue:function(a,b,c){var e=this.observe[a];if(e& &(Array.isArray(c)&&(d.observe&&console.log("[%s] observeArrayValue: unregister observer [%s]",this.localName,a),this.unregisterObserver(a+"__array")),Array.isA rray(b))){d.observe&&console.log("[%s] observeArrayValue: register observer [%s] ",this.localName,a,b);var f=this,g=new ArrayObserver(b,function(a,b){f.invokeMet hod(e,[b])});this.registerObserver(a+"__array",g)}},bindProperty:function(a,b,d) {return c(this,a,b,d)},unbindAllProperties:function(){this._propertyObserver&&th is._propertyObserver.close(),this.unregisterObservers()},unbindProperty:function (a){return this.unregisterObserver(a)},invokeMethod:function(a,b){var c=this[a]| |a;"function"==typeof c&&c.apply(this,b)},registerObserver:function(a,b){var c=t his._observers||(this._observers={});c[a]=b},unregisterObserver:function(a){var b=this._observers;return b&&b[a]?(b[a].close(),b[a]=null,!0):void 0},unregisterO bservers:function(){if(this._observers){for(var a,b,c=Object.keys(this._observer s),d=0,e=c.length;e>d&&(a=c[d]);d++)b=this._observers[a],b.close();this._observe rs={}}}},f="[%s]: bindProperties: [%s] to [%s].[%s]";a.api.instance.properties=e }(Polymer),function(a){function b(a){d(a,c)}function c(a){a.unbindAll()}function d(a,b){if(a){b(a);for(var c=a.firstChild;c;c=c.nextSibling)d(c,b)}}var e=window .logFlags||0,f=a.api.instance.events,g=PolymerExpressions.prototype.prepareBindi ng;PolymerExpressions.prototype.prepareBinding=function(a,b,c){return f.prepareB inding(a,b,c)||g.call(this,a,b,c)};var h=new PolymerExpressions,i={syntax:h,inst anceTemplate:function(a){return a.bindingDelegate=this.syntax,a.createInstance(t his)},bind:function(a,b,c){this._elementPrepared||this.prepareElement();var d=th is.propertyForAttribute(a);if(d){this.unbind(a);var e=this.bindProperty(d,b,c);r eturn e.path=c,this.reflectPropertyToAttribute(d),this.bindings[a]=e}return this .super(arguments)},asyncUnbindAll:function(){this._unbound||(e.unbind&&console.l og("[%s] asyncUnbindAll",this.localName),this._unbindAllJob=this.job(this._unbin dAllJob,this.unbindAll,0))},unbindAll:function(){if(!this._unbound){this.unbindA llProperties(),this.super();for(var a=this.shadowRoot;a;)b(a),a=a.olderShadowRoo t;this._unbound=!0}},cancelUnbindAll:function(a){return this._unbound?(e.unbind& &console.warn("[%s] already unbound, cannot cancel unbindAll",this.localName),vo id 0):(e.unbind&&console.log("[%s] cancelUnbindAll",this.localName),this._unbind AllJob&&(this._unbindAllJob=this._unbindAllJob.stop()),a||d(this.shadowRoot,func tion(a){a.cancelUnbindAll&&a.cancelUnbindAll()}),void 0)}},j=/\{\{([^{}]*)}}/;a. bindPattern=j,a.api.instance.mdv=i}(Polymer),function(a){function b(a){return a. hasOwnProperty("PolymerBase")}function c(){}var d=0,e={PolymerBase:!0,job:Polyme r.job,"super":Polymer.super,created:function(){},ready:function(){},createdCallb ack:function(){this.created(),(this.ownerDocument.defaultView||this.alwaysPrepar e||d>0)&&this.prepareElement()},prepareElement:function(){this._elementPrepared= !0,this.observeProperties(),this.copyInstanceAttributes(),this.takeAttributes(), this.addHostListeners(),d++,this.parseDeclarations(this.__proto__),d--,this.read y()},enteredViewCallback:function(){this._elementPrepared||this.prepareElement() ,this.cancelUnbindAll(!0),this.enteredView&&this.enteredView()},leftViewCallback :function(){this.preventDispose||this.asyncUnbindAll(),this.leftView&&this.leftV iew()},enteredDocumentCallback:function(){this.enteredViewCallback()},leftDocume ntCallback:function(){this.leftViewCallback()},parseDeclarations:function(a){a&& a.element&&(this.parseDeclarations(a.__proto__),a.parseDeclaration.call(this,a.e lement))},parseDeclaration:function(a){var b=this.fetchTemplate(a);b&&(this.elem ent.hasAttribute("lightdom")?this.lightFromTemplate(b):this.shadowFromTemplate(b ))},fetchTemplate:function(a){return a.querySelector("template")},shadowFromTemp late:function(a){if(a){var b=(this.shadowRoot,this.createShadowRoot());b.applyAu thorStyles=this.applyAuthorStyles,b.resetStyleInheritance=this.resetStyleInherit ance;var c=this.instanceTemplate(a);return b.appendChild(c),this.shadowRootReady (b,a),b}},lightFromTemplate:function(a){if(a){var b=this.instanceTemplate(a);ret urn this.appendChild(b),this.shadowRootReady(this,a),b}},shadowRootReady:functio n(a){this.marshalNodeReferences(a),PointerGestures.register(a)},marshalNodeRefer ences:function(a){var b=this.$=this.$||{};if(a)for(var c,d=a.querySelectorAll("[ id]"),e=0,f=d.length;f>e&&(c=d[e]);e++)b[c.id]=c},attributeChangedCallback:funct ion(a){"class"!==a&&"style"!==a&&this.attributeToProperty(a,this.getAttribute(a) ),this.attributeChanged&&this.attributeChanged.apply(this,arguments)},onMutation :function(a,b){var c=new MutationObserver(function(a){b.call(this,c,a),c.disconn ect()}.bind(this));c.observe(a,{childList:!0,subtree:!0})}};c.prototype=e,e.cons tructor=c,a.Base=c,a.isBase=b,a.api.instance.base=e}(Polymer),function(a){functi on b(a){return a.__proto__}var c=(window.logFlags||{},"element"),d="controller", e={STYLE_SCOPE_ATTRIBUTE:c,installControllerStyles:function(){var a=this.findSty leController();if(a&&!this.scopeHasElementStyle(a,d)){for(var c=b(this),e="";c&& c.element;)e+=c.element.cssTextForScope(d),c=b(c);if(e){var f=this.element.cssTe xtToScopeStyle(e,d);Polymer.applyStyleToScope(f,a)}}},findStyleController:functi on(){if(window.ShadowDOMPolyfill)return wrap(document.head);for(var a=this;a.par entNode;)a=a.parentNode;return a===document?document.head:a},scopeHasElementStyl e:function(a,b){var d=c+"="+this.localName+"-"+b;return a.querySelector("style[" +d+"]")}};a.api.instance.styles=e}(Polymer),function(a){var b={addResolvePathApi :function(){var a=this.elementPath(),b=this.getAttribute("assetpath")||"",c=this .relPath;this.prototype.resolvePath=function(d){var e=d;if(b){var f=b.slice(0,-1 );e=c(f,e)}return a+b+e}},elementPath:function(){return this.urlToPath(HTMLImpor ts.getDocumentUrl(this.ownerDocument))},relPath:function(a,b){for(var c=a.split( "/"),d=b.split("/"),e=!1;c.length&&d.length&&c[0]===d[0];)c.shift(),d.shift(),e= !0;if(e)for(var f=0;f<c.length;f++)d.unshift("..");return d.join("/")},urlToPath :function(a){if(a){var b=a.split("/");return b.pop(),b.push(""),b.join("/")}retu rn""}};a.api.declaration.path=b}(Polymer),function(a){function b(a,b){if(a){var d=c(a.textContent),e=a.getAttribute(g);e&&d.setAttribute(g,e),b.appendChild(d)}} function c(a){var b=document.createElement("style");return b.textContent=a,b}fun ction d(a){return a&&a.__resource||""}function e(a,b){return n?n.call(a,b):void 0}var f=(window.logFlags||{},a.api.instance.styles),g=f.STYLE_SCOPE_ATTRIBUTE,h= "style",i="[rel=stylesheet]",j="global",k="polymer-scope",l={installSheets:funct ion(){this.cacheSheets(),this.cacheStyles(),this.installLocalSheets(),this.insta llGlobalStyles()},cacheSheets:function(){this.sheets=this.findNodes(i),this.shee ts.forEach(function(a){a.parentNode&&a.parentNode.removeChild(a)})},cacheStyles: function(){this.styles=this.findNodes(h+"["+k+"]"),this.styles.forEach(function( a){a.parentNode&&a.parentNode.removeChild(a)})},installLocalSheets:function(){va r a=this.sheets.filter(function(a){return!a.hasAttribute(k)}),b=this.templateCon tent();if(b){var e="";a.forEach(function(a){e+=d(a)+"\n"}),e&&b.insertBefore(c(e ),b.firstChild)}},findNodes:function(a,b){var c=this.querySelectorAll(a).array() ,d=this.templateContent();if(d){var e=d.querySelectorAll(a).array();c=c.concat(e )}return b?c.filter(b):c},templateContent:function(){var a=this.querySelector("t emplate");return a&&templateContent(a)},installGlobalStyles:function(){var a=thi s.styleForScope(j);b(a,document.head)},cssTextForScope:function(a){var b="",c="[ "+k+"="+a+"]",f=function(a){return e(a,c)},g=this.sheets.filter(f);g.forEach(fun ction(a){b+=d(a)+"\n\n"});var h=this.styles.filter(f);return h.forEach(function( a){b+=a.textContent+"\n\n"}),b},styleForScope:function(a){var b=this.cssTextForS cope(a);return this.cssTextToScopeStyle(b,a)},cssTextToScopeStyle:function(a,b){ if(a){var d=c(a);return d.setAttribute(g,this.getAttribute("name")+"-"+b),d}}},m =HTMLElement.prototype,n=m.matches||m.matchesSelector||m.webkitMatchesSelector|| m.mozMatchesSelector;a.api.declaration.styles=l,a.applyStyleToScope=b}(Polymer), function(a){var b=a.api.instance.events,c=(window.logFlags||{},{parseHostEvents: function(){var a=this.prototype.eventDelegates;this.addAttributeDelegates(a)},ad dAttributeDelegates:function(a){for(var c,d=0;c=this.attributes[d];d++)b.hasEven tPrefix(c.name)&&(a[b.removeEventPrefix(c.name)]=c.value.replace("{{","").replac e("}}","").trim())},event_translations:{webkitanimationstart:"webkitAnimationSta rt",webkitanimationend:"webkitAnimationEnd",webkittransitionend:"webkitTransitio nEnd",domfocusout:"DOMFocusOut",domfocusin:"DOMFocusIn"}});a.api.declaration.eve nts=c}(Polymer),function(a){var b={inferObservers:function(a){var b,c=a.observe; for(var d in a)"Changed"===d.slice(-7)&&(c||(c=a.observe={}),b=d.slice(0,-7),c[b ]=c[b]||d)},optimizePropertyMaps:function(a){if(a.observe){var b=a._observeNames =[];for(var c in a.observe)b.push(c)}if(a.publish){var b=a._publishNames=[];for( var c in a.publish)b.push(c)}},publishProperties:function(a,b){var c=a.publish;c &&(this.requireProperties(c,a,b),a._publishLC=this.lowerCaseMap(c))},requireProp erties:function(a,b,c){for(var d in a)void 0===b[d]&&void 0===c[d]&&(b[d]=a[d])} ,lowerCaseMap:function(a){var b={};for(var c in a)b[c.toLowerCase()]=c;return b} };a.api.declaration.properties=b}(Polymer),function(a){var b="attributes",c={inh eritAttributesObjects:function(a){this.inheritObject(a,"publishLC"),this.inherit Object(a,"_instanceAttributes")},publishAttributes:function(a,c){var d=this.getA ttribute(b);if(d)for(var e,f=a.publish||(a.publish={}),g=d.split(d.indexOf(",")> =0?",":" "),h=0,i=g.length;i>h;h++)e=g[h].trim(),e&&void 0===f[e]&&void 0===c[e] &&(f[e]=null)},accumulateInstanceAttributes:function(){for(var a,b=this.prototyp e._instanceAttributes,c=this.attributes,d=0,e=c.length;e>d&&(a=c[d]);d++)this.is InstanceAttribute(a.name)&&(b[a.name]=a.value)},isInstanceAttribute:function(a){ return!this.blackList[a]&&"on-"!==a.slice(0,3)},blackList:{name:1,"extends":1,co nstructor:1,noscript:1}};c.blackList[b]=1,a.api.declaration.attributes=c}(Polyme r),function(a){function b(a){if(!Object.__proto__){var b=Object.getPrototypeOf(a );a.__proto__=b,d(b)&&(b.__proto__=Object.getPrototypeOf(b))}}var c=a.api,d=a.is Base,e=a.extend,f={register:function(a,b){this.prototype=this.buildPrototype(a,b ),this.prototype.element=this,this.desugar(a,b),this.registerPrototype(a,b),this .publishConstructor()},buildPrototype:function(c,d){var e=a.getRegisteredPrototy pe(c),f=this.generateBasePrototype(d);return this.publishAttributes(e,f),this.pu blishProperties(e,f),this.inferObservers(e),this.inheritMetaData(e,f),e=this.cha inObject(e,f),this.optimizePropertyMaps(e),b(e),e},inheritMetaData:function(a,b) {this.inheritObject("observe",a,b),this.inheritObject("publish",a,b),this.inheri tObject("_publishLC",a,b),this.inheritObject("_instanceAttributes",a,b),this.inh eritObject("eventDelegates",a,b)},desugar:function(a,b){this.accumulateInstanceA ttributes(),this.parseHostEvents(),this.installSheets(),this.adjustShadowElement (),this.addResolvePathApi(),window.ShadowDOMPolyfill&&Platform.ShadowCSS.shimSty ling(this.templateContent(),a,b),this.prototype.registerCallback&&this.prototype .registerCallback(this)},adjustShadowElement:function(){if(!window.ShadowDOMPoly fill){var a=this.templateContent();if(a)for(var b,c=a.querySelectorAll("shadow") ,d=0,e=c.length;e>d&&(b=c[d]);d++)b.children.length||b.appendChild(document.crea teElement("content"))}},publishConstructor:function(){var a=this.getAttribute("c onstructor");a&&(window[a]=this.ctor)},generateBasePrototype:function(a){var b=t his.findBasePrototype(a);if(!b){var b=HTMLElement.getPrototypeForTag(a);b=this.e nsureBaseApi(b),memoizedBases[a]=b}return b},findBasePrototype:function(a){retur n memoizedBases[a]},ensureBaseApi:function(a){if(!a.PolymerBase){a=Object.create (a);for(var b in c.instance)e(a,c.instance[b])}return a},inheritObject:function( a,b,c){var d=b[a]||{};b[a]=this.chainObject(d,c[a])},registerPrototype:function( a,b){var c={prototype:this.prototype},d=this.findTypeExtension(b);d&&(c.extends= d),this.ctor=document.register(a,c),this.prototype.constructor=this.ctor,HTMLEle ment.register(a,this.prototype)},findTypeExtension:function(a){if(a&&a.indexOf(" -")<0)return a;var b=this.findBasePrototype(a);return b.element?this.findTypeExt ension(b.element.extends):void 0}};f.chainObject=Object.__proto__?function(a,b){ return a&&b&&a!==b&&(a.__proto__=b),a}:function(a,b){if(a&&b&&a!==b){var c=Objec t.create(b);a=e(c,a)}return a},memoizedBases={},c.declaration.prototype=f}(Polym er),function(a){function b(a,b){k[a]=b||{},d(a)}function c(a){return k[a]}functi on d(a){l[a]&&(l[a].registerWhenReady(),delete l[a])}function e(a){n[a]=!0;var b =m[a];b&&(b.forEach(function(a){a.registerWhenReady()}),delete m[a])}function f( a){return n[a]}function g(a){window.HTMLImports&&!HTMLImports.readyTime?addEvent Listener("HTMLImportsLoaded",a):a()}var h=a.extend,i=a.api.declaration,j=h(Objec t.create(HTMLElement.prototype),{createdCallback:function(){this.name=this.getAt tribute("name"),this.extends=this.getAttribute("extends"),this.registerWhenReady ()},registerWhenReady:function(){if(!this.waitingForPrototype(this.name)){var a= this.extends;this.waitingForExtendee(a)||(document.contains(this)?g(function(){t his._register(a)}.bind(this)):this._register(a))}},_register:function(a){this.re gister(this.name,a),e(this.name)},waitingForPrototype:function(a){if(!c(a)){if(l [a]=this,this.hasAttribute("noscript"))if(window.CustomElements&&!CustomElements .useNative)b(a);else{var d=document.createElement("script");d.textContent="Polym er('"+a+"');",this.appendChild(d)}return!0}},waitingForExtendee:function(a){retu rn a&&a.indexOf("-")>=0&&!f(a)?((m[a]=m[a]||[]).push(this),!0):void 0}});Object. keys(i).forEach(function(a){h(j,i[a])});var k={},l={},m={},n={};a.getRegisteredP rototype=c,h(b,a),window.Polymer=b,document.register("polymer-element",{prototyp e:j})}(Polymer);
30 //# sourceMappingURL=polymer.js.map
OLDNEW
« no previous file with comments | « third_party/polymer/polymer/polymer.html ('k') | third_party/polymer/polymer/polymer.js.map » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698