diff --git a/lib/legacy/class.html b/lib/legacy/class.html
index 671b297dd3..930015b757 100644
--- a/lib/legacy/class.html
+++ b/lib/legacy/class.html
@@ -203,9 +203,9 @@
static get properties() {
const properties = {};
- if (this.prototype.behaviors) {
- for (let i=0, b; i < this.prototype.behaviors.length; i++) {
- b = this.prototype.behaviors[i];
+ if (this.prototype.__behaviors) {
+ for (let i=0, b; i < this.prototype.__behaviors.length; i++) {
+ b = this.prototype.__behaviors[i];
mergeProperties(properties, b.properties);
}
}
@@ -215,9 +215,9 @@
static get observers() {
let observers = [];
- if (this.prototype.behaviors) {
- for (let i=0, b; i < this.prototype.behaviors.length; i++) {
- b = this.prototype.behaviors[i];
+ if (this.prototype.__behaviors) {
+ for (let i=0, b; i < this.prototype.__behaviors.length; i++) {
+ b = this.prototype.__behaviors[i];
if (b.observers) {
observers = observers.concat(b.observers);
}
@@ -273,8 +273,8 @@
`is` in `beforeRegister` as you could in 1.x.
*/
const proto = this;
- if (proto.hasOwnProperty('behaviors')) {
- copyBehaviorProperties(proto.behaviors, proto.constructor);
+ if (proto.hasOwnProperty('__behaviors')) {
+ copyBehaviorProperties(proto.__behaviors, proto.constructor);
}
proto.__behaviorMetaProps = proto.__behaviorMetaProps || {};
copyProperties(info, proto);
@@ -420,12 +420,12 @@
if (!Array.isArray(behaviors)) {
behaviors = [behaviors];
}
- let superBehaviors = PolymerGenerated.prototype.__allBehaviors;
+ let superBehaviors = PolymerGenerated.prototype.behaviors;
// get flattened, deduped list of behaviors *not* already on super class
behaviors = flattenBehaviors(behaviors, null, superBehaviors);
- PolymerGenerated.prototype.__allBehaviors = superBehaviors ?
+ PolymerGenerated.prototype.behaviors = superBehaviors ?
superBehaviors.concat(behaviors) : behaviors;
- PolymerGenerated.prototype.behaviors = behaviors;
+ PolymerGenerated.prototype.__behaviors = behaviors;
}
PolymerGenerated.generatedFrom = info;
diff --git a/lib/mixins/element-mixin.html b/lib/mixins/element-mixin.html
index 3a0f3b7fad..dce111c712 100644
--- a/lib/mixins/element-mixin.html
+++ b/lib/mixins/element-mixin.html
@@ -21,6 +21,8 @@
(function() {
'use strict';
+ const builtCSS = window.ShadyCSS && window.ShadyCSS['cssBuild'];
+
/**
* Element class mixin that provides the core API for Polymer's meta-programming
* features including template stamping, data-binding, attribute deserialization,
@@ -252,7 +254,7 @@
* @private
*/
function processElementStyles(klass, template, is, baseURI) {
- if (!window.skipStyleIncludesAndUrls) {
+ if (!builtCSS) {
const templateStyles = template.content.querySelectorAll('style');
const stylesWithImports = Polymer.StyleGather.stylesFromTemplate(template);
// insert styles from at the top of the template
diff --git a/test/unit/mixin-behaviors.html b/test/unit/mixin-behaviors.html
index 730f7ceb2b..6f4dc50428 100644
--- a/test/unit/mixin-behaviors.html
+++ b/test/unit/mixin-behaviors.html
@@ -551,7 +551,7 @@
});
test('nested-behavior dedups', function() {
- assert.equal(el.behaviors.length, 2);
+ assert.equal(el.behaviors.length, 6);
});
test('nested-behavior lifecycle', function() {