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

fix: Ensure CSS support is checked more robustly #42

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Feb 3, 2023

Noticed this while debugging tests in sentry-javascript. it seems jsdom has a weird support for CSSMediaRule, where it is defined but if you look at CSSMediaRule.prototype it is:

CSSRule {
        parentRule: null,
        parentStyleSheet: null,
        constructor: [Function: CSSMediaRule],
        type: 4
      }

I guess maybe similar issues have triggered some of the errors we've seen in the past.

Note: We've been handling these errors already, but still good to fix it properly. I'll also PR this upsteam.

@mydea mydea requested review from billyvg and Lms24 February 3, 2023 11:09
@mydea mydea self-assigned this Feb 3, 2023
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

@mydea
Copy link
Member Author

mydea commented Feb 3, 2023

For reference, this is probably fixed here: NV/CSSOM#111 but illustrates how we can't really rely on "this is supported everywhere!" thinking, sadly.

@mydea mydea merged commit 69f74e7 into sentry-v1 Feb 3, 2023
@mydea mydea deleted the fn/check-css-support-reliably branch February 3, 2023 11:20
billyvg pushed a commit that referenced this pull request Feb 3, 2023
Noticed this while debugging tests in sentry-javascript. it seems jsdom
has a weird support for `CSSMediaRule`, where it is defined but if you
look at `CSSMediaRule.prototype` it is:

```
CSSRule {
        parentRule: null,
        parentStyleSheet: null,
        constructor: [Function: CSSMediaRule],
        type: 4
      }
```


I guess maybe similar issues have triggered some of the errors we've
seen in the past.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants