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

Flexbox: thread 'LayoutWorker worker 3/3' panicked at 'attempted to divide by zero' #7316

Closed
paulrouget opened this issue Aug 22, 2015 · 1 comment

Comments

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Aug 22, 2015

<style>
  div {
    display: flex;
    flex-grow: 1;
  }
</style>

<div>
  <div>
  </div>
</div>
thread 'LayoutWorker worker 3/3' panicked at 'attempted to divide by zero', /components/util/geometry.rs:169
@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Aug 22, 2015

In components/layout/flex.rs, in inline_mode_assign_inline_sizes, I see:

let even_content_inline_size = content_inline_size / ImmutableFlowUtils::child_count(self as &Flow) as i32;

Which I guess is the issue. Adding a child to the empty div doesn't crash.

@jdm jdm added the A-layout/flex label Aug 23, 2015
bors-servo pushed a commit that referenced this issue Aug 24, 2015
prevent division by 0

Fix #7316

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7331)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Aug 24, 2015
prevent division by 0

Fix #7316

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7331)
<!-- Reviewable:end -->
paulrouget added a commit to paulrouget/servo that referenced this issue Aug 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.