diff --git a/PRIMER.md b/PRIMER.md index 2508799a..11b77286 100644 --- a/PRIMER.md +++ b/PRIMER.md @@ -167,8 +167,8 @@ MyElement = Polymer({ is: 'my-element', factoryImpl: function(foo, bar) { - el.foo = foo; - el.configureWithBar(bar); + this.foo = foo; + this.configureWithBar(bar); }, configureWithBar: function(bar) { diff --git a/src/lib/polymer-bootstrap.html b/src/lib/polymer-bootstrap.html index cdfc63a4..b21677b3 100644 --- a/src/lib/polymer-bootstrap.html +++ b/src/lib/polymer-bootstrap.html @@ -60,8 +60,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN return prototype.constructor; }; - window.Polymer = Polymer; - if (userPolymer) { for (var i in userPolymer) { Polymer[i] = userPolymer[i]; @@ -98,4 +96,3 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }; - diff --git a/src/lib/style-transformer.html b/src/lib/style-transformer.html index 1a072f76..419c38d6 100644 --- a/src/lib/style-transformer.html +++ b/src/lib/style-transformer.html @@ -30,9 +30,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN * :host(...) -> scopeName... - * ::content -> ' ' NOTE: requires use of scoping selector and selectors - cannot otherwise be scoped: - e.g. :host ::content > .bar -> x-foo > .bar + * ::content -> ' ' * ::shadow, /deep/: processed similar to ::content @@ -161,6 +159,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN var stop = false; var hostContext = false; var self = this; + selector = selector.replace(CONTENT_START, HOST + ' $1'); selector = selector.replace(SIMPLE_SELECTOR_SEP, function(m, c, s) { if (!stop) { var info = self._transformCompoundSelector(s, c, scope, hostScope); @@ -256,7 +255,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN // NOTE: this supports 1 nested () pair for things like // :host(:not([selected]), more general support requires // parsing which seems like overkill - var HOST_PAREN = /(\:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/g; + var HOST_PAREN = /(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/g; var HOST_CONTEXT = ':host-context'; var HOST_CONTEXT_PAREN = /(.*)(?::host-context)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))(.*)/; var CONTENT = '::content'; @@ -266,6 +265,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN var CSS_ATTR_SUFFIX = ']'; var PSEUDO_PREFIX = ':'; var CLASS = 'class'; + var CONTENT_START = new RegExp('^(' + CONTENT + ')'); // exports return api; diff --git a/src/standard/configure.html b/src/standard/configure.html index d32205aa..8d4102a7 100644 --- a/src/standard/configure.html +++ b/src/standard/configure.html @@ -136,7 +136,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN for (var i=0, l=fx.length, x; (i diff --git a/test/unit/polymer-dom-elements.html b/test/unit/polymer-dom-elements.html index d4afa8b2..53956048 100644 --- a/test/unit/polymer-dom-elements.html +++ b/test/unit/polymer-dom-elements.html @@ -200,7 +200,7 @@ box-sizing: border-box; } - :host ::content .add3 { + ::content .add3 { box-sizing: border-box; height: 20px; background: #333; @@ -240,7 +240,7 @@ padding: 4px; } - :host ::content .add2 { + ::content .add2 { box-sizing: border-box; height: 20px; background: gray; @@ -281,7 +281,7 @@ padding: 4px; } - :host ::content .add1 { + ::content .add1 { box-sizing: border-box; height: 20px; background: lightgray;