Skip to content
Permalink
Browse files

Fix Servo build and unify display representation.

  • Loading branch information...
emilio committed Aug 15, 2019
1 parent 4d8fc4b commit 4752110d53f07c474e43a327abd3bc5a7cb8dd61
@@ -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)
},
}
@@ -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
}

@@ -91,6 +91,7 @@ extern crate servo_config;
extern crate servo_url;
extern crate smallbitvec;
extern crate smallvec;
#[cfg(feature = "gecko")]
extern crate static_prefs;
#[cfg(feature = "servo")]
extern crate string_cache;
@@ -23,14 +23,14 @@
input: &mut Parser<'i, 't>,
) -> Result<Longhands, ParseError<'i>> {
% if engine == "gecko":
let text_decoration_thickness_enabled =
PropertyId::Longhand(LonghandId::TextDecorationThickness).enabled_for_all_content();

let (mut line, mut style, mut color, mut thickness, mut any) = (None, None, None, None, false);
% else:
let (mut line, mut any) = (None, false);
% endif

let text_decoration_thickness_enabled =
PropertyId::Longhand(LonghandId::TextDecorationThickness).enabled_for_all_content();

loop {
macro_rules! parse_component {
($value:ident, $module:ident) => (
@@ -12,7 +12,6 @@ use crate::properties::longhands::float::computed_value::T as Float;
use crate::properties::longhands::overflow_x::computed_value::T as Overflow;
use crate::properties::longhands::position::computed_value::T as Position;
use crate::properties::{self, ComputedValues, StyleBuilder};
#[cfg(feature = "gecko")]
use crate::values::specified::box_::DisplayInside;
use app_units::Au;

@@ -206,7 +205,6 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {

blockify_if!(self.style.floated());
blockify_if!(self.style.out_of_flow_positioned());
#[cfg(feature = "gecko")]
blockify_if!(
self.style.pseudo.map_or(false, |p| p.is_marker()) &&
self.style.get_parent_list().clone_list_style_position() ==

0 comments on commit 4752110

Please sign in to comment.
You can’t perform that action at this time.