Skip to content

Implement CSSStyleSheet replace() and replaceSync() #3766

@vinsonchuong

Description

@vinsonchuong

Basic info:

  • Node.js version: 22.6.0
  • jsdom version: 24.1.1

It looks like the current implementation of CSSStyleSheet is missing a couple of methods that I am using to power automated tests for a web components library.

Minimal reproduction case

import {JSDOM} from 'jsdom'

const {window} = new JSOM('<!doctype html>')

const stylesheet = new window.CSSStyleSheet()
await stylesheet.replace('body { color: red; }')

How does similar code behave in browsers?

I expect the methods replace() and replaceSync() to exist and behave as documented (https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions