Skip to content

Commit 054d456

Browse files
committed
Update dependencies and dev dependencies
This includes: * A replacement of cssom with rrweb-cssom, matching jsdom/jsdom#3497. Closes #153. * An update to the download_latest_properties.js script to stop using request. * A regeneration of the list of properties. Closes #150. * Some style updates to most generated files, for unclear reasons.
1 parent 29ae19b commit 054d456

File tree

85 files changed

+11565
-5350
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+11565
-5350
lines changed

lib/CSSStyleDeclaration.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* https://github.com/NV/CSSOM
44
********************************************************************/
55
'use strict';
6-
var CSSOM = require('cssom');
6+
var CSSOM = require('rrweb-cssom');
77
var allProperties = require('./allProperties');
88
var allExtraProperties = require('./allExtraProperties');
99
var 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

168168
Object.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

242242
require('./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);

lib/CSSStyleDeclaration.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var parsers = require('./parsers');
1010
var dashedProperties = [...allProperties, ...allExtraProperties];
1111
var allowedProperties = dashedProperties.map(parsers.dashedToCamelCase);
1212
implementedProperties = Array.from(implementedProperties).map(parsers.dashedToCamelCase);
13-
var invalidProperties = implementedProperties.filter(prop => !allowedProperties.includes(prop));
13+
var invalidProperties = implementedProperties.filter((prop) => !allowedProperties.includes(prop));
1414

1515
describe('CSSStyleDeclaration', () => {
1616
test('has only valid properties implemented', () => {
@@ -19,15 +19,15 @@ describe('CSSStyleDeclaration', () => {
1919

2020
test('has all properties', () => {
2121
var style = new CSSStyleDeclaration();
22-
allProperties.forEach(property => {
22+
allProperties.forEach((property) => {
2323
expect(style.__lookupGetter__(property)).toBeTruthy();
2424
expect(style.__lookupSetter__(property)).toBeTruthy();
2525
});
2626
});
2727

2828
test('has dashed properties', () => {
2929
var style = new CSSStyleDeclaration();
30-
dashedProperties.forEach(property => {
30+
dashedProperties.forEach((property) => {
3131
expect(style.__lookupGetter__(property)).toBeTruthy();
3232
expect(style.__lookupSetter__(property)).toBeTruthy();
3333
});
@@ -302,7 +302,7 @@ describe('CSSStyleDeclaration', () => {
302302
test('padding and margin should set/clear shorthand properties', () => {
303303
var style = new CSSStyleDeclaration();
304304
var parts = ['Top', 'Right', 'Bottom', 'Left'];
305-
var testParts = function(name, v, V) {
305+
var testParts = function (name, v, V) {
306306
style[name] = v;
307307
for (var i = 0; i < 4; i++) {
308308
var part = name + parts[i];
@@ -329,7 +329,7 @@ describe('CSSStyleDeclaration', () => {
329329
test('padding and margin shorthands should set main properties', () => {
330330
var style = new CSSStyleDeclaration();
331331
var parts = ['Top', 'Right', 'Bottom', 'Left'];
332-
var testParts = function(name, v, V) {
332+
var testParts = function (name, v, V) {
333333
var expected;
334334
for (var i = 0; i < 4; i++) {
335335
style[name] = v;
@@ -353,7 +353,7 @@ describe('CSSStyleDeclaration', () => {
353353
});
354354

355355
test('onchange callback should be called when the csstext changes', () => {
356-
var style = new CSSStyleDeclaration(function(cssText) {
356+
var style = new CSSStyleDeclaration(function (cssText) {
357357
expect(cssText).toEqual('opacity: 0;');
358358
});
359359
style.setProperty('opacity', 0);

0 commit comments

Comments
 (0)