Fix Servo build.

This commit is contained in:
Emilio Cobos Álvarez 2018-05-15 11:37:12 +02:00
parent 164bfbcb40
commit 2a5007926d
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
9 changed files with 26 additions and 17 deletions

View file

@ -54,7 +54,7 @@ use style::logical_geometry::Direction;
use style::properties::ComputedValues; use style::properties::ComputedValues;
use style::selector_parser::{PseudoElement, RestyleDamage}; use style::selector_parser::{PseudoElement, RestyleDamage};
use style::servo::restyle_damage::ServoRestyleDamage; use style::servo::restyle_damage::ServoRestyleDamage;
use style::values::computed::counters::ContentItem; use style::values::generics::counters::ContentItem;
use style::values::generics::url::UrlOrNone as ImageUrlOrNone; use style::values::generics::url::UrlOrNone as ImageUrlOrNone;
use table::TableFlow; use table::TableFlow;
use table_caption::TableCaptionFlow; use table_caption::TableCaptionFlow;

View file

@ -66,7 +66,7 @@ use style::values::computed::Gradient;
use style::values::computed::effects::SimpleShadow; use style::values::computed::effects::SimpleShadow;
use style::values::generics::background::BackgroundSize; use style::values::generics::background::BackgroundSize;
use style::values::generics::image::{GradientKind, Image, PaintWorklet}; use style::values::generics::image::{GradientKind, Image, PaintWorklet};
use style::values::generics::pointing::Cursor; use style::values::generics::ui::Cursor;
use style_traits::CSSPixel; use style_traits::CSSPixel;
use style_traits::ToCss; use style_traits::ToCss;
use style_traits::cursor::CursorKind; use style_traits::cursor::CursorKind;
@ -3012,8 +3012,8 @@ impl ComputedValuesCursorUtility for ComputedValues {
#[inline] #[inline]
fn get_cursor(&self, default_cursor: CursorKind) -> Option<CursorKind> { fn get_cursor(&self, default_cursor: CursorKind) -> Option<CursorKind> {
match ( match (
self.get_pointing().pointer_events, self.get_inheritedui().pointer_events,
&self.get_pointing().cursor, &self.get_inheritedui().cursor,
) { ) {
(PointerEvents::None, _) => None, (PointerEvents::None, _) => None,
(PointerEvents::Auto, &Cursor { keyword: CursorKind::Auto, .. }) => Some(default_cursor), (PointerEvents::Auto, &Cursor { keyword: CursorKind::Auto, .. }) => Some(default_cursor),

View file

@ -51,6 +51,8 @@ impl ToLayout for Filter {
GenericFilter::Sepia(amount) => wr::FilterOp::Sepia(amount.0), GenericFilter::Sepia(amount) => wr::FilterOp::Sepia(amount.0),
// Statically check that DropShadow is impossible. // Statically check that DropShadow is impossible.
GenericFilter::DropShadow(ref shadow) => match *shadow {}, GenericFilter::DropShadow(ref shadow) => match *shadow {},
// Statically check that Url is impossible.
GenericFilter::Url(ref url) => match *url {},
} }
} }
} }

View file

@ -20,7 +20,7 @@ use style::computed_values::list_style_type::T as ListStyleType;
use style::properties::ComputedValues; use style::properties::ComputedValues;
use style::selector_parser::RestyleDamage; use style::selector_parser::RestyleDamage;
use style::servo::restyle_damage::ServoRestyleDamage; use style::servo::restyle_damage::ServoRestyleDamage;
use style::values::computed::counters::ContentItem; use style::values::generics::counters::ContentItem;
use text::TextRunScanner; use text::TextRunScanner;
use traversal::InorderFlowTraversal; use traversal::InorderFlowTraversal;
@ -240,6 +240,9 @@ impl<'a, 'b> ResolveGeneratedContentFragmentMutator<'a, 'b> {
self.traversal.quote -= 1 self.traversal.quote -= 1
} }
} }
GeneratedContentInfo::ContentItem(ContentItem::Url(..)) => {
unreachable!("Servo doesn't parse content: url(..) yet")
}
} }
}; };

View file

@ -36,7 +36,8 @@ use script_layout_interface::wrapper_traits::{ThreadSafeLayoutElement, ThreadSaf
use script_layout_interface::wrapper_traits::GetLayoutData; use script_layout_interface::wrapper_traits::GetLayoutData;
use style::dom::{NodeInfo, TNode}; use style::dom::{NodeInfo, TNode};
use style::selector_parser::RestyleDamage; use style::selector_parser::RestyleDamage;
use style::values::computed::counters::{Content, ContentItem}; use style::values::computed::counters::ContentItem;
use style::values::generics::counters::Content;
pub trait LayoutNodeLayoutData { pub trait LayoutNodeLayoutData {
/// Similar to borrow_data*, but returns the full PersistentLayoutData rather /// Similar to borrow_data*, but returns the full PersistentLayoutData rather
@ -113,12 +114,12 @@ impl<T: ThreadSafeLayoutNode> ThreadSafeLayoutNodeHelpers for T {
if self.get_pseudo_element_type().is_replaced_content() { if self.get_pseudo_element_type().is_replaced_content() {
let style = self.as_element().unwrap().resolved_style(); let style = self.as_element().unwrap().resolved_style();
return match style.as_ref().get_counters().content { return TextContent::GeneratedContent(
Content::Items(ref value) if !value.is_empty() => { match style.as_ref().get_counters().content {
TextContent::GeneratedContent((*value).to_vec()) Content::Items(ref value) => value.to_vec(),
_ => vec![],
} }
_ => TextContent::GeneratedContent(vec![]), );
};
} }
TextContent::Text(self.node_text_content().into_boxed_str()) TextContent::Text(self.node_text_content().into_boxed_str())

View file

@ -2643,10 +2643,10 @@ impl ComputedValuesInner {
/// ineffective, and would yield an empty `::before` or `::after` /// ineffective, and would yield an empty `::before` or `::after`
/// pseudo-element. /// pseudo-element.
pub fn ineffective_content_property(&self) -> bool { pub fn ineffective_content_property(&self) -> bool {
use properties::longhands::content::computed_value::T; use values::generics::counters::Content;
match self.get_counters().content { match self.get_counters().content {
T::Normal | T::None => true, Content::Normal | Content::None => true,
T::Items(ref items) => items.is_empty(), Content::Items(ref items) => items.is_empty(),
} }
} }

View file

@ -14,6 +14,7 @@ use values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero};
use values::animated::color::RGBA; use values::animated::color::RGBA;
use values::computed::{Angle, Number}; use values::computed::{Angle, Number};
use values::computed::length::Length; use values::computed::length::Length;
#[cfg(feature = "gecko")]
use values::computed::url::ComputedUrl; use values::computed::url::ComputedUrl;
use values::distance::{ComputeSquaredDistance, SquaredDistance}; use values::distance::{ComputeSquaredDistance, SquaredDistance};
use values::generics::effects::BoxShadow as GenericBoxShadow; use values::generics::effects::BoxShadow as GenericBoxShadow;
@ -47,7 +48,7 @@ pub type Filter = GenericFilter<Angle, Number, Length, SimpleShadow, ComputedUrl
/// An animated value for a single `filter`. /// An animated value for a single `filter`.
#[cfg(not(feature = "gecko"))] #[cfg(not(feature = "gecko"))]
pub type Filter = GenericFilter<Angle, Number, Length, Impossible, ComputedUrl>; pub type Filter = GenericFilter<Angle, Number, Length, Impossible, Impossible>;
/// An animated value for the `drop-shadow()` filter. /// An animated value for the `drop-shadow()` filter.
pub type SimpleShadow = GenericSimpleShadow<Option<RGBA>, Length, Length>; pub type SimpleShadow = GenericSimpleShadow<Option<RGBA>, Length, Length>;

View file

@ -9,6 +9,7 @@ use values::Impossible;
use values::computed::{Angle, NonNegativeNumber}; use values::computed::{Angle, NonNegativeNumber};
use values::computed::color::RGBAColor; use values::computed::color::RGBAColor;
use values::computed::length::{Length, NonNegativeLength}; use values::computed::length::{Length, NonNegativeLength};
#[cfg(feature = "gecko")]
use values::computed::url::ComputedUrl; use values::computed::url::ComputedUrl;
use values::generics::effects::BoxShadow as GenericBoxShadow; use values::generics::effects::BoxShadow as GenericBoxShadow;
use values::generics::effects::Filter as GenericFilter; use values::generics::effects::Filter as GenericFilter;
@ -23,7 +24,7 @@ pub type Filter = GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, Sim
/// A computed value for a single `filter`. /// A computed value for a single `filter`.
#[cfg(not(feature = "gecko"))] #[cfg(not(feature = "gecko"))]
pub type Filter = GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, Impossible, ComputedUrl>; pub type Filter = GenericFilter<Angle, NonNegativeNumber, NonNegativeLength, Impossible, Impossible>;
/// A computed value for the `drop-shadow()` filter. /// A computed value for the `drop-shadow()` filter.
pub type SimpleShadow = GenericSimpleShadow<Option<RGBAColor>, Length, NonNegativeLength>; pub type SimpleShadow = GenericSimpleShadow<Option<RGBAColor>, Length, NonNegativeLength>;

View file

@ -19,6 +19,7 @@ use values::generics::effects::SimpleShadow as GenericSimpleShadow;
use values::specified::{Angle, NumberOrPercentage}; use values::specified::{Angle, NumberOrPercentage};
use values::specified::color::RGBAColor; use values::specified::color::RGBAColor;
use values::specified::length::{Length, NonNegativeLength}; use values::specified::length::{Length, NonNegativeLength};
#[cfg(feature = "gecko")]
use values::specified::url::SpecifiedUrl; use values::specified::url::SpecifiedUrl;
/// A specified value for a single shadow of the `box-shadow` property. /// A specified value for a single shadow of the `box-shadow` property.
@ -31,7 +32,7 @@ pub type Filter = GenericFilter<Angle, Factor, NonNegativeLength, SimpleShadow,
/// A specified value for a single `filter`. /// A specified value for a single `filter`.
#[cfg(not(feature = "gecko"))] #[cfg(not(feature = "gecko"))]
pub type Filter = GenericFilter<Angle, Factor, NonNegativeLength, Impossible, SpecifiedUrl>; pub type Filter = GenericFilter<Angle, Factor, NonNegativeLength, Impossible, Impossible>;
/// A value for the `<factor>` parts in `Filter`. /// A value for the `<factor>` parts in `Filter`.
#[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)] #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToCss)]