aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/flow.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/flow.rs')
-rw-r--r--components/layout/flow.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index 3da277d924d..fae309d2ae2 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -30,6 +30,7 @@ use block::{BlockFlow, FormattingContextType};
use context::{LayoutContext, SharedLayoutContext};
use display_list_builder::DisplayListBuildState;
use euclid::{Point2D, Size2D};
+use flex::FlexFlow;
use floats::{Floats, SpeculatedFloatPlacement};
use flow_list::{FlowList, MutFlowListIterator};
use flow_ref::{FlowRef, WeakFlowRef};
@@ -86,6 +87,16 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
panic!("called as_mut_block() on a non-block flow")
}
+ /// If this is a flex flow, returns the underlying object. Fails otherwise.
+ fn as_flex(&self) -> &FlexFlow {
+ panic!("called as_flex() on a non-flex flow")
+ }
+
+ /// If this is a flex flow, returns the underlying object, borrowed mutably. Fails otherwise.
+ fn as_mut_flex(&mut self) -> &mut FlexFlow {
+ panic!("called as_mut_flex() on a non-flex flow")
+ }
+
/// If this is an inline flow, returns the underlying object. Fails otherwise.
fn as_inline(&self) -> &InlineFlow {
panic!("called as_inline() on a non-inline flow")