33 * https://github.com/NV/CSSOM
44 ********************************************************************/
55'use strict' ;
6- var CSSOM = require ( 'cssom' ) ;
6+ var CSSOM = require ( 'rrweb- cssom' ) ;
77var allProperties = require ( './allProperties' ) ;
88var allExtraProperties = require ( './allExtraProperties' ) ;
99var implementedProperties = require ( './implementedProperties' ) ;
@@ -20,7 +20,7 @@ var CSSStyleDeclaration = function CSSStyleDeclaration(onChangeCallback) {
2020 this . _length = 0 ;
2121 this . _onChange =
2222 onChangeCallback ||
23- function ( ) {
23+ function ( ) {
2424 return ;
2525 } ;
2626} ;
@@ -34,7 +34,7 @@ CSSStyleDeclaration.prototype = {
3434 * @return {string } the value of the property if it has been explicitly set for this declaration block.
3535 * Returns the empty string if the property has not been set.
3636 */
37- getPropertyValue : function ( name ) {
37+ getPropertyValue : function ( name ) {
3838 if ( ! this . _values . hasOwnProperty ( name ) ) {
3939 return '' ;
4040 }
@@ -48,7 +48,7 @@ CSSStyleDeclaration.prototype = {
4848 * @param {string } [priority=null] "important" or null
4949 * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-setProperty
5050 */
51- setProperty : function ( name , value , priority ) {
51+ setProperty : function ( name , value , priority ) {
5252 if ( value === undefined ) {
5353 return ;
5454 }
@@ -69,7 +69,7 @@ CSSStyleDeclaration.prototype = {
6969 this [ lowercaseName ] = value ;
7070 this . _importants [ lowercaseName ] = priority ;
7171 } ,
72- _setProperty : function ( name , value , priority ) {
72+ _setProperty : function ( name , value , priority ) {
7373 if ( value === undefined ) {
7474 return ;
7575 }
@@ -101,7 +101,7 @@ CSSStyleDeclaration.prototype = {
101101 * @return {string } the value of the property if it has been explicitly set for this declaration block.
102102 * Returns the empty string if the property has not been set or the property name does not correspond to a known CSS property.
103103 */
104- removeProperty : function ( name ) {
104+ removeProperty : function ( name ) {
105105 if ( ! this . _values . hasOwnProperty ( name ) ) {
106106 return '' ;
107107 }
@@ -129,11 +129,11 @@ CSSStyleDeclaration.prototype = {
129129 *
130130 * @param {String } name
131131 */
132- getPropertyPriority : function ( name ) {
132+ getPropertyPriority : function ( name ) {
133133 return this . _importants [ name ] || '' ;
134134 } ,
135135
136- getPropertyCSSValue : function ( ) {
136+ getPropertyCSSValue : function ( ) {
137137 //FIXME
138138 return ;
139139 } ,
@@ -143,20 +143,20 @@ CSSStyleDeclaration.prototype = {
143143 * element.style.getPropertyShorthand("overflow-x")
144144 * -> "overflow"
145145 */
146- getPropertyShorthand : function ( ) {
146+ getPropertyShorthand : function ( ) {
147147 //FIXME
148148 return ;
149149 } ,
150150
151- isPropertyImplicit : function ( ) {
151+ isPropertyImplicit : function ( ) {
152152 //FIXME
153153 return ;
154154 } ,
155155
156156 /**
157157 * http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-item
158158 */
159- item : function ( index ) {
159+ item : function ( index ) {
160160 index = parseInt ( index , 10 ) ;
161161 if ( index < 0 || index >= this . _length ) {
162162 return '' ;
@@ -167,7 +167,7 @@ CSSStyleDeclaration.prototype = {
167167
168168Object . defineProperties ( CSSStyleDeclaration . prototype , {
169169 cssText : {
170- get : function ( ) {
170+ get : function ( ) {
171171 var properties = [ ] ;
172172 var i ;
173173 var name ;
@@ -184,7 +184,7 @@ Object.defineProperties(CSSStyleDeclaration.prototype, {
184184 }
185185 return properties . join ( ' ' ) ;
186186 } ,
187- set : function ( value ) {
187+ set : function ( value ) {
188188 var i ;
189189 this . _values = { } ;
190190 Array . prototype . splice . call ( this , 0 , this . _length ) ;
@@ -212,22 +212,22 @@ Object.defineProperties(CSSStyleDeclaration.prototype, {
212212 configurable : true ,
213213 } ,
214214 parentRule : {
215- get : function ( ) {
215+ get : function ( ) {
216216 return null ;
217217 } ,
218218 enumerable : true ,
219219 configurable : true ,
220220 } ,
221221 length : {
222- get : function ( ) {
222+ get : function ( ) {
223223 return this . _length ;
224224 } ,
225225 /**
226226 * This deletes indices if the new length is less then the current
227227 * length. If the new length is more, it does nothing, the new indices
228228 * will be undefined until set.
229229 **/
230- set : function ( value ) {
230+ set : function ( value ) {
231231 var i ;
232232 for ( i = value ; i < this . _length ; i ++ ) {
233233 delete this [ i ] ;
@@ -241,15 +241,15 @@ Object.defineProperties(CSSStyleDeclaration.prototype, {
241241
242242require ( './properties' ) ( CSSStyleDeclaration . prototype ) ;
243243
244- allProperties . forEach ( function ( property ) {
244+ allProperties . forEach ( function ( property ) {
245245 if ( ! implementedProperties . has ( property ) ) {
246246 var declaration = getBasicPropertyDescriptor ( property ) ;
247247 Object . defineProperty ( CSSStyleDeclaration . prototype , property , declaration ) ;
248248 Object . defineProperty ( CSSStyleDeclaration . prototype , dashedToCamelCase ( property ) , declaration ) ;
249249 }
250250} ) ;
251251
252- allExtraProperties . forEach ( function ( property ) {
252+ allExtraProperties . forEach ( function ( property ) {
253253 if ( ! implementedProperties . has ( property ) ) {
254254 var declaration = getBasicPropertyDescriptor ( property ) ;
255255 Object . defineProperty ( CSSStyleDeclaration . prototype , property , declaration ) ;
0 commit comments