Skip to content

Commit

Permalink
Merge branch 'master' into effective-children
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Aug 31, 2015
2 parents ff2c088 + d3a7c93 commit c09296e
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 30 deletions.
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Change Log

##[v1.1.2](https://github.com/Polymer/polymer/tree/v1.1.2) (2015-08-28)
- Improve composed parent tracking. ([commit](https://github.com/Polymer/polymer/commit/4d15789))

- move the mixing-in of behaviors so that it happens before `register` behaviors are invoked ([commit](https://github.com/Polymer/polymer/commit/637367c))

- Fixes #2378 ([commit](https://github.com/Polymer/polymer/commit/a9f081b))

- Fixes #2356: issue a warning and don't throw an exception when a style include cannot be found. Fixes #2357: include data now comes before any textContent in a style element. ([commit](https://github.com/Polymer/polymer/commit/a16ada1))

- remove unneeded protection code for extends. ([commit](https://github.com/Polymer/polymer/commit/8eada87))

- Add test ([commit](https://github.com/Polymer/polymer/commit/47ff0e8))

- add test for `registered` behavior affecting a value then used by features ([commit](https://github.com/Polymer/polymer/commit/230528c))

- add tests for new Polymer() argument support (and make Base tests aware of new abstract method `_desugarBehaviors`) ([commit](https://github.com/Polymer/polymer/commit/9734a3a))

- invoke `registration` behavior before registering features, so behaviors can alter features, this requires calling behavior flattening as part of prototype desugaring instead of as part of behavior prep, so the flattened list is available early ([commit](https://github.com/Polymer/polymer/commit/6224dc3))

- do `registered` behaviors before invoking `registerFeatures` so `registered` can affect properties used by features (ref #2329) ([commit](https://github.com/Polymer/polymer/commit/61d611c))

- specifically create `Polymer` object on `window` to satisfy strict mode (fixes #2363) ([commit](https://github.com/Polymer/polymer/commit/a75133d))

- Remove forceUpgraded check in dom-module.import ([commit](https://github.com/Polymer/polymer/commit/b85b641))

- Fixes #2341: branch Polymer.dom to use native dom methods under Shadow DOM for: appendChild, insertBefore, removeChild, replaceChild, cloneNode. ([commit](https://github.com/Polymer/polymer/commit/9b1f706))

- Fixes #2334: when composing nodes in shady dom, check if a node is where we expect it to be before removing it from its distributed position. We do this because the node may have been moved by Polymer.dom in a way that triggered distribution of its previous location. The node is already where it needs to be so removing it from its parent when it's no longer distributed is destructive. ([commit](https://github.com/Polymer/polymer/commit/4ea69c2))

- use cached template annotations when possible ([commit](https://github.com/Polymer/polymer/commit/b0733d3))

- fix comment typos ([commit](https://github.com/Polymer/polymer/commit/a0a3e0c))

- Update changelog with v1.1.1 release ([commit](https://github.com/Polymer/polymer/commit/12fa867))

##[v1.1.1](https://github.com/Polymer/polymer/tree/v1.1.1) (2015-08-20)
- Fixes #2263: ensure custom-style can parse variable definitions in supported selectors (e.g. /deep/) without exception due to unknown css. ([commit](https://github.com/Polymer/polymer/commit/894492b))

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "polymer",
"version": "1.1.1",
"version": "1.1.2",
"main": [
"polymer.html"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Polymer",
"version": "1.1.1",
"version": "1.1.2",
"description": "Authors interested in learning the core concepts in 0.8 may be interested in our [primer](https://github.com/Polymer/polymer/blob/0.8-preview/PRIMER.md).",
"main": "polymer.html",
"directories": {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
registerCallback: function() {
// TODO(sjmiles): perhaps this method should be called from polymer-bootstrap?
this._desugarBehaviors(); // abstract
this._doBehavior('registered'); // abstract
this._doBehavior('beforeRegister'); // abstract
this._registerFeatures(); // abstract
this._doBehavior('registered'); // abstract
},

createdCallback: function() {
Expand Down
24 changes: 13 additions & 11 deletions src/lib/dom-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,20 @@
* at the specified `id`.
*/
import: function(id, selector) {
var m = findModule(id);
if (!m) {
// If polyfilling, a script can run before a dom-module element
// is upgraded. We force the containing document to upgrade
// and try again to workaround this polyfill limitation.
forceDocumentUpgrade();
m = findModule(id);
}
if (m && selector) {
m = m.querySelector(selector);
if (id) {
var m = findModule(id);
if (!m) {
// If polyfilling, a script can run before a dom-module element
// is upgraded. We force the containing document to upgrade
// and try again to workaround this polyfill limitation.
forceDocumentUpgrade();
m = findModule(id);
}
if (m && selector) {
m = m.querySelector(selector);
}
return m;
}
return m;
}

});
Expand Down
49 changes: 34 additions & 15 deletions test/unit/behaviors-elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,26 +219,45 @@

</dom-module>

<dom-module id="registration-behaviors">
<dom-module id="behavior-as-is">

<script>
<template><div id="content"></div></template>

Polymer.registerBehavior ={
registered: function() {
this.is = this.as;
}
};
</dom-module>

Polymer({
<script>

behaviors: [
Polymer.registerBehavior
],
Polymer.registerBehavior ={
beforeRegister: function() {
this.is = this.as;
this.properties = {
prop: {
observer: 'propChanged1'
}
};
this.hostAttributes = {
attr: true
};
this.observers = [
'propChanged2(prop)'
];
},
propChanged1: function() {
this.propChanged1Called = true;
},
propChanged2: function() {
this.propChanged2Called = true;
}
};

as: 'behavior-as-is'
Polymer({

});
behaviors: [
Polymer.registerBehavior
],

</script>
as: 'behavior-as-is'

});

</dom-module>
</script>
7 changes: 6 additions & 1 deletion test/unit/behaviors.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,14 @@
assert.equal(typeof el._setHasOptionsA, 'function');
});

test('registered behavior', function() {
test('beforeRegister behavior', function() {
var el = document.createElement('behavior-as-is');
assert.equal(el.is, 'behavior-as-is');
assert.ok(el.$.content);
el.prop = 42;
assert.isTrue(el.propChanged1Called);
assert.isTrue(el.propChanged2Called);
assert.isTrue(el.hasAttribute('attr'));
});

});
Expand Down

0 comments on commit c09296e

Please sign in to comment.