-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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: add use of the safe version of getComputedStyle #6073
Conversation
Add use of the safe version of computedStyle in the currentDimension method of Component's class. This will prevent a null exception when a video.js is implemented in a 'display:none' iframe on Firefox (<62). This is a fix in continuation of the MR#3664 regarding a bug in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=548397
💖 Thanks for opening this pull request! 💖 Things that will help get your PR across the finish line:
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can. |
@@ -26,9 +26,9 @@ function computedStyle(el, prop) { | |||
} | |||
|
|||
if (typeof window.getComputedStyle === 'function') { | |||
const cs = window.getComputedStyle(el); | |||
const computedStyleValue = window.getComputedStyle(el); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this should just be called style
? That is what they use on mdn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you referring to this page?
https://developer.mozilla.org/fr/docs/Web/API/Window/getComputedStyle
They also use cs
in the examples, but I'm not a fan of very short abbreviations or too much generic term where you have to go back to the declaration to understand exactly the variable.
Do you want me to change my commit to use the name style
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine.
@@ -26,9 +26,9 @@ function computedStyle(el, prop) { | |||
} | |||
|
|||
if (typeof window.getComputedStyle === 'function') { | |||
const cs = window.getComputedStyle(el); | |||
const computedStyleValue = window.getComputedStyle(el); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine.
Congrats on merging your first pull request! 🎉🎉🎉 |
Description
Add use of the safe version of getComputedStyle in the currentDimension method of Component's class.
This will prevent a null exception when a video.js is implemented in a 'display:none' iframe on Firefox (<62).
This is a fix in continuation of the MR #3664 regarding a bug in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=548397
Specific Changes proposed
Requirements Checklist