aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/construct.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2017-08-16 13:32:48 +0200
committerMartin Robinson <mrobinson@igalia.com>2017-08-16 13:32:48 +0200
commit0a24c2f03cc8c90798c790b3d8633c17165d63e1 (patch)
tree6e7435643b01aef9d95493e6a56b9390d2f663d0 /components/layout/construct.rs
parentee73cb618a42e8c45b5fb83fe026ac611df6913f (diff)
downloadservo-0a24c2f03cc8c90798c790b3d8633c17165d63e1.tar.gz
servo-0a24c2f03cc8c90798c790b3d8633c17165d63e1.zip
Use the is_absolute_containing_block method everywhere
This is a better approach than relying on contains_positioned_fragments, because in the future other properties will create absolute containing blocks.
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r--components/layout/construct.rs20
1 files changed, 6 insertions, 14 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index 7e49784479c..502f21b36f9 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -616,14 +616,12 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
flow.finish();
// Set up the absolute descendants.
- let contains_positioned_fragments = flow.contains_positioned_fragments();
- let is_absolutely_positioned = flow::base(&*flow).flags.contains(IS_ABSOLUTELY_POSITIONED);
- if contains_positioned_fragments {
+ if flow.is_absolute_containing_block() {
// This is the containing block for all the absolute descendants.
flow.set_absolute_descendants(abs_descendants);
abs_descendants = AbsoluteDescendants::new();
- if is_absolutely_positioned {
+ if flow::base(&*flow).flags.contains(IS_ABSOLUTELY_POSITIONED) {
// This is now the only absolute flow in the subtree which hasn't yet
// reached its CB.
abs_descendants.push(flow.clone());
@@ -1060,16 +1058,13 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
// The flow is done.
flow.finish();
- let contains_positioned_fragments = flow.contains_positioned_fragments();
- if contains_positioned_fragments {
+ if flow.is_absolute_containing_block() {
// This is the containing block for all the absolute descendants.
flow.set_absolute_descendants(abs_descendants);
abs_descendants = AbsoluteDescendants::new();
- let is_absolutely_positioned =
- flow::base(&*flow).flags.contains(IS_ABSOLUTELY_POSITIONED);
- if is_absolutely_positioned {
+ if flow::base(&*flow).flags.contains(IS_ABSOLUTELY_POSITIONED) {
// This is now the only absolute flow in the subtree which hasn't yet
// reached its containing block.
abs_descendants.push(flow.clone());
@@ -1134,16 +1129,13 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode>
legalizer.finish(&mut wrapper_flow);
wrapper_flow.finish();
- let contains_positioned_fragments = wrapper_flow.contains_positioned_fragments();
- if contains_positioned_fragments {
+ if wrapper_flow.is_absolute_containing_block() {
// This is the containing block for all the absolute descendants.
wrapper_flow.set_absolute_descendants(abs_descendants);
abs_descendants = AbsoluteDescendants::new();
- let is_absolutely_positioned =
- flow::base(&*wrapper_flow).flags.contains(IS_ABSOLUTELY_POSITIONED);
- if is_absolutely_positioned {
+ if flow::base(&*wrapper_flow).flags.contains(IS_ABSOLUTELY_POSITIONED) {
// This is now the only absolute flow in the subtree which hasn't yet
// reached its containing block.
abs_descendants.push(wrapper_flow.clone());