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

Handles exception thrown by Firefox when calling getBBox within hidden element #2695

Merged
merged 1 commit into from
Aug 25, 2019

Conversation

panthony
Copy link
Contributor

@panthony panthony commented Aug 20, 2019

Before I made the change in #2672 I was not aware that Firefox threw an exception if the DOM element is not rendered (ex: display: none;).

This PR wraps every calls made to getBBox and returns an empty box instead.

The method getBoundingClientRect was returning an object with all properties set to 0.

Can't really add a test for this since this is FF specific and we only have a chrome runner

Closes #2692

} catch (ignore) {
// Firefox will throw an exception if getBBox() is called whereas the
// element is rendered with display:none
// See https://github.com/c3js/c3/issues/2692
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! LGTM

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.

[0.7.5+] NS_ERROR_FAILURE on Firefox 47
2 participants