Skip to content

Commit

Permalink
work around older firefox handling of the "properties" property on HT…
Browse files Browse the repository at this point in the history
…MLElement prototype
  • Loading branch information
dfreedm committed Jan 30, 2017
1 parent 8faf466 commit 13f36c7
Showing 1 changed file with 40 additions and 36 deletions.
76 changes: 40 additions & 36 deletions src/micro/properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,42 +58,6 @@

Polymer.Base._addFeature({

/*
* Object containing property configuration data, where keys are property
* names and values are descriptor objects that configure Polymer features
* for the property. Valid fields in the property descriptor object are
* as follows:
*
* * `type` - used to determine how to deserialize attribute value strings
* to JS properties. By convention, this field takes a JS constructor
* for the type, such as `String` or `Boolean`.
* * `value` - default value for the property. The value may either be a
* primitive value, or a function that returns a value (which should be
* used for initializing Objects and Arrays to avoid shared objects on
* instances).
* * `notify` - when `true`, configures the property to fire a non-bubbling
* event called `<property>-changed` for each change to the property.
* Elements that have enabled two-way binding to the property use this
* event to observe changes.
* * `readOnly` - when `true` configures the property to have a getter, but
* no setter. To set a read-only property, use the private setter method
* `_set_<property>(value)`.
* * `reflectToAttribute` - when `true` configures the property value to
* be serialized to a string and reflected to the attribute each time
* it changes. This can impact performance, so it should be used
* only when reflecting the attribute value is important.
* * `observer` - indicates the name of a function that should be called
* each time the property changes. `e.g.: `observer: 'valueChanged'
* * `computed` - configures the property to be computed by a computing
* function each time one or more dependent properties change.
* `e.g.: `computed: 'computeValue(prop1, prop2)'
*
* Note: a shorthand may be used for the object descriptor when only the
* type needs to be specified by using the type as the descriptor directly.
*/
properties: {
},

/**
* Returns a property descriptor object for the property specified.
*
Expand Down Expand Up @@ -178,4 +142,44 @@

});

/*
* Object containing property configuration data, where keys are property
* names and values are descriptor objects that configure Polymer features
* for the property. Valid fields in the property descriptor object are
* as follows:
*
* * `type` - used to determine how to deserialize attribute value strings
* to JS properties. By convention, this field takes a JS constructor
* for the type, such as `String` or `Boolean`.
* * `value` - default value for the property. The value may either be a
* primitive value, or a function that returns a value (which should be
* used for initializing Objects and Arrays to avoid shared objects on
* instances).
* * `notify` - when `true`, configures the property to fire a non-bubbling
* event called `<property>-changed` for each change to the property.
* Elements that have enabled two-way binding to the property use this
* event to observe changes.
* * `readOnly` - when `true` configures the property to have a getter, but
* no setter. To set a read-only property, use the private setter method
* `_set_<property>(value)`.
* * `reflectToAttribute` - when `true` configures the property value to
* be serialized to a string and reflected to the attribute each time
* it changes. This can impact performance, so it should be used
* only when reflecting the attribute value is important.
* * `observer` - indicates the name of a function that should be called
* each time the property changes. `e.g.: `observer: 'valueChanged'
* * `computed` - configures the property to be computed by a computing
* function each time one or more dependent properties change.
* `e.g.: `computed: 'computeValue(prop1, prop2)'
*
* Note: a shorthand may be used for the object descriptor when only the
* type needs to be specified by using the type as the descriptor directly.
* @memberof! feature: properties
*/
(function() {
var propertiesDesc = {configurable: true, writable: true};
Polymer.BaseDescriptors.properties = propertiesDesc;
Object.defineProperty(Polymer.Base, 'properties', propertiesDesc);
})();

</script>

0 comments on commit 13f36c7

Please sign in to comment.