Skip to content

Commit 55c8a96

Browse files
committed
Renew constructor args
1 parent cf7e79a commit 55c8a96

3 files changed

Lines changed: 164 additions & 179 deletions

File tree

lib/CSSStyleDeclaration.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,18 @@ class CSSStyleDeclaration {
2323
/**
2424
* Creates a new CSSStyleDeclaration instance.
2525
*
26-
* TODO: constructor(globalObject, args, { computed, context, ... })
27-
* @param {Function} [onChangeCallback] - Callback triggered when style changes.
26+
* @param {object} globalObject - The global object (Window).
27+
* @param {Array} args - The arguments (not actually used).
2828
* @param {object} [opt] - Options.
2929
* @param {boolean} [opt.computed] - The computed flag.
3030
* @param {object} [opt.context] - The context object (Element, or CSSRule).
31-
* @param {object} [opt.globalObject] - The global object, i.e.) Window.
32-
* @param {number} [opt.fontSizeMedium] - The medium font size in pixels.
31+
* @param {number} [opt.fontSizeMedium] - Font size in pixels for the keyword "medium".
32+
* @param {Function} [opt.onChangeCallback] - Callback triggered when style changes.
3333
* @param {object} [opt.systemColors] - The system colors.
3434
*/
35-
constructor(onChangeCallback, { computed, context, globalObject, fontSizeMedium, systemColors } = {}) {
35+
constructor(globalObject, args, { computed, context, fontSizeMedium, onChangeCallback, systemColors } = {}) {
3636
// Internals for jsdom.
37-
// TODO: Remove globalThis fallback.
38-
this._global = globalObject ?? globalThis;
37+
this._global = globalObject;
3938
this._onChange = onChangeCallback;
4039
this._fontSizeMedium = fontSizeMedium;
4140
this._systemColors = systemColors;
@@ -54,8 +53,8 @@ class CSSStyleDeclaration {
5453
this._priorities = new Map();
5554
this._values = new Map();
5655

57-
// Options for computed style.
5856
// TODO: Add private method to prepare options.
57+
// Options for computed style.
5958
this._computedStyleOpts = null;
6059

6160
if (context) {

0 commit comments

Comments
 (0)