servo: Merge #7331 - prevent division by 0 (from paulrouget:issue-7316); r=SimonSapin

Fix #7316

Source-Repo: https://github.com/servo/servo
Source-Revision: 524b02dbf7c2d8ef0d3a453124075f7718f7e458
This commit is contained in:
Paul Rouget
2015-08-24 05:08:41 -06:00
parent c9466d5746
commit 28021e56e2

View File

@@ -212,8 +212,14 @@ impl FlexFlow {
debug!("inline_mode_assign_inline_sizes");
debug!("content_inline_size = {:?}", content_inline_size);
debug!("child_count = {:?}", ImmutableFlowUtils::child_count(self as &Flow) as i32);
let even_content_inline_size = content_inline_size / ImmutableFlowUtils::child_count(self as &Flow) as i32;
let child_count = ImmutableFlowUtils::child_count(self as &Flow) as i32;
debug!("child_count = {:?}", child_count);
if child_count == 0 {
return;
}
let even_content_inline_size = content_inline_size / child_count;
let inline_size = self.block_flow.base.block_container_inline_size;
let container_mode = self.block_flow.base.block_container_writing_mode;