Skip to content

Commit

Permalink
Merge branch 'master' into closure-warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed May 2, 2017
2 parents e5de178 + a284d77 commit 4698253
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 300 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ If you find an issue, please do file it on the repository. The [Polymer/polymer

For issues with elements the team maintains, please file directly on the element's repository. If you're not sure if a bug stems from the element or the library, air toward filing it on the element and we'll move the issue if necessary.

Please file issues using the issue template provided, filling out as many fields as possible. We love examples for addressing issues - issues with a Plunkr, jsFiddle, or jsBin will be much easier for us to work on quickly. You can start with [this jsbin](http://jsbin.com/luhaxab/1/edit) which sets up the basics to demonstrate a Polymer element.
Please file issues using the issue template provided, filling out as many fields as possible. We love examples for addressing issues - issues with a Plunkr, jsFiddle, or jsBin will be much easier for us to work on quickly. You can start with [this jsbin](http://jsbin.com/luhaxab/edit) which sets up the basics to demonstrate a Polymer element.

Occasionally we'll close issues if they appear stale or are too vague - please don't take this personally! Please feel free to re-open issues we've closed if there's something we've missed and they still need to be addressed.

Expand Down
2 changes: 1 addition & 1 deletion lib/legacy/legacy-element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@
* are not automatically handled. For example,
* a user should call `distributeContent` if distribution has been
* invalidated due to an element being added or removed from the shadowRoot
* that contains an insertion point (<slot>) inside its subtree.
* that contains an insertion point (`<slot>`) inside its subtree.
*/
distributeContent() {
if (window.ShadyDOM) {
Expand Down
20 changes: 2 additions & 18 deletions lib/mixins/element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@

let caseMap = Polymer.CaseMap;

const DISABLED = 'disable-upgrade';

/**
* Returns the `properties` object specifically on `klass`. Use for:
* (1) super chain mixes togther to make `propertiesForClass` which is
Expand Down Expand Up @@ -453,8 +451,6 @@
proto._bindTemplate(template);
}

function flushPropertiesStub() {}

/**
* @polymerMixinClass
* @unrestricted
Expand All @@ -472,7 +468,7 @@
*/
static get observedAttributes() {
if (!this.hasOwnProperty(JSCompiler_renameProperty('__observedAttributes', this))) {
let list = [DISABLED];
let list = [];
let properties = propertiesForClass(this);
for (let prop in properties) {
list.push(Polymer.CaseMap.camelToDashCase(prop));
Expand Down Expand Up @@ -723,19 +719,7 @@
* @override
*/
attributeChangedCallback(name, old, value) {
// process `disable-upgrade` specially:
// First we see `disable-upgrade` added and disable `_flushProperties`,
// then when it's removed, restore regular flushing and flush.
// This should only be allowed before "readying".
if (name === DISABLED && !this.__dataInitialized) {
if (value !== null) {
this.__flushProperties = this._flushProperties;
this._flushProperties = flushPropertiesStub;
} else {
this._flushProperties = this.__flushProperties;
this._flushProperties();
}
} else if (old !== value) {
if (old !== value) {
let property = caseMap.dashToCamelCase(name);
let type = propertiesForClass(this.constructor)[property].type;
if (!this._hasReadOnlyEffect(property)) {
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/property-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@

/**
* Returns true if a binding's metadata meets all the requirements to allow
* 2-way binding, and therefore a <property>-changed event listener should be
* 2-way binding, and therefore a `<property>-changed` event listener should be
* added:
* - used curly braces
* - is a property (not attribute) binding
Expand Down Expand Up @@ -1316,7 +1316,7 @@
*
* The implementation makes a best-effort at binding interop:
* Some native element properties have side-effects when
* re-setting the same value (e.g. setting <input>.value resets the
* re-setting the same value (e.g. setting `<input>.value` resets the
* cursor position), so we do a dirty-check before setting the value.
* However, for better interop with non-Polymer custom elements that
* accept objects, we explicitly re-set object changes coming from the
Expand Down
34 changes: 17 additions & 17 deletions lib/mixins/template-stamp.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@
*/
class TemplateStamp extends superClass {

constructor() {
super();
this.$ = null;
}

/**
* Scans a template to produce template metadata.
*
Expand All @@ -136,43 +131,46 @@
* The template metadata object returned from this method has the following
* structure (many fields optional):
*
* ```js
* {
* // Flattened list of node metadata (for nodes that generated metadata)
* nodeInfoList: [
* {
* // `id` attribute for any nodes with id's for generating `$` map
* id: '<id>',
* id: {string},
* // `on-event="handler"` metadata
* events: [
* {
* name: '<name>'
* value: '<handler name>'
* name: {string}, // event name
* value: {string}, // handler method name
* }, ...
* ],
* // Notes when the template contained a `<slot>` for shady DOM
* // optimization purposes
* hasInsertionPoint: <boolean>,
* // For nested <template> nodes, nested template metadata
* templateInfo: <nested template metadata>,
* hasInsertionPoint: {boolean},
* // For nested `<template>`` nodes, nested template metadata
* templateInfo: {object}, // nested template metadata
* // Metadata to allow efficient retrieval of instanced node
* // corresponding to this metadata
* parentInfo: <reference to parent nodeInfo>,
* parentIndex: <integer index in parent's `childNodes` collection>
* infoIndex: <integer index of this `nodeInfo` in `templateInfo.nodeInfoList`
* parentInfo: {number}, // reference to parent nodeInfo>
* parentIndex: {number}, // index in parent's `childNodes` collection
* infoIndex: {number}, // index of this `nodeInfo` in `templateInfo.nodeInfoList`
* },
* ...
* ],
* // When true, the template had the `strip-whitespace` attribute
* // or was nested in a template with that setting
* stripWhitespace: <boolean>
* stripWhitespace: {boolean},
* // For nested templates, nested template content is moved into
* // a document fragment stored here; this is an optimization to
* // avoid the cost of nested template cloning
* content: <DocumentFragment>
* content: {DocumentFragment}
* }
* ```
*
* This method kicks off a recursive treewalk as follows:
*
* ```
* _parseTemplate <---------------------+
* _parseTemplateContent |
* _parseTemplateNode <------------|--+
Expand All @@ -181,6 +179,8 @@
* _parseTemplateNodeAttributes
* _parseTemplateNodeAttribute
*
* ```
*
* These methods may be overridden to add custom metadata about templates
* to either `templateInfo` or `nodeInfo`.
*
Expand Down Expand Up @@ -396,7 +396,7 @@
*
* Note that the memoized template parsing process is destructive to the
* template: attributes for bindings and declarative event listeners are
* removed after being noted in notes, and any nested <template>.content
* removed after being noted in notes, and any nested `<template>.content`
* is removed and stored in notes as well.
*
* @param {HTMLTemplateElement} template Template to stamp
Expand Down
6 changes: 3 additions & 3 deletions lib/utils/flattened-nodes-observer.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/**
* Class that listens for changes (additions or removals) to
* "flattened nodes" on a given `node`. The list of flattened nodes consists
* of a node's children and, for any children that are <slot> elements,
* of a node's children and, for any children that are `<slot>` elements,
* the expanded flattened list of `assignedNodes`.
* For example, if the observed node has children `<a></a><slot></slot><b></b>`
* and the `<slot>` has one `<div>` assigned to it, then the flattened
Expand All @@ -41,7 +41,7 @@
*
* Note: the callback is called asynchronous to any changes
* at a microtask checkpoint. This is because observation is performed using
* `MutationObserver` and the `<slot> element's `slotchange` event which
* `MutationObserver` and the `<slot>` element's `slotchange` event which
* are asynchronous.
*
* @memberof Polymer
Expand All @@ -53,7 +53,7 @@
/**
* Returns the list of flattened nodes for the given `node`.
* This list consists of a node's children and, for any children
* that are <slot> elements, the expanded flattened list of `assignedNodes`.
* that are `<slot>` elements, the expanded flattened list of `assignedNodes`.
* For example, if the observed node has children `<a></a><slot></slot><b></b>`
* and the `<slot>` has one `<div>` assigned to it, then the flattened
* nodes list is `<a></a><div></div><b></b>`. If the `<slot>` has other
Expand Down
3 changes: 1 addition & 2 deletions test/runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
'unit/logging.html',
'unit/mixin-utils.html',
'unit/mixin-behaviors.html',
'unit/render-status.html',
'unit/disable-upgrade.html'
'unit/render-status.html'
];

// http://eddmann.com/posts/cartesian-product-in-javascript/
Expand Down
98 changes: 0 additions & 98 deletions test/smoke/disable-upgrade.html

This file was deleted.

Loading

0 comments on commit 4698253

Please sign in to comment.