aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/block.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/block.rs')
-rw-r--r--components/layout/block.rs34
1 files changed, 17 insertions, 17 deletions
diff --git a/components/layout/block.rs b/components/layout/block.rs
index baf80f6ca3f..9b004bd798c 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -25,7 +25,7 @@
//!
//! http://dev.w3.org/csswg/css-sizing/
-#![deny(unsafe_block)]
+#![deny(unsafe_blocks)]
use construct::FlowConstructor;
use context::LayoutContext;
@@ -37,7 +37,7 @@ use flow::{MutableFlowUtils, PreorderFlowTraversal, PostorderFlowTraversal, mut_
use flow;
use fragment::{Fragment, ImageFragment, InlineBlockFragment, FragmentBoundsIterator};
use fragment::ScannedTextFragment;
-use incremental::{Reflow, ReflowOutOfFlow};
+use incremental::{REFLOW, REFLOW_OUT_OF_FLOW};
use layout_debug;
use model::{Auto, IntrinsicISizes, MarginCollapseInfo, MarginsCollapse, MarginsCollapseThrough};
use model::{MaybeAuto, NoCollapsibleMargins, Specified, specified, specified_or_none};
@@ -394,7 +394,7 @@ impl Iterator<MaybeAuto> for CandidateBSizeIterator {
Some(Specified(self.min_block_size))
}
FoundCandidateBSizeStatus => None,
- InitialCandidateBSizeStatus => fail!(),
+ InitialCandidateBSizeStatus => panic!(),
}
}
}
@@ -441,7 +441,7 @@ impl<'a> PreorderFlowTraversal for AbsoluteAssignBSizesTraversal<'a> {
}
assert!(block_flow.base.flags.is_absolutely_positioned());
- if !block_flow.base.restyle_damage.intersects(ReflowOutOfFlow | Reflow) {
+ if !block_flow.base.restyle_damage.intersects(REFLOW_OUT_OF_FLOW | REFLOW) {
return
}
@@ -551,7 +551,7 @@ pub struct BlockFlow {
bitflags! {
flags BlockFlowFlags: u8 {
#[doc="If this is set, then this block flow is the root flow."]
- static IsRoot = 0x01,
+ const IS_ROOT = 0x01,
}
}
@@ -787,7 +787,7 @@ impl BlockFlow {
}
let (block_start_margin_value, block_end_margin_value) = match self.base.collapsible_margins {
- MarginsCollapseThrough(_) => fail!("Margins unexpectedly collapsed through root flow."),
+ MarginsCollapseThrough(_) => panic!("Margins unexpectedly collapsed through root flow."),
MarginsCollapse(block_start_margin, block_end_margin) => {
(block_start_margin.collapse(), block_end_margin.collapse())
}
@@ -827,7 +827,7 @@ impl BlockFlow {
margins_may_collapse: MarginsMayCollapseFlag) {
let _scope = layout_debug_scope!("assign_block_size_block_base {:x}", self.base.debug_id());
- if self.base.restyle_damage.contains(Reflow) {
+ if self.base.restyle_damage.contains(REFLOW) {
// Our current border-box position.
let mut cur_b = Au(0);
@@ -1064,7 +1064,7 @@ impl BlockFlow {
// size has not yet been computed. (See `assign_inline_position_for_formatting_context()`.)
if !self.base.flags.is_absolutely_positioned() &&
self.formatting_context_type() == NonformattingContext {
- self.base.restyle_damage.remove(ReflowOutOfFlow | Reflow);
+ self.base.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
}
}
@@ -1213,7 +1213,7 @@ impl BlockFlow {
self.fragment.border_box.size.block = block_size;
self.base.position.size.block = block_size;
- self.base.restyle_damage.remove(ReflowOutOfFlow | Reflow);
+ self.base.restyle_damage.remove(REFLOW_OUT_OF_FLOW | REFLOW);
}
// Our inline-size was set to the inline-size of the containing block by the flow's parent.
@@ -1405,7 +1405,7 @@ impl BlockFlow {
fn assign_inline_position_for_formatting_context(&mut self) {
debug_assert!(self.formatting_context_type() != NonformattingContext);
- if !self.base.restyle_damage.intersects(ReflowOutOfFlow | Reflow) {
+ if !self.base.restyle_damage.intersects(REFLOW_OUT_OF_FLOW | REFLOW) {
return
}
@@ -1538,7 +1538,7 @@ impl Flow for BlockFlow {
fn assign_inline_sizes(&mut self, layout_context: &LayoutContext) {
let _scope = layout_debug_scope!("block::assign_inline_sizes {:x}", self.base.debug_id());
- if !self.base.restyle_damage.intersects(ReflowOutOfFlow | Reflow) {
+ if !self.base.restyle_damage.intersects(REFLOW_OUT_OF_FLOW | REFLOW) {
return
}
@@ -1619,7 +1619,7 @@ impl Flow for BlockFlow {
}
if self.base.flags.impacted_by_floats() {
- if self.base.restyle_damage.intersects(ReflowOutOfFlow | Reflow) {
+ if self.base.restyle_damage.intersects(REFLOW_OUT_OF_FLOW | REFLOW) {
self.assign_block_size(layout_context);
// Don't remove the restyle damage; `assign_block_size` decides whether that is
// appropriate (which in the case of e.g. absolutely-positioned flows, it is not).
@@ -1731,7 +1731,7 @@ impl Flow for BlockFlow {
}
fn mark_as_root(&mut self) {
- self.flags.insert(IsRoot)
+ self.flags.insert(IS_ROOT)
}
/// Return true if store overflow is delayed for this flow.
@@ -1742,7 +1742,7 @@ impl Flow for BlockFlow {
}
fn is_root(&self) -> bool {
- self.flags.contains(IsRoot)
+ self.flags.contains(IS_ROOT)
}
fn is_float(&self) -> bool {
@@ -2325,7 +2325,7 @@ impl ISizeAndMarginsComputer for AbsoluteReplaced {
let inline_size = match computed_inline_size {
Specified(w) => w,
- _ => fail!("{} {}",
+ _ => panic!("{} {}",
"The used value for inline_size for absolute replaced flow",
"should have already been calculated by now.")
};
@@ -2436,7 +2436,7 @@ impl ISizeAndMarginsComputer for BlockReplaced {
-> ISizeConstraintSolution {
match input.computed_inline_size {
Specified(_) => {},
- Auto => fail!("BlockReplaced: inline_size should have been computed by now")
+ Auto => panic!("BlockReplaced: inline_size should have been computed by now")
};
self.solve_block_inline_size_constraints(block, input)
}
@@ -2491,7 +2491,7 @@ impl ISizeAndMarginsComputer for FloatReplaced {
let margin_inline_end = inline_end_margin.specified_or_zero();
let inline_size = match computed_inline_size {
Specified(w) => w,
- Auto => fail!("FloatReplaced: inline_size should have been computed by now")
+ Auto => panic!("FloatReplaced: inline_size should have been computed by now")
};
debug!("assign_inline_sizes_float -- inline_size: {}", inline_size);
ISizeConstraintSolution::new(inline_size, margin_inline_start, margin_inline_end)