aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-08-15 16:42:46 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-08-15 17:11:08 +0200
commit4752110d53f07c474e43a327abd3bc5a7cb8dd61 (patch)
treec9c59adb73127fe6e34d856e4dab9cf431526e89 /components/layout
parent4d8fc4b8f74808a8b8383238bb4085bb4279a228 (diff)
downloadservo-4752110d53f07c474e43a327abd3bc5a7cb8dd61.tar.gz
servo-4752110d53f07c474e43a327abd3bc5a7cb8dd61.zip
Fix Servo build and unify display representation.
Diffstat (limited to 'components/layout')
-rw-r--r--components/layout/construct.rs17
-rw-r--r--components/layout/generated_content.rs5
2 files changed, 12 insertions, 10 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs
index 072413995b2..856f8dbc52e 100644
--- a/components/layout/construct.rs
+++ b/components/layout/construct.rs
@@ -1847,6 +1847,10 @@ where
node.type_id()
);
+ // FIXME(emilio): This should look at display-outside and
+ // display-inside, but there's so much stuff that goes through the
+ // generic "block" codepath (wrongly).
+ //
// Switch on display and floatedness.
match (display, float, positioning) {
// `display: none` contributes no flow construction result.
@@ -1871,12 +1875,6 @@ where
self.set_flow_construction_result(node, construction_result)
},
- // List items contribute their own special flows.
- (Display::ListItem, float_value, _) => {
- let construction_result = self.build_flow_for_list_item(node, float_value);
- self.set_flow_construction_result(node, construction_result)
- },
-
// Inline items that are absolutely-positioned contribute inline fragment construction
// results with a hypothetical fragment.
(Display::Inline, _, Position::Absolute) |
@@ -1958,7 +1956,12 @@ where
// properties separately.
(_, float_value, _) => {
let float_kind = FloatKind::from_property(float_value);
- let construction_result = self.build_flow_for_block(node, float_kind);
+ // List items contribute their own special flows.
+ let construction_result = if display.is_list_item() {
+ self.build_flow_for_list_item(node, float_value)
+ } else {
+ self.build_flow_for_block(node, float_kind)
+ };
self.set_flow_construction_result(node, construction_result)
},
}
diff --git a/components/layout/generated_content.rs b/components/layout/generated_content.rs
index 683bb316897..d69ddd65991 100644
--- a/components/layout/generated_content.rs
+++ b/components/layout/generated_content.rs
@@ -19,7 +19,6 @@ use crate::traversal::InorderFlowTraversal;
use script_layout_interface::wrapper_traits::PseudoElementType;
use smallvec::SmallVec;
use std::collections::{HashMap, LinkedList};
-use style::computed_values::display::T as Display;
use style::computed_values::list_style_type::T as ListStyleType;
use style::properties::ComputedValues;
use style::selector_parser::RestyleDamage;
@@ -175,7 +174,7 @@ impl<'a, 'b> ResolveGeneratedContentFragmentMutator<'a, 'b> {
}
let mut list_style_type = fragment.style().get_list().list_style_type;
- if fragment.style().get_box().display != Display::ListItem {
+ if !fragment.style().get_box().display.is_list_item() {
list_style_type = ListStyleType::None
}
@@ -291,7 +290,7 @@ impl<'a, 'b> ResolveGeneratedContentFragmentMutator<'a, 'b> {
fn reset_and_increment_counters_as_necessary(&mut self, fragment: &mut Fragment) {
let mut list_style_type = fragment.style().get_list().list_style_type;
- if !self.is_block || fragment.style().get_box().display != Display::ListItem {
+ if !self.is_block || !fragment.style().get_box().display.is_list_item() {
list_style_type = ListStyleType::None
}