Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for CSSStyleDeclaration/setProperty doesn't work #37268

Open
Dakotys opened this issue Dec 19, 2024 · 1 comment · May be fixed by #37285
Open

Example for CSSStyleDeclaration/setProperty doesn't work #37268

Dakotys opened this issue Dec 19, 2024 · 1 comment · May be fixed by #37285
Labels
Content:WebAPI Web API docs

Comments

@Dakotys
Copy link

Dakotys commented Dec 19, 2024

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/setProperty#result

What specific section or headline is this issue about?

Example in Result part

What information was incorrect, unhelpful, or incomplete?

Example throws error:
image
It used to work on on edge: chromium 129.0.2792.65:
image

I am not sure whether the issue is related to iframes or something else, but the example doesn't work.

PS: Console error differs across browsers, firefox throws TypeError: stylesheet is undefined; while Chromium throws TypeError: Cannot read properties of undefined (reading 'cssRules')

What did you expect to see?

Working example, or none at all.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

@Dakotys Dakotys added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Dec 19, 2024
@github-actions github-actions bot added the Content:WebAPI Web API docs label Dec 19, 2024
@hamishwillee hamishwillee linked a pull request Dec 20, 2024 that will close this issue
@hamishwillee
Copy link
Collaborator

Thanks for reporting. This should be fixed by #37285. The code would be correct if the example was rendered in place, but it is imported into a frame, so the CSS of interest is the 0th indexed one.

@Josh-Cena Josh-Cena removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants