layout: Eliminate the virtual is_float() in favor of the flow flags

This commit is contained in:
Patrick Walton 2014-11-05 10:06:28 -08:00
parent f5c6146de0
commit be36fcd3b1
4 changed files with 20 additions and 26 deletions

View file

@ -241,10 +241,6 @@ pub trait Flow: fmt::Show + ToString + Sync {
false
}
fn is_float(&self) -> bool {
false
}
/// The 'position' property of this flow.
fn positioning(&self) -> position::T {
position::static_
@ -570,6 +566,11 @@ impl FlowFlags {
}
}
#[inline]
pub fn is_float(&self) -> bool {
self.floats_left() || self.floats_right()
}
#[inline]
pub fn clears_floats(&self) -> bool {
self.contains(CLEARS_LEFT) || self.contains(CLEARS_RIGHT)