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

Use CSS.supports instead of '..' in ....style #5104

Merged
merged 1 commit into from
Jul 30, 2014

Conversation

Rob--W
Copy link
Member

@Rob--W Rob--W commented Jul 30, 2014

document.documentElement.style is null in some XML documents.
The previous snippet caused the following error:

Uncaught TypeError: Cannot use 'in' operator to search for 'animation' in null

To fix this bug, 'animation' in document.documentElement.style has been replaced with CSS.supports('animation', '9s').

document.documentElement.style is null in some XML documents.
The previous snippet caused the following error:

Uncaught TypeError: Cannot use 'in' operator to search for 'animation' in null

To fix this bug, `'animation' in document.documentElement.style` has been
replaced with `CSS.supports('animation', '9s')`. This method was introduced
in Chromium 28, but it is not necessary to detect whether this method is
supported because the required createShadowRoot method for embeds is not
available in Chromium 32 and earlier.
@timvandermeij
Copy link
Contributor

Looks good. Chrome has support for CSS.supports() since version 31 (see http://caniuse.com/#feat=css-featurequeries), so that's also no problem. Tested by building the add-on and it appears to work fine. Thanks!

timvandermeij added a commit that referenced this pull request Jul 30, 2014
Use CSS.supports instead of '..' in ....style
@timvandermeij timvandermeij merged commit 1911bb2 into mozilla:master Jul 30, 2014
@Rob--W
Copy link
Member Author

Rob--W commented Jul 30, 2014

Thanks for merging. Note that CSS.supports is already supported since Chrome 28 (click on "Show all" at Can I Use, or take a look at MDN - https://developer.mozilla.org/en-US/docs/Web/API/CSS.supports#Browser_compatibility).

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