diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index f30fbaaa53..0000000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "tools"]
- path = tools
- url = https://github.com/Polymer/tools.git
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8be03fdcbb..1de2f3418e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -21,21 +21,29 @@ Other projects require a similar agreement: jQuery, Firefox, Apache, Node, and m
Here's an easy guide that should get you up and running:
+1. Setup Grunt: `sudo npm install -g grunt-cli`
1. Fork the project on github and pull down your copy.
> replace the {{ username }} with your username and {{ repository }} with the repository name
- git clone git@github.com:{{ username }}/{{ repository }}.git -b master --recursive
+ git clone git@github.com:{{ username }}/{{ repository }}.git --recursive
Note the `--recursive`. This is necessary for submodules to initialize properly. If you don't do a recursive clone, you'll have to init them manually:
git submodule init
git submodule update
- Adding `-b master` is a shorthand to checkout the `master` branch. If you include it, skip step 2.
+ Download and run the `pull-all.sh` script to install the sibling dependencies.
-2. Development happens on the `master` branch. Get yourself on it!
+ git clone git://github.com/Polymer/tools.git && tools/bin/pull-all.sh
- git checkout master
+1. Test your change
+ > in the repo you've made changes to, run the tests:
+
+ cd $REPO
+ npm install
+ grunt test
+
+1. Commit your code and make a pull request.
That's it for the one time setup. Now you're ready to make a change.
diff --git a/conf/karma.conf.js b/conf/karma.conf.js
index 573c264a7f..c6ddf2469c 100644
--- a/conf/karma.conf.js
+++ b/conf/karma.conf.js
@@ -1,46 +1,47 @@
module.exports = function(karma) {
- var common = require('../tools/test/karma-common.conf.js');
+ var common = require('../../tools/test/karma-common.conf.js');
karma.set(common.mixin_common_opts(karma, {
// base path, that will be used to resolve files and exclude
basePath: '../../',
// list of files / patterns to load in the browser
files: [
- 'polymer/tools/test/mocha-htmltest.js',
+ 'tools/test/mocha-htmltest.js',
'polymer/conf/mocha.conf.js',
'polymer/node_modules/chai/chai.js',
'polymer/polymer.js',
'polymer/test/js/*.js',
- {pattern: 'platform/*.js', included: false},
- {pattern: 'platform/tools/**/*.js', included: false},
- {pattern: 'platform/platform.*', included: false},
- {pattern: 'platform/test/**/*.html', included: false},
- {pattern: 'platform/test/**/*.js', included: false},
- {pattern: 'platform/src/*.js', included: false},
- {pattern: 'CustomElements/custom-elements.js', included: false},
{pattern: 'CustomElements/MutationObservers/*.js', included: false},
+ {pattern: 'CustomElements/custom-elements.js', included: false},
{pattern: 'CustomElements/src/*.js', included: false},
{pattern: 'HTMLImports/html-imports.js', included: false},
{pattern: 'HTMLImports/src/*', included: false},
+ {pattern: 'NodeBind/src/*.js', included: false},
+ {pattern: 'PointerEvents/pointerevents.js', included: false},
+ {pattern: 'PointerEvents/src/*.js', included: false},
+ {pattern: 'PointerGestures/pointergestures.js', included: false},
+ {pattern: 'PointerGestures/src/*.js', included: false},
{pattern: 'ShadowDOM/shadowdom.js', included: false},
{pattern: 'ShadowDOM/src/**/*.js', included: false},
- {pattern: 'observe-js/src/*.js', included: false},
- {pattern: 'observe-js/util/*.js', included: false},
- {pattern: 'NodeBind/src/*.js', included: false},
{pattern: 'TemplateBinding/load.js', included: false},
- {pattern: 'TemplateBinding/src/*.js', included: false},
{pattern: 'TemplateBinding/src/*.css', included: false},
+ {pattern: 'TemplateBinding/src/*.js', included: false},
+ {pattern: 'WeakMap/weakmap.js', included: false},
+ {pattern: 'observe-js/src/*.js', included: false},
+ {pattern: 'observe-js/util/*.js', included: false},
+ {pattern: 'platform/*.js', included: false},
+ {pattern: 'platform/platform.*', included: false},
+ {pattern: 'platform/src/*.js', included: false},
+ {pattern: 'platform/test/**/*.html', included: false},
+ {pattern: 'platform/test/**/*.js', included: false},
+ {pattern: 'platform/tools/**/*.js', included: false},
{pattern: 'polymer-expressions/src/*.js', included: false},
{pattern: 'polymer-expressions/third_party/**/*.js', included: false},
- {pattern: 'PointerEvents/pointerevents.js', included: false},
- {pattern: 'PointerEvents/src/*.js', included: false},
- {pattern: 'PointerGestures/pointergestures.js', included: false},
- {pattern: 'PointerGestures/src/*.js', included: false},
- {pattern: 'polymer/tools/**/*.js', included: false},
{pattern: 'polymer/src/**/*.js', included: false},
- {pattern: 'polymer/test/**/*.html', included: false},
{pattern: 'polymer/test/**/*.css', included: false},
- {pattern: 'polymer/test/**/*.js', included: false}
+ {pattern: 'polymer/test/**/*.html', included: false},
+ {pattern: 'polymer/test/**/*.js', included: false},
+ {pattern: 'tools/**/*.js', included: false}
]
}));
};
diff --git a/gruntfile.js b/gruntfile.js
index a67d95db03..f2a74eaafc 100644
--- a/gruntfile.js
+++ b/gruntfile.js
@@ -78,7 +78,7 @@ module.exports = function(grunt) {
outdir: 'docs',
linkNatives: 'true',
tabtospace: 2,
- themedir: 'tools/doc/themes/bootstrap'
+ themedir: '../tools/doc/themes/bootstrap'
}
}
},
diff --git a/package.json b/package.json
index 89bd93801e..98e8db9346 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "Polymer",
- "version": "0.0.20130905",
+ "version": "0.0.20130912",
"devDependencies": {
"mocha": "*",
"chai": "*",
diff --git a/polymer.js b/polymer.js
index 42bb26986c..453f28ede0 100644
--- a/polymer.js
+++ b/polymer.js
@@ -52,7 +52,7 @@ var src = script.attributes.src.value;
var basePath = src.slice(0, src.indexOf(thisFile));
if (!window.PolymerLoader) {
- var path = basePath + 'tools/loader/loader.js';
+ var path = basePath + '../tools/loader/loader.js';
document.write('');
}
document.write('');
diff --git a/src/declaration/attributes.js b/src/declaration/attributes.js
index 1c8e66d5a0..9a52f6ac8e 100644
--- a/src/declaration/attributes.js
+++ b/src/declaration/attributes.js
@@ -5,80 +5,42 @@
*/
(function(scope) {
- // imports
-
- var api = scope.api.instance.attributes;
-
- var PUBLISHED = api.PUBLISHED;
- var INSTANCE_ATTRIBUTES = api.INSTANCE_ATTRIBUTES;
-
// magic words
- var PUBLISH = 'publish';
- var ATTRIBUTES = 'attributes';
+ var ATTRIBUTES_ATTRIBUTE = 'attributes';
// attributes api
var attributes = {
inheritAttributesObjects: function(prototype) {
- this.inheritObject(prototype, PUBLISHED);
- this.inheritObject(prototype, INSTANCE_ATTRIBUTES);
+ // chain our lower-cased publish map to the inherited version
+ this.inheritObject(prototype, 'publishLC');
+ // chain our instance attributes map to the inherited version
+ this.inheritObject(prototype, '_instanceAttributes');
},
- parseAttributes: function() {
- this.publishAttributes(this.prototype);
- this.publishProperties(this.prototype);
- this.accumulateInstanceAttributes();
- },
- publishAttributes: function(prototype) {
- // get published properties
- var published = prototype[PUBLISHED];
- // merge attribute names from 'attributes' attribute
- var attributes = this.getAttribute(ATTRIBUTES);
+ publishAttributes: function(prototype, base) {
+ // merge names from 'attributes' attribute
+ var attributes = this.getAttribute(ATTRIBUTES_ATTRIBUTE);
if (attributes) {
- // attributes='a b c' or attributes='a,b,c'
+ // get properties to publish
+ var publish = prototype.publish || (prototype.publish = {});
+ // names='a b c' or names='a,b,c'
var names = attributes.split(attributes.indexOf(',') >= 0 ? ',' : ' ');
// record each name for publishing
- names.forEach(function(p) {
- p = p.trim();
- if (p && !(p in published)) {
- published[p] = null;
+ for (var i=0, l=names.length, n; i
accumulateInstanceAttributes: function() {
// inherit instance attributes
- var clonable = this.prototype[INSTANCE_ATTRIBUTES];
+ var clonable = this.prototype._instanceAttributes;
// merge attributes from element
this.attributes.forEach(function(a) {
if (this.isInstanceAttribute(a.name)) {
@@ -93,11 +55,11 @@
blackList: {name: 1, 'extends': 1, constructor: 1, noscript: 1}
};
- // add ATTRIBUTES symbol to blacklist
- attributes.blackList[ATTRIBUTES] = 1;
+ // add ATTRIBUTES_ATTRIBUTE to the blacklist
+ attributes.blackList[ATTRIBUTES_ATTRIBUTE] = 1;
// exports
scope.api.declaration.attributes = attributes;
-
+
})(Polymer);
diff --git a/src/declaration/polymer-element.js b/src/declaration/polymer-element.js
index b675aa9df2..31e87012b6 100644
--- a/src/declaration/polymer-element.js
+++ b/src/declaration/polymer-element.js
@@ -49,12 +49,19 @@
// finalizing elements in the main document
if (document.contains(this)) {
whenImportsLoaded(function() {
- this.register(this.name, extendee);
+ this._register(extendee);
}.bind(this));
} else {
- this.register(this.name, extendee);
+ this._register(extendee);
}
},
+ _register: function(extendee) {
+ //console.group('registering', this.name);
+ this.register(this.name, extendee);
+ //console.groupEnd();
+ // subclasses may now register themselves
+ notifySuper(this.name);
+ },
waitingForPrototype: function(name) {
if (!getRegisteredPrototype(name)) {
// then wait for a prototype
@@ -87,60 +94,12 @@
return true;
}
}
- },
- register: function(name, extendee) {
- // build prototype combining extendee, Polymer base, and named api
- this.prototype = this.generateCustomPrototype(name, extendee);
- // backref
- this.prototype.element = this;
- // TODO(sorvell): install a helper method this.resolvePath to aid in
- // setting resource paths. e.g.
- // this.$.image.src = this.resolvePath('images/foo.png')
- // Potentially remove when spec bug is addressed.
- // https://www.w3.org/Bugs/Public/show_bug.cgi?id=21407
- this.addResolvePathApi();
- // declarative features
- this.desugar();
- // under ShadowDOMPolyfill, transforms to approximate missing CSS features
- if (window.ShadowDOMPolyfill) {
- Platform.ShadowCSS.shimStyling(this.templateContent(), name, extendee);
- }
- // register our custom element
- this.registerPrototype(name);
- // reference constructor in a global named by 'constructor' attribute
- this.publishConstructor();
- // subclasses may now register themselves
- notifySuper(name);
- },
- // implement various declarative features
- desugar: function(prototype) {
- // parse `attribute` attribute and `publish` object
- this.parseAttributes();
- // parse on-* delegates declared on `this` element
- this.parseHostEvents();
- // parse on-* delegates declared in templates
- this.parseLocalEvents();
- // install external stylesheets as if they are inline
- this.installSheets();
- // allow custom element access to the declarative context
- if (this.prototype.registerCallback) {
- this.prototype.registerCallback(this);
- }
- // cache the list of custom prototype names for faster reflection
- this.cacheProperties();
- },
- // if a named constructor is requested in element, map a reference
- // to the constructor to the given symbol
- publishConstructor: function() {
- var symbol = this.getAttribute('constructor');
- if (symbol) {
- window[symbol] = this.ctor;
- }
}
});
// semi-pluggable APIs
- // TODO(sjmiles): should be fully pluggable
+ // TODO(sjmiles): should be fully pluggable (aka decoupled, currently
+ // the various plugins are allowed to depend on each other directly)
Object.keys(apis).forEach(function(n) {
extend(prototype, apis[n]);
});
diff --git a/src/declaration/properties.js b/src/declaration/properties.js
index 5699b62eee..68a6f1214f 100644
--- a/src/declaration/properties.js
+++ b/src/declaration/properties.js
@@ -4,54 +4,73 @@
* license that can be found in the LICENSE file.
*/
(function(scope) {
-
- // imports
-
- var attributes_api = scope.api.instance.attributes,
- events_api = scope.api.instance.events
- ;
-
- // magic words
-
- var OBSERVE_SUFFIX = 'Changed';
// element api
-
- var empty = [];
var properties = {
- cacheProperties: function() {
- this.prototype.customPropertyNames = this.getCustomPropertyNames(this.prototype);
- },
- // fetch an array of all property names in our prototype chain
- // above PolymerBase
- // TODO(sjmiles): perf: reflection is slow, relatively speaking
- // If an element may take 6us to create, getCustomPropertyNames might
- // cost 1.6us more.
- getCustomPropertyNames: function(p) {
- var properties = {}, some;
- while (p && !scope.isBase(p)) {
- var names = Object.getOwnPropertyNames(p);
- for (var i=0, l=names.length, n; (i or HTMLElement
- function generatePrototype(tag) {
- return Object.create(HTMLElement.getPrototypeForTag(tag));
- }
- // On platforms that do not support __proto__ (IE10), the prototype chain
- // of a custom element is simulated via installation of __proto__.
- // Although custom elements manages this, we install it here so it's
- // available during desugaring.
- function ensurePrototypeTraversal(prototype) {
- if (!Object.__proto__) {
- var ancestor = Object.getPrototypeOf(prototype);
- prototype.__proto__ = ancestor;
- if (isBase(ancestor)) {
- ancestor.__proto__ = Object.getPrototypeOf(ancestor);
+ // TODO(sjmiles): duplicated in attributes.js
+ if (Object.__proto__) {
+ var chainObject = function(object, inherited) {
+ if (object && inherited && object !== inherited) {
+ object.__proto__ = inherited;
}
}
+ } else {
+ chainObject = function(object, inherited) {
+ throw "Fix chainObject for IE";
+ }
}
- // declarative implementation:
-
- var prototype = generatePrototype();
-
// prototype api
var prototype = {
- // prototype marshaling
- // build prototype combining extendee, Polymer base, and named api
- generateCustomPrototype: function (name, extnds) {
- // basal prototype
- var prototype = this.generateBasePrototype(extnds);
- // mixin registered custom api
- this.addNamedApi(prototype, name);
+ register: function(name, extendee) {
+ // build prototype combining extendee, Polymer base, and named api
+ this.prototype = this.buildPrototype(name, extendee);
+ // back reference declaration element
+ // TODO(sjmiles): replace `element` with `elementElement` or `declaration`
+ this.prototype.element = this;
+ // more declarative features
+ this.desugar();
+ // TODO(sorvell): install a helper method this.resolvePath to aid in
+ // setting resource paths. e.g.
+ // this.$.image.src = this.resolvePath('images/foo.png')
+ // Potentially remove when spec bug is addressed.
+ // https://www.w3.org/Bugs/Public/show_bug.cgi?id=21407
+ this.addResolvePathApi();
+ // under ShadowDOMPolyfill, transforms to approximate missing CSS features
+ if (window.ShadowDOMPolyfill) {
+ Platform.ShadowCSS.shimStyling(this.templateContent(), name, extendee);
+ }
+ // register our custom element with the platform
+ this.registerPrototype(name, extendee);
+ // reference constructor in a global named by 'constructor' attribute
+ this.publishConstructor();
+ },
+ buildPrototype: function(name, extendee) {
+ // get our custom prototype (before chaining)
+ var prototype = scope.getRegisteredPrototype(name);
+ // get basal prototype
+ var base = this.generateBasePrototype(extendee);
+ // transcribe `attributes` declarations onto own prototype's `publish`
+ this.publishAttributes(prototype, base);
+ // `publish` properties to the prototype and to attribute watch
+ this.publishProperties(prototype, base);
+ // infer observers for `observe` list based on method names
+ this.inferObservers(prototype);
+ // chain various meta-data objects to inherited versions
+ this.inheritMetaData(prototype, base);
+ // chain custom api to inherited
+ prototype = this.chainObject(prototype, base);
+ // build side-chained lists to optimize iterations
+ this.optimizePropertyMaps(prototype, base);
+ // inherit publishing meta-data
+ //this.inheritAttributesObjects(prototype);
+ //this.inheritDelegates(prototype);
// x-platform fixups
ensurePrototypeTraversal(prototype);
return prototype;
},
+ inheritMetaData: function(prototype, base) {
+ // chain observe object to inherited
+ this.inheritObject('observe', prototype, base);
+ // chain publish object to inherited
+ this.inheritObject('publish', prototype, base);
+ // chain our lower-cased publish map to the inherited version
+ this.inheritObject('_publishLC', prototype, base);
+ // chain our instance attributes map to the inherited version
+ this.inheritObject('_instanceAttributes', prototype, base);
+ // chain our event delegates map to the inherited version
+ this.inheritObject('eventDelegates', prototype, base);
+ },
+ // implement various declarative features
+ desugar: function(prototype) {
+ // compile list of attributes to copy to instances
+ this.accumulateInstanceAttributes();
+ // parse on-* delegates declared on `this` element
+ this.parseHostEvents();
+ // parse on-* delegates declared in templates
+ this.parseLocalEvents();
+ // install external stylesheets as if they are inline
+ this.installSheets();
+ // allow custom element access to the declarative context
+ if (this.prototype.registerCallback) {
+ this.prototype.registerCallback(this);
+ }
+ },
+ // if a named constructor is requested in element, map a reference
+ // to the constructor to the given symbol
+ publishConstructor: function() {
+ var symbol = this.getAttribute('constructor');
+ if (symbol) {
+ window[symbol] = this.ctor;
+ }
+ },
// build prototype combining extendee, Polymer base, and named api
generateBasePrototype: function(extnds) {
- // create a prototype based on tag-name extension
- var prototype = generatePrototype(extnds);
- // insert base api in inheritance chain (if needed)
- return this.ensureBaseApi(prototype);
+ var prototype = memoizedBases[extnds];
+ if (!prototype) {
+ // create a prototype based on tag-name extension
+ var prototype = HTMLElement.getPrototypeForTag(extnds);
+ // insert base api in inheritance chain (if needed)
+ prototype = this.ensureBaseApi(prototype);
+ // memoize this base
+ memoizedBases[extnds] = prototype;
+ }
+ return prototype;
},
// install Polymer instance api into prototype chain, as needed
- ensureBaseApi: function(prototype) {
+ ensureBaseApi: function(prototype) {
if (!prototype.PolymerBase) {
- Object.keys(api.instance).forEach(function(n) {
- extend(prototype, api.instance[n]);
- });
- prototype = Object.create(prototype);
+ prototype = Object.create(prototype);
+ // we need a unique copy of base api for each base prototype
+ // therefore we 'extend' here instead of simply chaining
+ // we could memoize instead, especially for the common cases,
+ // in particular, for base === HTMLElement.prototype
+ for (var n in api.instance) {
+ extend(prototype, api.instance[n]);
+ }
}
- // inherit publishing meta-data
- this.inheritAttributesObjects(prototype);
- // inherit event delegates
- this.inheritDelegates(prototype);
// return buffed-up prototype
return prototype;
},
- // mix api registered to 'name' into 'prototype'
- addNamedApi: function(prototype, name) {
- // combine custom api into prototype
- return extend(prototype, scope.getRegisteredPrototype(name));
- },
- // make a fresh object that inherits from a prototype object
- inheritObject: function(prototype, name) {
- // copy inherited properties onto a new object
- prototype[name] = extend({}, Object.getPrototypeOf(prototype)[name]);
+ // ensure prototype[name] inherits from a prototype.prototype[name]
+ inheritObject: function(name, prototype, base) {
+ // require an object
+ var source = prototype[name] || {};
+ // chain inherited properties onto a new object
+ prototype[name] = this.chainObject(source, base[name]);
},
// register 'prototype' to custom element 'name', store constructor
- registerPrototype: function(name) {
- // register the custom type
- this.ctor = document.register(name, {
+ registerPrototype: function(name, extendee) {
+ var info = {
prototype: this.prototype
- });
+ }
+ // native element must be specified in extends
+ if (extendee && extendee.indexOf('-') < 0) {
+ info.extends = extendee;
+ }
+ // register the custom type
+ this.ctor = document.register(name, info);
// constructor shenanigans
this.prototype.constructor = this.ctor;
// register the prototype with HTMLElement for name lookup
HTMLElement.register(name, this.prototype);
}
};
-
+
+ if (Object.__proto__) {
+ prototype.chainObject = function(object, inherited) {
+ if (object && inherited && object !== inherited) {
+ object.__proto__ = inherited;
+ }
+ return object;
+ }
+ } else {
+ prototype.chainObject = function(object, inherited) {
+ if (object && inherited && object !== inherited) {
+ var chained = Object.create(inherited);
+ object = extend(chained, object);
+ }
+ return object;
+ }
+ }
+
+ // memoize base prototypes
+ memoizedBases = {};
+
+ // On platforms that do not support __proto__ (version of IE), the prototype
+ // chain of a custom element is simulated via installation of __proto__.
+ // Although custom elements manages this, we install it here so it's
+ // available during desugaring.
+ function ensurePrototypeTraversal(prototype) {
+ if (!Object.__proto__) {
+ var ancestor = Object.getPrototypeOf(prototype);
+ prototype.__proto__ = ancestor;
+ if (isBase(ancestor)) {
+ ancestor.__proto__ = Object.getPrototypeOf(ancestor);
+ }
+ }
+ }
+
// exports
api.declaration.prototype = prototype;
-
+
})(Polymer);
diff --git a/src/instance/attributes.js b/src/instance/attributes.js
index 1ef6ae6d36..ee6811a220 100644
--- a/src/instance/attributes.js
+++ b/src/instance/attributes.js
@@ -5,26 +5,23 @@
*/
(function(scope) {
- // magic words
-
- var PUBLISHED = '__published';
- var INSTANCE_ATTRIBUTES = '__instance_attributes';
-
// instance api for attributes
var attributes = {
- PUBLISHED: PUBLISHED,
- INSTANCE_ATTRIBUTES: INSTANCE_ATTRIBUTES,
copyInstanceAttributes: function () {
- var a$ = this[INSTANCE_ATTRIBUTES];
+ var a$ = this._instanceAttributes;
for (var k in a$) {
this.setAttribute(k, a$[k]);
}
},
// for each attribute on this, deserialize value to property as needed
takeAttributes: function() {
- for (var i=0, a$=this.attributes, l=a$.length, a; (a=a$[i]) && i= 0) {
+ relectPropertyToAttribute: function(name) {
+ //if (Object.keys(this[PUBLISHED]).indexOf(name) >= 0) {
+ // TODO(sjmiles): consider memoizing this
var inferredType = typeof this.__proto__[name];
+ // try to intelligently serialize property value
var serializedValue = this.serializeValue(this[name], inferredType);
// boolean properties must reflect as boolean attributes
if (serializedValue !== undefined) {
this.setAttribute(name, serializedValue);
- // TODO(sorvell): we should remove attr for all properties
- // that have undefined serialization; however, we will need to
- // refine the attr reflection system to achieve this; pica, for example,
- // relies on having inferredType object properties not removed as
- // attrs.
+ // TODO(sorvell): we should remove attr for all properties
+ // that have undefined serialization; however, we will need to
+ // refine the attr reflection system to achieve this; pica, for example,
+ // relies on having inferredType object properties not removed as
+ // attrs.
} else if (inferredType === 'boolean') {
this.removeAttribute(name);
}
-
- }
+ //}
}
};
- var lowerCase = String.prototype.toLowerCase.call.bind(
- String.prototype.toLowerCase);
-
// exports
scope.api.instance.attributes = attributes;
diff --git a/src/instance/base.js b/src/instance/base.js
index 1514fa0ae6..131975c5fe 100644
--- a/src/instance/base.js
+++ b/src/instance/base.js
@@ -138,7 +138,10 @@
}
},
attributeChangedCallback: function(name, oldValue) {
- this.attributeToProperty(name, this.getAttribute(name));
+ // TODO(sjmiles): adhoc filter
+ if (name !== 'class' && name !== 'style') {
+ this.attributeToProperty(name, this.getAttribute(name));
+ }
if (this.attributeChanged) {
this.attributeChanged.apply(this, arguments);
}
diff --git a/src/instance/mdv.js b/src/instance/mdv.js
index 96df736d93..100b215954 100644
--- a/src/instance/mdv.js
+++ b/src/instance/mdv.js
@@ -35,7 +35,7 @@
// reflect bound property to attribute when binding
// to ensure binding is not left on attribute if property
// does not update due to not changing.
- this.propertyToAttribute(name);
+ this.relectPropertyToAttribute(name);
return this.bindings[name] = observer;
} else {
return this.super(arguments);
diff --git a/src/instance/properties.js b/src/instance/properties.js
index 8e66158fcc..0871abeec1 100644
--- a/src/instance/properties.js
+++ b/src/instance/properties.js
@@ -4,50 +4,73 @@
* license that can be found in the LICENSE file.
*/
(function(scope) {
-
+
// imports
var log = window.logFlags || {};
-
+
// magic words
var OBSERVE_SUFFIX = 'Changed';
-
- var PUBLISHED = scope.api.instance.attributes.PUBLISHED;
// element api
-
+
var empty = [];
var properties = {
- // set up property observers
+ // set up property observers
observeProperties: function() {
- var names = this.getCustomPropertyNames();
- for (var i=0, l=names.length, n; (i
attribute mustaches
-
-
+
+
diff --git a/test/html/bind-object-repeat.html b/test/html/bind-object-repeat.html
index e5e120b47d..00694e7094 100644
--- a/test/html/bind-object-repeat.html
+++ b/test/html/bind-object-repeat.html
@@ -3,8 +3,8 @@
bind object + repeat
-
-
+
+
diff --git a/test/html/bind.html b/test/html/bind.html
index 326c93d262..5fcd4d88ac 100644
--- a/test/html/bind.html
+++ b/test/html/bind.html
@@ -3,8 +3,8 @@
bind simple
-
-
+
+
diff --git a/test/html/callbacks.html b/test/html/callbacks.html
index 2db7b3c1f3..6c3a4297c2 100644
--- a/test/html/callbacks.html
+++ b/test/html/callbacks.html
@@ -3,8 +3,8 @@
callbacks
-
-
+
+
diff --git a/test/html/element-import.html b/test/html/element-import.html
index 656cdc1c60..40b35d72c5 100644
--- a/test/html/element-import.html
+++ b/test/html/element-import.html
@@ -3,8 +3,8 @@
element script
-
-
+
+
diff --git a/test/html/element-registration.html b/test/html/element-registration.html
index 08d9b40318..bfb43962ce 100644
--- a/test/html/element-registration.html
+++ b/test/html/element-registration.html
@@ -3,8 +3,8 @@
element script
-
-
+
+
@@ -30,6 +30,7 @@
+
@@ -128,6 +129,17 @@
+
+
+ Hello World
+
+
+
+
diff --git a/test/html/element-script.html b/test/html/element-script.html
index c2b2d6236a..4fc2a3ea9d 100644
--- a/test/html/element-script.html
+++ b/test/html/element-script.html
@@ -3,8 +3,8 @@
element script
-
-
+
+
diff --git a/test/html/event-path-declarative.html b/test/html/event-path-declarative.html
index 9b26b0e954..a6684492aa 100644
--- a/test/html/event-path-declarative.html
+++ b/test/html/event-path-declarative.html
@@ -6,8 +6,8 @@
-
-
+
+
Test
diff --git a/test/html/event-path.html b/test/html/event-path.html
index 8ab12e9786..7e4f0b037e 100644
--- a/test/html/event-path.html
+++ b/test/html/event-path.html
@@ -3,8 +3,8 @@
event path
-
-
+
+
diff --git a/test/html/mdv-syntax.html b/test/html/mdv-syntax.html
index a464faa553..2b44c03e1a 100644
--- a/test/html/mdv-syntax.html
+++ b/test/html/mdv-syntax.html
@@ -9,8 +9,8 @@
mdv syntax
-
-
+
+
diff --git a/test/html/parser-rules-import.html b/test/html/parser-rules-import.html
index c3418ef411..eed7868580 100644
--- a/test/html/parser-rules-import.html
+++ b/test/html/parser-rules-import.html
@@ -2,8 +2,8 @@
HTML Imports Test
-
-
+
+
diff --git a/test/html/parser-rules.html b/test/html/parser-rules.html
index ead81ff825..fab3994a86 100644
--- a/test/html/parser-rules.html
+++ b/test/html/parser-rules.html
@@ -2,8 +2,8 @@
HTML Imports Test
-
-
+
+
diff --git a/test/html/prepare.html b/test/html/prepare.html
index 418e20f348..101607fce4 100644
--- a/test/html/prepare.html
+++ b/test/html/prepare.html
@@ -3,8 +3,8 @@
prepare test
-
-
+
+
diff --git a/test/html/prop-attr-reflection.html b/test/html/prop-attr-reflection.html
index 84cffd44d0..ce632537b0 100644
--- a/test/html/prop-attr-reflection.html
+++ b/test/html/prop-attr-reflection.html
@@ -3,8 +3,8 @@
publish attributes
-
-
+
+
diff --git a/test/html/prop-bind-oo.html b/test/html/prop-bind-oo.html
index 9a7a0b0eeb..9a59fa7fd5 100644
--- a/test/html/prop-bind-oo.html
+++ b/test/html/prop-bind-oo.html
@@ -3,8 +3,8 @@
bind properties compatible with object observe
-
-
+
+
diff --git a/test/html/publish-attributes.html b/test/html/publish-attributes.html
index c38f055dbd..ebb55e1623 100644
--- a/test/html/publish-attributes.html
+++ b/test/html/publish-attributes.html
@@ -3,8 +3,8 @@
publish attributes
-
-
+
+
@@ -47,27 +47,11 @@
document.addEventListener('WebComponentsReady', function() {
//
assert.deepEqual(
- XFoo.prototype.__published,
+ XFoo.prototype.publish,
{Foo: null, baz: null});
assert.deepEqual(
- XBar.prototype.__published,
+ XBar.prototype.publish,
{Foo: null, baz: null, Bar: null});
- /*assert.deepEqual(
- XZot.prototype.__published,
- {Foo: null, baz: null, Bar: null, zot: 3});
- assert.deepEqual(
- XSquid.prototype.__published,
- {Foo: null, baz: 13, Bar: null, zot: 5, squid: 7});*/
- //
- /*
- assert.equal(
- Polymer.propertyForAttribute.call(XFoo.prototype, 'foo'),
- 'Foo');
- XFoo.prototype.baz = true;
- assert.isUndefined(
- Polymer.propertyForAttribute.call(XFoo.prototype, 'splat'));
- */
- //
done();
});
diff --git a/test/html/reflection.html b/test/html/reflection.html
new file mode 100644
index 0000000000..53685f1147
--- /dev/null
+++ b/test/html/reflection.html
@@ -0,0 +1,54 @@
+
+
+
+ general reflection tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/test/html/styling/apply-reset-styles.html b/test/html/styling/apply-reset-styles.html
index aea8ce69f3..3834a38d52 100644
--- a/test/html/styling/apply-reset-styles.html
+++ b/test/html/styling/apply-reset-styles.html
@@ -8,8 +8,8 @@
applyAuthorStyles / resetStyleInheirtance
-
-
+
+
diff --git a/test/html/take-attributes.html b/test/html/take-attributes.html
index 0378c8a80b..45dc7ac1c9 100644
--- a/test/html/take-attributes.html
+++ b/test/html/take-attributes.html
@@ -3,8 +3,8 @@
take attributes
-
-
+
+
diff --git a/test/html/template-distribute-dynamic.html b/test/html/template-distribute-dynamic.html
index 3f1f2844b5..385b020f61 100644
--- a/test/html/template-distribute-dynamic.html
+++ b/test/html/template-distribute-dynamic.html
@@ -3,8 +3,8 @@
template distribute
-
-
+
+
diff --git a/test/html/unbind.html b/test/html/unbind.html
index 4e4a61e937..025cde7990 100644
--- a/test/html/unbind.html
+++ b/test/html/unbind.html
@@ -3,8 +3,8 @@
unbind
-
-
+
+
diff --git a/test/runner.html b/test/runner.html
index c1af4de86d..33a098cfb5 100644
--- a/test/runner.html
+++ b/test/runner.html
@@ -9,10 +9,10 @@
Polymer Test Runner (Mocha)
-
-
-
-
+
+
+
+
diff --git a/tools b/tools
deleted file mode 160000
index 93f21ac3de..0000000000
--- a/tools
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 93f21ac3de9e71e054a8d4875a5d77852f4f769d