codigo0/node_modules/happy-dom/lib/css/style-property-map/StylePropertyMap.js

42 lines
1.1 KiB
JavaScript
Raw Normal View History

import StylePropertyMapReadOnly from './StylePropertyMapReadOnly.js';
import * as PropertySymbol from '../../PropertySymbol.js';
/**
* StylePropertyMapReadOnly interface.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/StylePropertyMapReadOnly
*/
export default class StylePropertyMap extends StylePropertyMapReadOnly {
/**
* Appends a property.
*
* @param property Property.
* @param value Value.
*/
append(property, value) {
this[PropertySymbol.style].setProperty(property, value);
}
/**
* Clears all properties.
*/
clear() {
this[PropertySymbol.style].cssText = '';
}
/**
* Deletes a property.
*
* @param property Property.
*/
delete(property) {
this[PropertySymbol.style].removeProperty(property);
}
/**
* Sets a property.
*
* @param property Property.
* @param value Value.
*/
set(property, value) {
this[PropertySymbol.style].setProperty(property, value);
}
}
//# sourceMappingURL=StylePropertyMap.js.map