Add support for non-standard -moz color keyword values.

Closes #15928
This commit is contained in:
Matt Brubeck 2017-03-08 10:17:44 -08:00 committed by Emilio Cobos Álvarez
parent 35028f8f60
commit 16e318d055
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
20 changed files with 188 additions and 58 deletions

View file

@ -21,13 +21,13 @@ use app_units::Au;
use cssparser::{Parser, TokenSerializationType};
use error_reporting::ParseErrorReporter;
#[cfg(feature = "servo")] use euclid::side_offsets::SideOffsets2D;
use euclid::size::Size2D;
use computed_values;
use font_metrics::FontMetricsProvider;
#[cfg(feature = "gecko")] use gecko_bindings::bindings;
#[cfg(feature = "gecko")] use gecko_bindings::structs::{self, nsCSSPropertyID};
#[cfg(feature = "servo")] use logical_geometry::{LogicalMargin, PhysicalSide};
use logical_geometry::WritingMode;
use media_queries::Device;
use parser::{Parse, ParserContext, ParserContextExtraData};
use properties::animated_properties::TransitionProperty;
#[cfg(feature = "servo")] use servo_config::prefs::PREFS;
@ -1793,7 +1793,7 @@ bitflags! {
///
/// The arguments are:
///
/// * `viewport_size`: The size of the initial viewport.
/// * `device`: Used to get the initial viewport and other external state.
///
/// * `rule_node`: The rule node in the tree that represent the CSS rules that
/// matched.
@ -1803,7 +1803,7 @@ bitflags! {
/// Returns the computed values.
/// * `flags`: Various flags.
///
pub fn cascade(viewport_size: Size2D<Au>,
pub fn cascade(device: &Device,
rule_node: &StrongRuleNode,
parent_style: Option<<&ComputedValues>,
layout_parent_style: Option<<&ComputedValues>,
@ -1836,7 +1836,7 @@ pub fn cascade(viewport_size: Size2D<Au>,
})
})
};
apply_declarations(viewport_size,
apply_declarations(device,
is_root_element,
iter_declarations,
inherited_style,
@ -1850,7 +1850,7 @@ pub fn cascade(viewport_size: Size2D<Au>,
/// NOTE: This function expects the declaration with more priority to appear
/// first.
pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
pub fn apply_declarations<'a, F, I>(device: &Device,
is_root_element: bool,
iter_declarations: F,
inherited_style: &ComputedValues,
@ -1905,7 +1905,7 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
let mut context = computed::Context {
is_root_element: is_root_element,
viewport_size: viewport_size,
device: device,
inherited_style: inherited_style,
layout_parent_style: layout_parent_style,
style: starting_style,