Skip to content

Commit c09296e

Browse files
author
Steven Orvell
committed
Merge branch 'master' into effective-children
2 parents ff2c088 + d3a7c93 commit c09296e

File tree

7 files changed

+92
-30
lines changed

7 files changed

+92
-30
lines changed

CHANGELOG.md

+35
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Change Log
22

3+
##[v1.1.2](https://github.com/Polymer/polymer/tree/v1.1.2) (2015-08-28)
4+
- Improve composed parent tracking. ([commit](https://github.com/Polymer/polymer/commit/4d15789))
5+
6+
- move the mixing-in of behaviors so that it happens before `register` behaviors are invoked ([commit](https://github.com/Polymer/polymer/commit/637367c))
7+
8+
- Fixes #2378 ([commit](https://github.com/Polymer/polymer/commit/a9f081b))
9+
10+
- 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))
11+
12+
- remove unneeded protection code for extends. ([commit](https://github.com/Polymer/polymer/commit/8eada87))
13+
14+
- Add test ([commit](https://github.com/Polymer/polymer/commit/47ff0e8))
15+
16+
- add test for `registered` behavior affecting a value then used by features ([commit](https://github.com/Polymer/polymer/commit/230528c))
17+
18+
- 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))
19+
20+
- 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))
21+
22+
- do `registered` behaviors before invoking `registerFeatures` so `registered` can affect properties used by features (ref #2329) ([commit](https://github.com/Polymer/polymer/commit/61d611c))
23+
24+
- specifically create `Polymer` object on `window` to satisfy strict mode (fixes #2363) ([commit](https://github.com/Polymer/polymer/commit/a75133d))
25+
26+
- Remove forceUpgraded check in dom-module.import ([commit](https://github.com/Polymer/polymer/commit/b85b641))
27+
28+
- 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))
29+
30+
- 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))
31+
32+
- use cached template annotations when possible ([commit](https://github.com/Polymer/polymer/commit/b0733d3))
33+
34+
- fix comment typos ([commit](https://github.com/Polymer/polymer/commit/a0a3e0c))
35+
36+
- Update changelog with v1.1.1 release ([commit](https://github.com/Polymer/polymer/commit/12fa867))
37+
338
##[v1.1.1](https://github.com/Polymer/polymer/tree/v1.1.1) (2015-08-20)
439
- 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))
540

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "polymer",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"main": [
55
"polymer.html"
66
],

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Polymer",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"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).",
55
"main": "polymer.html",
66
"directories": {

src/lib/base.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
registerCallback: function() {
2727
// TODO(sjmiles): perhaps this method should be called from polymer-bootstrap?
2828
this._desugarBehaviors(); // abstract
29-
this._doBehavior('registered'); // abstract
29+
this._doBehavior('beforeRegister'); // abstract
3030
this._registerFeatures(); // abstract
31+
this._doBehavior('registered'); // abstract
3132
},
3233

3334
createdCallback: function() {

src/lib/dom-module.html

+13-11
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,20 @@
6767
* at the specified `id`.
6868
*/
6969
import: function(id, selector) {
70-
var m = findModule(id);
71-
if (!m) {
72-
// If polyfilling, a script can run before a dom-module element
73-
// is upgraded. We force the containing document to upgrade
74-
// and try again to workaround this polyfill limitation.
75-
forceDocumentUpgrade();
76-
m = findModule(id);
77-
}
78-
if (m && selector) {
79-
m = m.querySelector(selector);
70+
if (id) {
71+
var m = findModule(id);
72+
if (!m) {
73+
// If polyfilling, a script can run before a dom-module element
74+
// is upgraded. We force the containing document to upgrade
75+
// and try again to workaround this polyfill limitation.
76+
forceDocumentUpgrade();
77+
m = findModule(id);
78+
}
79+
if (m && selector) {
80+
m = m.querySelector(selector);
81+
}
82+
return m;
8083
}
81-
return m;
8284
}
8385

8486
});

test/unit/behaviors-elements.html

+34-15
Original file line numberDiff line numberDiff line change
@@ -219,26 +219,45 @@
219219

220220
</dom-module>
221221

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

224-
<script>
224+
<template><div id="content"></div></template>
225225

226-
Polymer.registerBehavior ={
227-
registered: function() {
228-
this.is = this.as;
229-
}
230-
};
226+
</dom-module>
231227

232-
Polymer({
228+
<script>
233229

234-
behaviors: [
235-
Polymer.registerBehavior
236-
],
230+
Polymer.registerBehavior ={
231+
beforeRegister: function() {
232+
this.is = this.as;
233+
this.properties = {
234+
prop: {
235+
observer: 'propChanged1'
236+
}
237+
};
238+
this.hostAttributes = {
239+
attr: true
240+
};
241+
this.observers = [
242+
'propChanged2(prop)'
243+
];
244+
},
245+
propChanged1: function() {
246+
this.propChanged1Called = true;
247+
},
248+
propChanged2: function() {
249+
this.propChanged2Called = true;
250+
}
251+
};
237252

238-
as: 'behavior-as-is'
253+
Polymer({
239254

240-
});
255+
behaviors: [
256+
Polymer.registerBehavior
257+
],
241258

242-
</script>
259+
as: 'behavior-as-is'
260+
261+
});
243262

244-
</dom-module>
263+
</script>

test/unit/behaviors.html

+6-1
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@
5252
assert.equal(typeof el._setHasOptionsA, 'function');
5353
});
5454

55-
test('registered behavior', function() {
55+
test('beforeRegister behavior', function() {
5656
var el = document.createElement('behavior-as-is');
5757
assert.equal(el.is, 'behavior-as-is');
58+
assert.ok(el.$.content);
59+
el.prop = 42;
60+
assert.isTrue(el.propChanged1Called);
61+
assert.isTrue(el.propChanged2Called);
62+
assert.isTrue(el.hasAttribute('attr'));
5863
});
5964

6065
});

0 commit comments

Comments
 (0)