Skip to content

Commit

Permalink
v1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Aug 28, 2015
1 parent c0bd5a7 commit 9b0a25e
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 49 deletions.
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
10 changes: 5 additions & 5 deletions build.log
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BUILD LOG
---------
Build Time: 2015-08-20T15:31:36-0700
Build Time: 2015-08-28T16:40:26-0700

NODEJS INFORMATION
==================
Expand All @@ -17,10 +17,10 @@ run-sequence: 1.1.1

REPO REVISIONS
==============
polymer: 26e8250d18f1c17fc31c77ea9475609c1477d57c
polymer: bffa3527bb9cd32b81fccd1cc16c867f9f0758a4

BUILD HASHES
============
polymer-mini.html: f9f87e6a0bea7c6eb183fbfaef720982d205ffdd
polymer-micro.html: 25529ff94754f6e8320f4dce1592ac7d3677965a
polymer.html: a7b56fb065f09e230e3f55235b419d095284c4f1
polymer-mini.html: 72c032eacc45c63431054c111d0ce86357eb07f3
polymer-micro.html: 42f3dd36e52f8171610b8d21da5a361f5ead7b9b
polymer.html: fafcb9bcef9f7cb9f9db0ac398fefbb4cd4d068d
59 changes: 37 additions & 22 deletions polymer-micro.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
}
}());
Polymer = {
window.Polymer = {
Settings: function () {
var user = window.Polymer || {};
location.search.slice(1).split('&').forEach(function (o) {
Expand Down Expand Up @@ -48,15 +48,21 @@
(function () {
var userPolymer = window.Polymer;
window.Polymer = function (prototype) {
var ctor = desugar(prototype);
prototype = ctor.prototype;
var options = { prototype: prototype };
if (prototype.extends) {
options.extends = prototype.extends;
if (typeof prototype === 'function') {
prototype = prototype.prototype;
}
if (!prototype) {
prototype = {};
}
var factory = desugar(prototype);
prototype = factory.prototype;
var options = {
prototype: prototype,
extends: prototype.extends
};
Polymer.telemetry._registrate(prototype);
document.registerElement(prototype.is, options);
return ctor;
return factory;
};
var desugar = function (prototype) {
var base = Polymer.Base;
Expand Down Expand Up @@ -133,6 +139,8 @@
this.extend(this, feature);
},
registerCallback: function () {
this._desugarBehaviors();
this._doBehavior('beforeRegister');
this._registerFeatures();
this._doBehavior('registered');
},
Expand Down Expand Up @@ -238,6 +246,7 @@
}
},
import: function (id, selector) {
if (id) {
var m = findModule(id);
if (!m) {
forceDocumentUpgrade();
Expand All @@ -248,15 +257,15 @@
}
return m;
}
}
});
var cePolyfill = window.CustomElements && !CustomElements.useNative;
document.registerElement('dom-module', DomModule);
function forceDocumentUpgrade() {
if (cePolyfill) {
var script = document._currentScript || document.currentScript;
var doc = script && script.ownerDocument;
if (doc && !doc.__customElementsForceUpgraded) {
doc.__customElementsForceUpgraded = true;
if (doc) {
CustomElements.upgradeAll(doc);
}
}
Expand All @@ -278,11 +287,17 @@
});
Polymer.Base._addFeature({
behaviors: [],
_prepBehaviors: function () {
_desugarBehaviors: function () {
if (this.behaviors.length) {
this.behaviors = this._flattenBehaviorsList(this.behaviors);
this.behaviors = this._desugarSomeBehaviors(this.behaviors);
}
this._prepAllBehaviors(this.behaviors);
},
_desugarSomeBehaviors: function (behaviors) {
behaviors = this._flattenBehaviorsList(behaviors);
for (var i = behaviors.length - 1; i >= 0; i--) {
this._mixinBehavior(behaviors[i]);
}
return behaviors;
},
_flattenBehaviorsList: function (behaviors) {
var flat = [];
Expand All @@ -297,15 +312,6 @@
}, this);
return flat;
},
_prepAllBehaviors: function (behaviors) {
for (var i = behaviors.length - 1; i >= 0; i--) {
this._mixinBehavior(behaviors[i]);
}
for (var i = 0, l = behaviors.length; i < l; i++) {
this._prepBehavior(behaviors[i]);
}
this._prepBehavior(this);
},
_mixinBehavior: function (b) {
Object.getOwnPropertyNames(b).forEach(function (n) {
switch (n) {
Expand All @@ -329,6 +335,15 @@
}
}, this);
},
_prepBehaviors: function () {
this._prepFlattenedBehaviors(this.behaviors);
},
_prepFlattenedBehaviors: function (behaviors) {
for (var i = 0, l = behaviors.length; i < l; i++) {
this._prepBehavior(behaviors[i]);
}
this._prepBehavior(this);
},
_doBehavior: function (name, args) {
this.behaviors.forEach(function (b) {
this._invokeBehavior(b, name, args);
Expand Down Expand Up @@ -561,7 +576,7 @@
}
}
});
Polymer.version = '1.1.1';
Polymer.version = '1.1.2';
Polymer.Base._addFeature({
_registerFeatures: function () {
this._prepIs();
Expand Down
42 changes: 31 additions & 11 deletions polymer-mini.html
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,9 @@
},
_tryRemoveUndistributedNode: function (node) {
if (this.node.shadyRoot) {
if (node._composedParent) {
nativeRemoveChild.call(node._composedParent, node);
var parent = getComposedParent(node);
if (parent) {
nativeRemoveChild.call(parent, node);
}
return true;
}
Expand Down Expand Up @@ -618,7 +619,7 @@
this._updateInsertionPoints(root.host);
this._lazyDistribute(root.host);
} else if (ensureComposedRemoval) {
removeFromComposedParent(node._composedParent, node);
removeFromComposedParent(getComposedParent(node), node);
}
},
_removeDistributedChildren: function (root, container) {
Expand Down Expand Up @@ -842,7 +843,7 @@
},
parentNode: {
get: function () {
return this.node._lightParent || (this.node.__patched ? this.node._composedParent : this.node.parentNode);
return this.node._lightParent || getComposedParent(this.node);
},
configurable: true
},
Expand Down Expand Up @@ -964,6 +965,18 @@
return getInnerHTML(this.node, true);
};
} else {
var forwardMethods = [
'cloneNode',
'appendChild',
'insertBefore',
'removeChild',
'replaceChild'
];
forwardMethods.forEach(function (name) {
DomApi.prototype[name] = function () {
return this.node[name].apply(this.node, arguments);
};
});
DomApi.prototype.querySelectorAll = function (selector) {
return Array.prototype.slice.call(this.node.querySelectorAll(selector));
};
Expand All @@ -976,9 +989,6 @@
n = n.parentNode;
}
};
DomApi.prototype.cloneNode = function (deep) {
return this.node.cloneNode(deep);
};
DomApi.prototype.importNode = function (externalNode, deep) {
var doc = this.node instanceof Document ? this.node : this.node.ownerDocument;
return doc.importNode(externalNode, deep);
Expand Down Expand Up @@ -1025,7 +1035,7 @@
configurable: true
}
});
var forwards = [
var forwardProperties = [
'parentNode',
'firstChild',
'lastChild',
Expand All @@ -1036,7 +1046,7 @@
'nextElementSibling',
'previousElementSibling'
];
forwards.forEach(function (name) {
forwardProperties.forEach(function (name) {
Object.defineProperty(DomApi.prototype, name, {
get: function () {
return this.node[name];
Expand Down Expand Up @@ -1120,6 +1130,9 @@
addNodeToComposedChildren(node, parent, children, i);
}
}
function getComposedParent(node) {
return node.__patched ? node._composedParent : node.parentNode;
}
function addNodeToComposedChildren(node, parent, children, i) {
node._composedParent = parent;
children.splice(i >= 0 ? i : children.length, 0, node);
Expand Down Expand Up @@ -1150,6 +1163,7 @@
var matchesSelector = p.matches || p.matchesSelector || p.mozMatchesSelector || p.msMatchesSelector || p.oMatchesSelector || p.webkitMatchesSelector;
return {
getLightChildren: getLightChildren,
getComposedParent: getComposedParent,
getComposedChildren: getComposedChildren,
removeFromComposedParent: removeFromComposedParent,
saveLightChildrenIfNeeded: saveLightChildrenIfNeeded,
Expand Down Expand Up @@ -1338,7 +1352,9 @@
var splices = Polymer.ArraySplice.calculateSplices(children, composed);
for (var i = 0, d = 0, s; i < splices.length && (s = splices[i]); i++) {
for (var j = 0, n; j < s.removed.length && (n = s.removed[j]); j++) {
if (getComposedParent(n) === container) {
remove(n);
}
composed.splice(s.index + d, 1);
}
d -= s.addedCount;
Expand All @@ -1351,6 +1367,7 @@
composed.splice(j, 0, n);
}
}
ensureComposedParent(container, children);
},
_matchesContentSelect: function (node, contentElement) {
var select = contentElement.getAttribute('select');
Expand Down Expand Up @@ -1380,6 +1397,7 @@
var matchesSelector = Polymer.DomApi.matchesSelector;
var hasInsertionPoint = Polymer.DomApi.hasInsertionPoint;
var getComposedChildren = Polymer.DomApi.getComposedChildren;
var getComposedParent = Polymer.DomApi.getComposedParent;
var removeFromComposedParent = Polymer.DomApi.removeFromComposedParent;
function distributeNodeInto(child, insertionPoint) {
insertionPoint._distributedNodes.push(child);
Expand Down Expand Up @@ -1433,8 +1451,10 @@
nativeRemoveChild.call(parentNode, node);
}
}
function getComposedParent(node) {
return node.__patched ? node._composedParent : node.parentNode;
function ensureComposedParent(parent, children) {
for (var i = 0, n; i < children.length; i++) {
children[i]._composedParent = parent;
}
}
function getTopDistributingHost(host) {
while (host && hostNeedsRedistribution(host)) {
Expand Down
35 changes: 25 additions & 10 deletions polymer.html
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@
this._notes = [];
} else {
Polymer.Annotations.prepElement = this._prepElement.bind(this);
if (this._template._content && this._template._content._notes) {
this._notes = this._template._content._notes;
} else {
this._notes = Polymer.Annotations.parseAnnotations(this._template);
}
this._processAnnotations(this._notes);
Polymer.Annotations.prepElement = null;
}
Expand Down Expand Up @@ -2233,6 +2237,9 @@
style.__cssRules = null;
},
forEachStyleRule: function (node, callback) {
if (!node) {
return;
}
var s = node.parsedSelector;
var skipRules = false;
if (node.type === this.ruleTypes.STYLE_RULE) {
Expand Down Expand Up @@ -2261,19 +2268,22 @@
target.insertBefore(style, afterNode && afterNode.nextSibling || target.firstChild);
return style;
},
cssFromModules: function (moduleIds) {
cssFromModules: function (moduleIds, warnIfNotFound) {
var modules = moduleIds.trim().split(' ');
var cssText = '';
for (var i = 0; i < modules.length; i++) {
cssText += this.cssFromModule(modules[i]);
cssText += this.cssFromModule(modules[i], warnIfNotFound);
}
return cssText;
},
cssFromModule: function (moduleId) {
cssFromModule: function (moduleId, warnIfNotFound) {
var m = Polymer.DomModule.import(moduleId);
if (m && !m._cssText) {
m._cssText = this._cssFromElement(m);
}
if (!m && warnIfNotFound) {
console.warn('Could not find style data in module named', moduleId);
}
return m && m._cssText || '';
},
_cssFromElement: function (element) {
Expand All @@ -2287,12 +2297,12 @@
} else {
if (e.localName === 'style') {
var include = e.getAttribute(this.INCLUDE_ATTR);
if (include) {
cssText += this.cssFromModules(include, true);
}
e = e.__appliedElement || e;
e.parentNode.removeChild(e);
cssText += this.resolveCss(e.textContent, element.ownerDocument);
if (include) {
cssText += this.cssFromModules(include);
}
} else if (e.import && e.import.body) {
cssText += this.resolveCss(e.import.body.textContent, e.import);
}
Expand Down Expand Up @@ -3229,15 +3239,20 @@
_apply: function () {
var e = this.__appliedElement || this;
if (this.include) {
e.textContent += styleUtil.cssFromModules(this.include);
e.textContent = styleUtil.cssFromModules(this.include, true) + e.textContent;
}
var rules = styleUtil.rulesForStyle(e);
styleUtil.forEachStyleRule(rules, function (rule) {
if (e.textContent) {
styleUtil.forEachStyleRule(styleUtil.rulesForStyle(e), function (rule) {
styleTransformer.documentRule(rule);
});
this._applyCustomProperties(e);
}
},
_applyCustomProperties: function (element) {
this._computeStyleProperties();
var props = this._styleProperties;
e.textContent = styleUtil.toCssText(rules, function (rule) {
var rules = styleUtil.rulesForStyle(element);
element.textContent = styleUtil.toCssText(rules, function (rule) {
var css = rule.cssText = rule.parsedCssText;
if (rule.propertyInfo && rule.propertyInfo.cssText) {
css = cssParse.removeCustomPropAssignment(css);
Expand Down

0 comments on commit 9b0a25e

Please sign in to comment.