mirror of
https://github.com/Polymer/polymer.git
synced 2026-08-19 01:14:44 -05:00
Remove propertyNameForAttribute since it's never needed.
This commit is contained in:
@@ -545,29 +545,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a default implementation of the standard Custom Elements
|
||||
* `attributeChangedCallback`.
|
||||
*
|
||||
* By default, attributes declared in `properties` metadata are
|
||||
* deserialized using their `type` information to properties of the
|
||||
* same name. "Dash-cased" attributes are deserialized to "camelCase"
|
||||
* properties.
|
||||
*
|
||||
* @param {string} name Name of attribute.
|
||||
* @param {?string} old Old value of attribute.
|
||||
* @param {?string} value Current value of attribute.
|
||||
* @override
|
||||
*/
|
||||
attributeChangedCallback(name, old, value) {
|
||||
if (old !== value) {
|
||||
let property = this.constructor.propertyNameForAttribute(name);
|
||||
if (!this._hasReadOnlyEffect(property)) {
|
||||
super.attributeChangedCallback(name, old, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When using the ShadyCSS scoping and custom property shim, causes all
|
||||
* shimmed styles in this element (and its subtree) to be updated
|
||||
|
||||
@@ -68,21 +68,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a property name that corresponds to the given attribute.
|
||||
* The attribute name is always lowercase and the property name is the
|
||||
* cased version for which a property accessor was created. Override to
|
||||
* customize this mapping.
|
||||
* @param {string} attribute Attribute to convert
|
||||
* @return {string} Property name corresponding to the given attribute.
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
static propertyNameForAttribute(attribute) {
|
||||
const map = this.prototype.__dataAttributes;
|
||||
return map && map[attribute] || attribute;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an attribute name that corresponds to the given property.
|
||||
* The attribute name is the lowercased property name. Override to
|
||||
@@ -401,7 +386,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
*/
|
||||
_attributeToProperty(attribute, value, type) {
|
||||
if (!this.__serializing) {
|
||||
const property = this.constructor.propertyNameForAttribute(attribute);
|
||||
const map = this.__dataAttributes;
|
||||
const property = map && map[attribute] || attribute;
|
||||
this[property] = this._deserializeValue(value, type ||
|
||||
this.constructor.typeForProperty(property));
|
||||
}
|
||||
|
||||
@@ -125,18 +125,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a property name that corresponds to the given attribute.
|
||||
* By default, converts dash to camel case, e.g. `foo-bar` to `fooBar`.
|
||||
* @param {string} attribute Attribute to convert
|
||||
* @return {string} Property name corresponding to the given attribute.
|
||||
*
|
||||
* @protected
|
||||
*/
|
||||
static propertyNameForAttribute(attribute) {
|
||||
return caseMap.dashToCamelCase(attribute);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an attribute name that corresponds to the given property.
|
||||
* By default, converts camel to dash case, e.g. `fooBar` to `foo-bar`.
|
||||
|
||||
Reference in New Issue
Block a user