aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/incremental.rs
diff options
context:
space:
mode:
authorGecko Backout <gecko-backout@mozilla.org>2017-10-19 21:26:51 +0000
committermoz-servo-sync <developer-services+moz-servo-sync@mozilla.org>2017-10-19 21:26:51 +0000
commit11c64178d86979e8d50f11cff66c2b0e8fe666c1 (patch)
tree083c71bdf8216ca56d38d509e5b2988eb18da5ca /components/layout/incremental.rs
parentfe16c1d5c3c9084da0ccb85af599d6ec0f8ab20b (diff)
downloadservo-11c64178d86979e8d50f11cff66c2b0e8fe666c1.tar.gz
servo-11c64178d86979e8d50f11cff66c2b0e8fe666c1.zip
Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/18809
Diffstat (limited to 'components/layout/incremental.rs')
-rw-r--r--components/layout/incremental.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/components/layout/incremental.rs b/components/layout/incremental.rs
index b3f8a58040b..dd6b125938f 100644
--- a/components/layout/incremental.rs
+++ b/components/layout/incremental.rs
@@ -2,10 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-use flow::{self, FlowFlags, Flow};
+use flow::{self, AFFECTS_COUNTERS, Flow, HAS_COUNTER_AFFECTING_CHILDREN, IS_ABSOLUTELY_POSITIONED};
use style::computed_values::float;
use style::selector_parser::RestyleDamage;
-use style::servo::restyle_damage::ServoRestyleDamage;
+use style::servo::restyle_damage::{REFLOW, RECONSTRUCT_FLOW};
/// Used in a flow traversal to indicate whether this re-layout should be incremental or not.
#[derive(Clone, Copy, PartialEq)]
@@ -15,10 +15,10 @@ pub enum RelayoutMode {
}
bitflags! {
- pub struct SpecialRestyleDamage: u8 {
+ pub flags SpecialRestyleDamage: u8 {
#[doc = "If this flag is set, we need to reflow the entire document. This is more or less a \
temporary hack to deal with cases that we don't handle incrementally yet."]
- const REFLOW_ENTIRE_DOCUMENT = 0x01;
+ const REFLOW_ENTIRE_DOCUMENT = 0x01,
}
}
@@ -30,7 +30,7 @@ pub trait LayoutDamageComputation {
impl<'a> LayoutDamageComputation for &'a mut Flow {
fn compute_layout_damage(self) -> SpecialRestyleDamage {
let mut special_damage = SpecialRestyleDamage::empty();
- let is_absolutely_positioned = flow::base(self).flags.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED);
+ let is_absolutely_positioned = flow::base(self).flags.contains(IS_ABSOLUTELY_POSITIONED);
// In addition to damage, we use this phase to compute whether nodes affect CSS counters.
let mut has_counter_affecting_children = false;
@@ -42,7 +42,7 @@ impl<'a> LayoutDamageComputation for &'a mut Flow {
for kid in self_base.children.iter_mut() {
let child_is_absolutely_positioned =
- flow::base(kid).flags.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED);
+ flow::base(kid).flags.contains(IS_ABSOLUTELY_POSITIONED);
flow::mut_base(kid).restyle_damage.insert(
parent_damage.damage_for_child(is_absolutely_positioned,
child_is_absolutely_positioned));
@@ -55,21 +55,21 @@ impl<'a> LayoutDamageComputation for &'a mut Flow {
child_is_absolutely_positioned));
has_counter_affecting_children = has_counter_affecting_children ||
- flow::base(kid).flags.intersects(FlowFlags::AFFECTS_COUNTERS |
- FlowFlags::HAS_COUNTER_AFFECTING_CHILDREN);
+ flow::base(kid).flags.intersects(AFFECTS_COUNTERS |
+ HAS_COUNTER_AFFECTING_CHILDREN);
}
}
let self_base = flow::mut_base(self);
if self_base.flags.float_kind() != float::T::none &&
- self_base.restyle_damage.intersects(ServoRestyleDamage::REFLOW) {
- special_damage.insert(SpecialRestyleDamage::REFLOW_ENTIRE_DOCUMENT);
+ self_base.restyle_damage.intersects(REFLOW) {
+ special_damage.insert(REFLOW_ENTIRE_DOCUMENT);
}
if has_counter_affecting_children {
- self_base.flags.insert(FlowFlags::HAS_COUNTER_AFFECTING_CHILDREN)
+ self_base.flags.insert(HAS_COUNTER_AFFECTING_CHILDREN)
} else {
- self_base.flags.remove(FlowFlags::HAS_COUNTER_AFFECTING_CHILDREN)
+ self_base.flags.remove(HAS_COUNTER_AFFECTING_CHILDREN)
}
special_damage
@@ -78,7 +78,7 @@ impl<'a> LayoutDamageComputation for &'a mut Flow {
fn reflow_entire_document(self) {
let self_base = flow::mut_base(self);
self_base.restyle_damage.insert(RestyleDamage::rebuild_and_reflow());
- self_base.restyle_damage.remove(ServoRestyleDamage::RECONSTRUCT_FLOW);
+ self_base.restyle_damage.remove(RECONSTRUCT_FLOW);
for kid in self_base.children.iter_mut() {
kid.reflow_entire_document();
}