aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/script/size_of.rs8
-rw-r--r--tests/unit/style/Cargo.toml2
-rw-r--r--tests/unit/style/lib.rs1
-rw-r--r--tests/unit/style/parsing/basic_shape.rs3
-rw-r--r--tests/unit/style/parsing/border.rs19
-rw-r--r--tests/unit/style/parsing/font.rs17
-rw-r--r--tests/unit/style/parsing/mod.rs1
-rw-r--r--tests/unit/style/parsing/outline.rs37
-rw-r--r--tests/unit/style/properties/background.rs19
-rw-r--r--tests/unit/style/properties/mod.rs1
-rw-r--r--tests/unit/style/properties/serialization.rs62
-rw-r--r--tests/unit/style/size_of.rs44
-rw-r--r--tests/unit/style/stylesheets.rs4
-rw-r--r--tests/unit/style/stylist.rs6
-rw-r--r--tests/unit/stylo/Cargo.toml2
-rw-r--r--tests/unit/stylo/sanity_checks.rs34
-rw-r--r--tests/wpt/include.ini4
-rw-r--r--tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-repeat-repeat-x.htm.ini3
-rw-r--r--tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-repeat-repeat-y.htm.ini3
-rw-r--r--tests/wpt/metadata-css/css-flexbox-1_dev/html/flexbox_direction-row-reverse.htm.ini4
-rw-r--r--tests/wpt/metadata-css/css-transforms-1_dev/html/transform-input-017.htm.ini3
-rw-r--r--tests/wpt/metadata-css/css-transforms-1_dev/html/transform-input-018.htm.ini3
-rw-r--r--tests/wpt/metadata-css/css21_dev/html4/attribute-token-selector-002.htm.ini3
-rw-r--r--tests/wpt/metadata-css/css21_dev/html4/background-repeat-repeat-x.htm.ini3
-rw-r--r--tests/wpt/metadata-css/css21_dev/html4/background-repeat-repeat-y.htm.ini3
-rw-r--r--tests/wpt/metadata-css/css21_dev/html4/c5525-fltwidth-003.htm.ini4
-rw-r--r--tests/wpt/metadata-css/css21_dev/html4/floats-028.htm.ini3
-rw-r--r--tests/wpt/metadata-css/cssom-1_dev/html/index-002.htm.ini3
-rw-r--r--tests/wpt/metadata/cssom/serialize-values.html.ini149
-rw-r--r--tests/wpt/mozilla/meta/MANIFEST.json8
-rw-r--r--tests/wpt/mozilla/tests/css/position_fixed_a.html1
-rw-r--r--tests/wpt/mozilla/tests/css/position_fixed_b.html1
-rw-r--r--tests/wpt/mozilla/tests/mozilla/interfaces.worker.js2
-rw-r--r--tests/wpt/mozilla/tests/mozilla/mime_sniffing_font_context.html1
34 files changed, 389 insertions, 72 deletions
diff --git a/tests/unit/script/size_of.rs b/tests/unit/script/size_of.rs
index a328bcbf6f5..30bc822fdbf 100644
--- a/tests/unit/script/size_of.rs
+++ b/tests/unit/script/size_of.rs
@@ -31,10 +31,10 @@ macro_rules! sizeof_checker (
// Update the sizes here
sizeof_checker!(size_event_target, EventTarget, 40);
sizeof_checker!(size_node, Node, 152);
-sizeof_checker!(size_element, Element, 320);
-sizeof_checker!(size_htmlelement, HTMLElement, 336);
-sizeof_checker!(size_div, HTMLDivElement, 336);
-sizeof_checker!(size_span, HTMLSpanElement, 336);
+sizeof_checker!(size_element, Element, 312);
+sizeof_checker!(size_htmlelement, HTMLElement, 328);
+sizeof_checker!(size_div, HTMLDivElement, 328);
+sizeof_checker!(size_span, HTMLSpanElement, 328);
sizeof_checker!(size_text, Text, 184);
sizeof_checker!(size_characterdata, CharacterData, 184);
sizeof_checker!(size_servothreadsafelayoutnode, ServoThreadSafeLayoutNode, 16);
diff --git a/tests/unit/style/Cargo.toml b/tests/unit/style/Cargo.toml
index 9d932d2207d..28ef6b55065 100644
--- a/tests/unit/style/Cargo.toml
+++ b/tests/unit/style/Cargo.toml
@@ -22,7 +22,7 @@ owning_ref = "0.2.2"
parking_lot = "0.3"
rayon = "0.6"
rustc-serialize = "0.3"
-selectors = "0.17"
+selectors = {path = "../../../components/selectors"}
servo_atoms = {path = "../../../components/atoms"}
servo_config = {path = "../../../components/config"}
style = {path = "../../../components/style"}
diff --git a/tests/unit/style/lib.rs b/tests/unit/style/lib.rs
index 26d242b26b8..e9b0133538f 100644
--- a/tests/unit/style/lib.rs
+++ b/tests/unit/style/lib.rs
@@ -32,6 +32,7 @@ mod owning_handle;
mod parsing;
mod properties;
mod rule_tree;
+mod size_of;
mod str;
mod stylesheets;
mod stylist;
diff --git a/tests/unit/style/parsing/basic_shape.rs b/tests/unit/style/parsing/basic_shape.rs
index 342d732b5c2..ecac5679980 100644
--- a/tests/unit/style/parsing/basic_shape.rs
+++ b/tests/unit/style/parsing/basic_shape.rs
@@ -96,6 +96,8 @@ fn test_circle() {
assert_roundtrip_basicshape!(Circle::parse, "circle(closest-side at center)", "circle(at 50% 50%)");
assert_roundtrip_basicshape!(Circle::parse, "circle(farthest-side at center)",
"circle(farthest-side at 50% 50%)");
+ assert_roundtrip_basicshape!(Circle::parse, "circle(10px)",
+ "circle(10px at 50% 50%)");
assert_roundtrip_basicshape!(Circle::parse, "circle(20px at center)", "circle(20px at 50% 50%)");
assert_roundtrip_basicshape!(Circle::parse, "circle(calc(1px + 50%) at center)",
"circle(calc(1px + 50%) at 50% 50%)");
@@ -114,6 +116,7 @@ fn test_circle() {
"circle(at left 5% bottom 1px)");
assert!(parse(Circle::parse, "circle(at top 40%)").is_err());
+ assert!(parse(Circle::parse, "circle(-10px)").is_err());
}
#[test]
diff --git a/tests/unit/style/parsing/border.rs b/tests/unit/style/parsing/border.rs
index 7eab37513cf..56a0ad47a90 100644
--- a/tests/unit/style/parsing/border.rs
+++ b/tests/unit/style/parsing/border.rs
@@ -5,11 +5,12 @@
use cssparser::Parser;
use media_queries::CSSErrorReporterTest;
use servo_url::ServoUrl;
-use style::parser::ParserContext;
+use style::parser::{ParserContext, Parse};
use style::properties::longhands::{border_image_outset, border_image_repeat, border_image_slice};
use style::properties::longhands::{border_image_source, border_image_width};
use style::properties::shorthands::border_image;
use style::stylesheets::Origin;
+use style_traits::ToCss;
#[test]
fn border_image_shorthand_should_parse_when_all_properties_specified() {
@@ -122,3 +123,19 @@ fn border_image_outset_should_return_length_on_length_zero() {
let result = border_image_outset::parse(&context, &mut parser);
assert_eq!(result.unwrap(), parse_longhand!(border_image_outset, "0em"));
}
+
+#[test]
+fn test_border_style() {
+ use style::values::specified::BorderStyle;
+
+ assert_roundtrip_with_context!(BorderStyle::parse, r#"none"#);
+ assert_roundtrip_with_context!(BorderStyle::parse, r#"hidden"#);
+ assert_roundtrip_with_context!(BorderStyle::parse, r#"solid"#);
+ assert_roundtrip_with_context!(BorderStyle::parse, r#"double"#);
+ assert_roundtrip_with_context!(BorderStyle::parse, r#"dotted"#);
+ assert_roundtrip_with_context!(BorderStyle::parse, r#"dashed"#);
+ assert_roundtrip_with_context!(BorderStyle::parse, r#"groove"#);
+ assert_roundtrip_with_context!(BorderStyle::parse, r#"ridge"#);
+ assert_roundtrip_with_context!(BorderStyle::parse, r#"inset"#);
+ assert_roundtrip_with_context!(BorderStyle::parse, r#"outset"#);
+}
diff --git a/tests/unit/style/parsing/font.rs b/tests/unit/style/parsing/font.rs
index 02d043bcd07..7fdd3565e5c 100644
--- a/tests/unit/style/parsing/font.rs
+++ b/tests/unit/style/parsing/font.rs
@@ -6,7 +6,7 @@ use cssparser::Parser;
use media_queries::CSSErrorReporterTest;
use servo_url::ServoUrl;
use style::parser::ParserContext;
-use style::properties::longhands::font_feature_settings;
+use style::properties::longhands::{font_feature_settings, font_weight};
use style::properties::longhands::font_feature_settings::computed_value;
use style::properties::longhands::font_feature_settings::computed_value::FeatureTagValue;
use style::stylesheets::Origin;
@@ -99,6 +99,21 @@ fn font_language_override_should_parse_properly() {
}
#[test]
+fn font_weight_keyword_should_preserve_keyword() {
+ use style::properties::longhands::font_weight::SpecifiedValue;
+
+ let url = ServoUrl::parse("http://localhost").unwrap();
+ let context = ParserContext::new(Origin::Author, &url, Box::new(CSSErrorReporterTest));
+ let mut parser = Parser::new("normal");
+ let result = font_weight::parse(&context, &mut parser);
+ assert_eq!(result.unwrap(), SpecifiedValue::Normal);
+
+ let mut parser = Parser::new("bold");
+ let result = font_weight::parse(&context, &mut parser);
+ assert_eq!(result.unwrap(), SpecifiedValue::Bold);
+}
+
+#[test]
#[should_panic]
fn font_language_override_should_fail_on_empty_str() {
use style::properties::longhands::font_language_override;
diff --git a/tests/unit/style/parsing/mod.rs b/tests/unit/style/parsing/mod.rs
index d011897da6b..208179eb148 100644
--- a/tests/unit/style/parsing/mod.rs
+++ b/tests/unit/style/parsing/mod.rs
@@ -75,6 +75,7 @@ mod image;
mod inherited_box;
mod inherited_text;
mod mask;
+mod outline;
mod position;
mod selectors;
mod supports;
diff --git a/tests/unit/style/parsing/outline.rs b/tests/unit/style/parsing/outline.rs
new file mode 100644
index 00000000000..7ffa5eeee5b
--- /dev/null
+++ b/tests/unit/style/parsing/outline.rs
@@ -0,0 +1,37 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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 cssparser::Parser;
+use media_queries::CSSErrorReporterTest;
+use style::parser::ParserContext;
+use style::stylesheets::Origin;
+use style_traits::ToCss;
+
+#[test]
+fn test_outline_style() {
+ use style::properties::longhands::outline_style;
+
+ assert_roundtrip_with_context!(outline_style::parse, r#"auto"#);
+ assert_roundtrip_with_context!(outline_style::parse, r#"none"#);
+ assert_roundtrip_with_context!(outline_style::parse, r#"solid"#);
+ assert_roundtrip_with_context!(outline_style::parse, r#"double"#);
+ assert_roundtrip_with_context!(outline_style::parse, r#"dotted"#);
+ assert_roundtrip_with_context!(outline_style::parse, r#"dashed"#);
+ assert_roundtrip_with_context!(outline_style::parse, r#"groove"#);
+ assert_roundtrip_with_context!(outline_style::parse, r#"ridge"#);
+ assert_roundtrip_with_context!(outline_style::parse, r#"inset"#);
+ assert_roundtrip_with_context!(outline_style::parse, r#"outset"#);
+
+ {
+ // The outline-style property accepts the same values as border-style,
+ // except that 'hidden' is not a legal outline style.
+
+ let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
+ let context = ParserContext::new(Origin::Author, &url, Box::new(CSSErrorReporterTest));
+ let mut parser = Parser::new(r#"hidden"#);
+ let parsed = outline_style::parse(&context, &mut parser);
+ assert!(parsed.is_err());
+ };
+
+}
diff --git a/tests/unit/style/properties/background.rs b/tests/unit/style/properties/background.rs
new file mode 100644
index 00000000000..493e12e3dcf
--- /dev/null
+++ b/tests/unit/style/properties/background.rs
@@ -0,0 +1,19 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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 cssparser::Parser;
+use media_queries::CSSErrorReporterTest;
+use style::parser::ParserContext;
+use style::properties::longhands::background_size;
+use style::stylesheets::Origin;
+
+#[test]
+fn background_size_should_reject_negative_values() {
+ let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
+ let context = ParserContext::new(Origin::Author, &url, Box::new(CSSErrorReporterTest));
+
+ let parse_result = background_size::parse(&context, &mut Parser::new("-40% -40%"));
+
+ assert_eq!(parse_result.is_err(), true);
+}
diff --git a/tests/unit/style/properties/mod.rs b/tests/unit/style/properties/mod.rs
index 639ce9222f7..68713440b45 100644
--- a/tests/unit/style/properties/mod.rs
+++ b/tests/unit/style/properties/mod.rs
@@ -2,6 +2,7 @@
* 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/. */
+mod background;
mod scaffolding;
mod serialization;
mod viewport;
diff --git a/tests/unit/style/properties/serialization.rs b/tests/unit/style/properties/serialization.rs
index 5c5061b1f04..da2574a575d 100644
--- a/tests/unit/style/properties/serialization.rs
+++ b/tests/unit/style/properties/serialization.rs
@@ -8,7 +8,8 @@ pub use style::properties::{DeclaredValue, PropertyDeclaration, PropertyDeclarat
pub use style::values::specified::{BorderStyle, BorderWidth, CSSColor, Length, NoCalcLength};
pub use style::values::specified::{LengthOrPercentage, LengthOrPercentageOrAuto, LengthOrPercentageOrAutoOrContent};
pub use style::properties::longhands::outline_color::computed_value::T as ComputedColor;
-pub use style::values::RGBA;
+pub use style::properties::longhands::outline_style::SpecifiedValue as OutlineStyle;
+pub use style::values::{RGBA, Auto};
pub use style::values::specified::url::{UrlExtraData, SpecifiedUrl};
pub use style_traits::ToCss;
@@ -230,15 +231,15 @@ mod shorthand_serialization {
fn border_color_should_serialize_correctly() {
let mut properties = Vec::new();
- let red = DeclaredValue::Value(CSSColor {
+ let red = DeclaredValue::Value(Box::new(CSSColor {
parsed: ComputedColor::RGBA(RGBA { red: 1f32, green: 0f32, blue: 0f32, alpha: 1f32 }),
authored: None
- });
+ }));
- let blue = DeclaredValue::Value(CSSColor {
+ let blue = DeclaredValue::Value(Box::new(CSSColor {
parsed: ComputedColor::RGBA(RGBA { red: 0f32, green: 0f32, blue: 1f32, alpha: 1f32 }),
authored: None
- });
+ }));
properties.push(PropertyDeclaration::BorderTopColor(blue.clone()));
properties.push(PropertyDeclaration::BorderRightColor(red.clone()));
@@ -280,10 +281,10 @@ mod shorthand_serialization {
let width = DeclaredValue::Value(BorderWidth::from_length(Length::from_px(4f32)));
let style = DeclaredValue::Value(BorderStyle::solid);
- let color = DeclaredValue::Value(CSSColor {
+ let color = DeclaredValue::Value(Box::new(CSSColor {
parsed: ComputedColor::RGBA(RGBA { red: 1f32, green: 0f32, blue: 0f32, alpha: 1f32 }),
authored: None
- });
+ }));
properties.push(PropertyDeclaration::BorderTopWidth(width));
properties.push(PropertyDeclaration::BorderTopStyle(style));
@@ -299,10 +300,10 @@ mod shorthand_serialization {
let width = DeclaredValue::Value(BorderWidth::from_length(Length::from_px(4f32)));
let style = DeclaredValue::Initial;
- let color = DeclaredValue::Value(CSSColor {
+ let color = DeclaredValue::Value(Box::new(CSSColor {
parsed: ComputedColor::RGBA(RGBA { red: 1f32, green: 0f32, blue: 0f32, alpha: 1f32 }),
authored: None
- });
+ }));
properties.push(PropertyDeclaration::BorderTopWidth(width));
properties.push(PropertyDeclaration::BorderTopStyle(style));
@@ -459,6 +460,7 @@ mod shorthand_serialization {
mod outline {
use style::properties::longhands::outline_width::SpecifiedValue as WidthContainer;
+ use style::values::Either;
use super::*;
#[test]
@@ -466,11 +468,11 @@ mod shorthand_serialization {
let mut properties = Vec::new();
let width = DeclaredValue::Value(WidthContainer(Length::from_px(4f32)));
- let style = DeclaredValue::Value(BorderStyle::solid);
- let color = DeclaredValue::Value(CSSColor {
+ let style = DeclaredValue::Value(Either::Second(BorderStyle::solid));
+ let color = DeclaredValue::Value(Box::new(CSSColor {
parsed: ComputedColor::RGBA(RGBA { red: 1f32, green: 0f32, blue: 0f32, alpha: 1f32 }),
authored: None
- });
+ }));
properties.push(PropertyDeclaration::OutlineWidth(width));
properties.push(PropertyDeclaration::OutlineStyle(style));
@@ -485,7 +487,7 @@ mod shorthand_serialization {
let mut properties = Vec::new();
let width = DeclaredValue::Value(WidthContainer(Length::from_px(4f32)));
- let style = DeclaredValue::Value(BorderStyle::solid);
+ let style = DeclaredValue::Value(Either::Second(BorderStyle::solid));
let color = DeclaredValue::Initial;
properties.push(PropertyDeclaration::OutlineWidth(width));
@@ -502,10 +504,10 @@ mod shorthand_serialization {
let width = DeclaredValue::Value(WidthContainer(Length::from_px(4f32)));
let style = DeclaredValue::Initial;
- let color = DeclaredValue::Value(CSSColor {
+ let color = DeclaredValue::Value(Box::new(CSSColor {
parsed: ComputedColor::RGBA(RGBA { red: 1f32, green: 0f32, blue: 0f32, alpha: 1f32 }),
authored: None
- });
+ }));
properties.push(PropertyDeclaration::OutlineWidth(width));
properties.push(PropertyDeclaration::OutlineStyle(style));
properties.push(PropertyDeclaration::OutlineColor(color));
@@ -513,6 +515,24 @@ mod shorthand_serialization {
let serialization = shorthand_properties_to_string(properties);
assert_eq!(serialization, "outline: 4px none rgb(255, 0, 0);");
}
+
+ #[test]
+ fn outline_should_serialize_correctly_when_style_is_auto() {
+ let mut properties = Vec::new();
+
+ let width = DeclaredValue::Value(WidthContainer(Length::from_px(4f32)));
+ let style = DeclaredValue::Value(Either::First(Auto));
+ let color = DeclaredValue::Value(Box::new(CSSColor {
+ parsed: ComputedColor::RGBA(RGBA { red: 1f32, green: 0f32, blue: 0f32, alpha: 1f32 }),
+ authored: None
+ }));
+ properties.push(PropertyDeclaration::OutlineWidth(width));
+ properties.push(PropertyDeclaration::OutlineStyle(style));
+ properties.push(PropertyDeclaration::OutlineColor(color));
+
+ let serialization = shorthand_properties_to_string(properties);
+ assert_eq!(serialization, "outline: 4px auto rgb(255, 0, 0);");
+ }
}
#[test]
@@ -710,10 +730,10 @@ mod shorthand_serialization {
fn background_should_serialize_all_available_properties_when_specified() {
let mut properties = Vec::new();
- let color = DeclaredValue::Value(CSSColor {
+ let color = DeclaredValue::Value(Box::new(CSSColor {
parsed: ComputedColor::RGBA(RGBA { red: 1f32, green: 0f32, blue: 0f32, alpha: 1f32 }),
authored: None
- });
+ }));
let position_x = single_vec_value_typedef!(position_x,
HorizontalPosition {
@@ -770,10 +790,10 @@ mod shorthand_serialization {
fn background_should_combine_origin_and_clip_properties_when_equal() {
let mut properties = Vec::new();
- let color = DeclaredValue::Value(CSSColor {
+ let color = DeclaredValue::Value(Box::new(CSSColor {
parsed: ComputedColor::RGBA(RGBA { red: 1f32, green: 0f32, blue: 0f32, alpha: 1f32 }),
authored: None
- });
+ }));
let position_x = single_vec_value_typedef!(position_x,
HorizontalPosition {
@@ -829,10 +849,10 @@ mod shorthand_serialization {
fn background_should_always_print_color_and_url_and_repeat_and_attachment_and_position() {
let mut properties = Vec::new();
- let color = DeclaredValue::Value(CSSColor {
+ let color = DeclaredValue::Value(Box::new(CSSColor {
parsed: ComputedColor::RGBA(RGBA { red: 1f32, green: 0f32, blue: 0f32, alpha: 1f32 }),
authored: None
- });
+ }));
let position_x = single_vec_value_typedef!(position_x,
HorizontalPosition {
diff --git a/tests/unit/style/size_of.rs b/tests/unit/style/size_of.rs
new file mode 100644
index 00000000000..fb001763be4
--- /dev/null
+++ b/tests/unit/style/size_of.rs
@@ -0,0 +1,44 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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 std::mem::size_of;
+use style::properties::{PropertyDeclaration, specified_value_sizes};
+
+#[test]
+fn size_of_property_declaration() {
+ let old = 48;
+ let new = size_of::<PropertyDeclaration>();
+ if new < old {
+ panic!("Your changes have decreased the stack size of PropertyDeclaration enum from {} to {}. \
+ Good work! Please update the size in tests/unit/style/size_of.rs.",
+ old, new)
+ } else if new > old {
+ panic!("Your changes have increased the stack size of PropertyDeclaration enum from {} to {}. \
+ These enum is present in large quantities in the style, and increasing the size \
+ may dramatically affect our memory footprint. Please consider using `boxed=\"True\"` in \
+ the longhand If you feel that the increase is necessary, update to the new size in \
+ tests/unit/style/size_of.rs.",
+ old, new)
+ }
+}
+
+#[test]
+fn size_of_specified_values() {
+ let threshold = 40;
+ let longhands = specified_value_sizes();
+
+ for specified_value in longhands {
+ if specified_value.1 >= threshold && !specified_value.2 {
+ panic!("Your changes have increased the size of {} SpecifiedValue to {}. The threshold is \
+ currently {}. SpecifiedValues are affect size of PropertyDeclaration enum and \
+ increasing the size may dramatically affect our memory footprint. Please consider \
+ using `boxed=\"True\"` in this longhand.",
+ specified_value.0, specified_value.1, threshold)
+ } else if specified_value.1 < threshold && specified_value.2 {
+ panic!("Your changes have decreased the size of {} SpecifiedValue to {}. Good work! \
+ The threshold is currently {}. Please consider removing `boxed=\"True\"` from this longhand.",
+ specified_value.0, specified_value.1, threshold)
+ }
+ }
+}
diff --git a/tests/unit/style/stylesheets.rs b/tests/unit/style/stylesheets.rs
index 40ad06d8e4f..f2ff5d0163b 100644
--- a/tests/unit/style/stylesheets.rs
+++ b/tests/unit/style/stylesheets.rs
@@ -183,12 +183,12 @@ fn test_parse_stylesheet() {
block: Arc::new(RwLock::new(PropertyDeclarationBlock {
declarations: vec![
(PropertyDeclaration::BackgroundColor(DeclaredValue::Value(
- longhands::background_color::SpecifiedValue {
+ Box::new(longhands::background_color::SpecifiedValue {
authored: Some("blue".to_owned()),
parsed: cssparser::Color::RGBA(cssparser::RGBA {
red: 0., green: 0., blue: 1., alpha: 1.
}),
- }
+ })
)),
Importance::Normal),
(PropertyDeclaration::BackgroundPositionX(DeclaredValue::Value(
diff --git a/tests/unit/style/stylist.rs b/tests/unit/style/stylist.rs
index fe330d865c7..abb8f459211 100644
--- a/tests/unit/style/stylist.rs
+++ b/tests/unit/style/stylist.rs
@@ -112,11 +112,9 @@ fn test_insert() {
fn test_get_universal_rules() {
thread_state::initialize(thread_state::LAYOUT);
let map = get_mock_map(&["*|*", "#foo > *|*", ".klass", "#id"]);
- let mut decls = vec![];
- map.get_universal_rules(&mut decls,
- CascadeLevel::UserNormal,
- CascadeLevel::UserImportant);
+ let decls = map.get_universal_rules(CascadeLevel::UserNormal,
+ CascadeLevel::UserImportant);
assert_eq!(decls.len(), 1);
}
diff --git a/tests/unit/stylo/Cargo.toml b/tests/unit/stylo/Cargo.toml
index ec3960b520f..c53df85dc79 100644
--- a/tests/unit/stylo/Cargo.toml
+++ b/tests/unit/stylo/Cargo.toml
@@ -22,7 +22,7 @@ libc = "0.2"
log = {version = "0.3.5", features = ["release_max_level_info"]}
num_cpus = "1.1.0"
parking_lot = "0.3"
-selectors = "0.17"
+selectors = {path = "../../../components/selectors"}
servo_url = {path = "../../../components/url"}
style_traits = {path = "../../../components/style_traits"}
geckoservo = {path = "../../../ports/geckolib"}
diff --git a/tests/unit/stylo/sanity_checks.rs b/tests/unit/stylo/sanity_checks.rs
index fe49449637c..1f957e32847 100644
--- a/tests/unit/stylo/sanity_checks.rs
+++ b/tests/unit/stylo/sanity_checks.rs
@@ -32,15 +32,31 @@ fn assert_restyle_hints_match() {
use style::restyle_hints::*; // For flags
use style::gecko_bindings::structs;
- check_enum_value_non_static!(structs::nsRestyleHint_eRestyle_Self, RESTYLE_SELF.bits());
- // XXX This for Servo actually means something like an hypothetical
- // Restyle_AllDescendants (but without running selector matching on the
- // element). ServoRestyleManager interprets it like that, but in practice we
- // should align the behavior with Gecko adding a new restyle hint, maybe?
- //
- // See https://bugzilla.mozilla.org/show_bug.cgi?id=1291786
- check_enum_value_non_static!(structs::nsRestyleHint_eRestyle_SomeDescendants, RESTYLE_DESCENDANTS.bits());
- check_enum_value_non_static!(structs::nsRestyleHint_eRestyle_LaterSiblings, RESTYLE_LATER_SIBLINGS.bits());
+ macro_rules! check_restyle_hints {
+ ( $( $a:ident => $b:ident ),*, ) => {
+ {
+ let mut hints = RestyleHint::all();
+ $(
+ check_enum_value_non_static!(structs::$a, $b.bits());
+ hints.remove($b);
+ )*
+ assert_eq!(hints, RestyleHint::empty(), "all RestyleHint bits should have an assertion");
+ }
+ }
+ }
+
+ check_restyle_hints! {
+ nsRestyleHint_eRestyle_Self => RESTYLE_SELF,
+ // XXX This for Servo actually means something like an hypothetical
+ // Restyle_AllDescendants (but without running selector matching on the
+ // element). ServoRestyleManager interprets it like that, but in practice we
+ // should align the behavior with Gecko adding a new restyle hint, maybe?
+ //
+ // See https://bugzilla.mozilla.org/show_bug.cgi?id=1291786
+ nsRestyleHint_eRestyle_SomeDescendants => RESTYLE_DESCENDANTS,
+ nsRestyleHint_eRestyle_LaterSiblings => RESTYLE_LATER_SIBLINGS,
+ nsRestyleHint_eRestyle_StyleAttribute => RESTYLE_STYLE_ATTRIBUTE,
+ }
}
// Note that we can't call each_pseudo_element, parse_pseudo_element, or
diff --git a/tests/wpt/include.ini b/tests/wpt/include.ini
index f84dc09d350..359420680f3 100644
--- a/tests/wpt/include.ini
+++ b/tests/wpt/include.ini
@@ -7,8 +7,12 @@ skip: true
skip: false
[cors]
skip: false
+[cssom]
+ skip: false
[cssom-view]
skip: false
+[css-values]
+ skip: false
[dom]
skip: false
[domparsing]
diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-repeat-repeat-x.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-repeat-repeat-x.htm.ini
index 4f828f8bab8..c06bdccbb3c 100644
--- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-repeat-repeat-x.htm.ini
+++ b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-repeat-repeat-x.htm.ini
@@ -1,4 +1,3 @@
[background-repeat-repeat-x.htm]
type: reftest
- expected:
- if os == "mac": FAIL
+ expected: FAIL
diff --git a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-repeat-repeat-y.htm.ini b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-repeat-repeat-y.htm.ini
index 354350d036e..ed4668c8acc 100644
--- a/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-repeat-repeat-y.htm.ini
+++ b/tests/wpt/metadata-css/css-backgrounds-3_dev/html4/background-repeat-repeat-y.htm.ini
@@ -1,4 +1,3 @@
[background-repeat-repeat-y.htm]
type: reftest
- expected:
- if os == "mac": FAIL
+ expected: FAIL
diff --git a/tests/wpt/metadata-css/css-flexbox-1_dev/html/flexbox_direction-row-reverse.htm.ini b/tests/wpt/metadata-css/css-flexbox-1_dev/html/flexbox_direction-row-reverse.htm.ini
deleted file mode 100644
index 4b0333dd2cf..00000000000
--- a/tests/wpt/metadata-css/css-flexbox-1_dev/html/flexbox_direction-row-reverse.htm.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[flexbox_direction-row-reverse.htm]
- type: reftest
- expected:
- if os == "mac": FAIL
diff --git a/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-input-017.htm.ini b/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-input-017.htm.ini
index 1c921a68c69..11708836af0 100644
--- a/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-input-017.htm.ini
+++ b/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-input-017.htm.ini
@@ -1,3 +1,4 @@
[transform-input-017.htm]
type: reftest
- expected: FAIL
+ expected:
+ if os == "linux": FAIL
diff --git a/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-input-018.htm.ini b/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-input-018.htm.ini
index 23299ad9e96..2838a64d8f4 100644
--- a/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-input-018.htm.ini
+++ b/tests/wpt/metadata-css/css-transforms-1_dev/html/transform-input-018.htm.ini
@@ -1,3 +1,4 @@
[transform-input-018.htm]
type: reftest
- expected: FAIL
+ expected:
+ if os == "linux": FAIL
diff --git a/tests/wpt/metadata-css/css21_dev/html4/attribute-token-selector-002.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/attribute-token-selector-002.htm.ini
deleted file mode 100644
index 7e070cdc440..00000000000
--- a/tests/wpt/metadata-css/css21_dev/html4/attribute-token-selector-002.htm.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[attribute-token-selector-002.htm]
- type: reftest
- expected: FAIL
diff --git a/tests/wpt/metadata-css/css21_dev/html4/background-repeat-repeat-x.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/background-repeat-repeat-x.htm.ini
index 4f828f8bab8..c06bdccbb3c 100644
--- a/tests/wpt/metadata-css/css21_dev/html4/background-repeat-repeat-x.htm.ini
+++ b/tests/wpt/metadata-css/css21_dev/html4/background-repeat-repeat-x.htm.ini
@@ -1,4 +1,3 @@
[background-repeat-repeat-x.htm]
type: reftest
- expected:
- if os == "mac": FAIL
+ expected: FAIL
diff --git a/tests/wpt/metadata-css/css21_dev/html4/background-repeat-repeat-y.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/background-repeat-repeat-y.htm.ini
index 354350d036e..ed4668c8acc 100644
--- a/tests/wpt/metadata-css/css21_dev/html4/background-repeat-repeat-y.htm.ini
+++ b/tests/wpt/metadata-css/css21_dev/html4/background-repeat-repeat-y.htm.ini
@@ -1,4 +1,3 @@
[background-repeat-repeat-y.htm]
type: reftest
- expected:
- if os == "mac": FAIL
+ expected: FAIL
diff --git a/tests/wpt/metadata-css/css21_dev/html4/c5525-fltwidth-003.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/c5525-fltwidth-003.htm.ini
new file mode 100644
index 00000000000..f1e5b2f41ee
--- /dev/null
+++ b/tests/wpt/metadata-css/css21_dev/html4/c5525-fltwidth-003.htm.ini
@@ -0,0 +1,4 @@
+[c5525-fltwidth-003.htm]
+ type: reftest
+ expected:
+ if os == "linux": FAIL
diff --git a/tests/wpt/metadata-css/css21_dev/html4/floats-028.htm.ini b/tests/wpt/metadata-css/css21_dev/html4/floats-028.htm.ini
index 9f983b23edc..5f07b8a762e 100644
--- a/tests/wpt/metadata-css/css21_dev/html4/floats-028.htm.ini
+++ b/tests/wpt/metadata-css/css21_dev/html4/floats-028.htm.ini
@@ -1,3 +1,4 @@
[floats-028.htm]
type: reftest
- expected: FAIL
+ expected:
+ if os == "mac": FAIL
diff --git a/tests/wpt/metadata-css/cssom-1_dev/html/index-002.htm.ini b/tests/wpt/metadata-css/cssom-1_dev/html/index-002.htm.ini
index 6c6988d9d24..d14968755f7 100644
--- a/tests/wpt/metadata-css/cssom-1_dev/html/index-002.htm.ini
+++ b/tests/wpt/metadata-css/cssom-1_dev/html/index-002.htm.ini
@@ -33,6 +33,3 @@
[list is expected to be list-style: circle inside;]
expected: FAIL
- [font-family is expected to be font-family: sans-serif; line-height: 2em; font-size: 3em; font-style: italic; font-weight: bold;]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/cssom/serialize-values.html.ini b/tests/wpt/metadata/cssom/serialize-values.html.ini
new file mode 100644
index 00000000000..1cfe7497be5
--- /dev/null
+++ b/tests/wpt/metadata/cssom/serialize-values.html.ini
@@ -0,0 +1,149 @@
+[serialize-values.html]
+ type: testharness
+ [border-spacing: 0px]
+ expected: FAIL
+
+ [border-spacing: 1px]
+ expected: FAIL
+
+ [border-spacing: .1em]
+ expected: FAIL
+
+ [content: url("http://localhost/")]
+ expected: FAIL
+
+ [content: url(http://localhost/)]
+ expected: FAIL
+
+ [content: counter(par-num, upper-roman)]
+ expected: FAIL
+
+ [content: attr(foo-bar)]
+ expected: FAIL
+
+ [content: attr(foo_bar)]
+ expected: FAIL
+
+ [font-family: Arial]
+ expected: FAIL
+
+ [font-size: xx-small]
+ expected: FAIL
+
+ [font-size: x-small]
+ expected: FAIL
+
+ [font-size: small]
+ expected: FAIL
+
+ [font-size: medium]
+ expected: FAIL
+
+ [font-size: large]
+ expected: FAIL
+
+ [font-size: x-large]
+ expected: FAIL
+
+ [font-size: xx-large]
+ expected: FAIL
+
+ [font-size: larger]
+ expected: FAIL
+
+ [font-size: smaller]
+ expected: FAIL
+
+ [list-style-type: decimal-leading-zero]
+ expected: FAIL
+
+ [list-style-type: lower-roman]
+ expected: FAIL
+
+ [list-style-type: upper-roman]
+ expected: FAIL
+
+ [list-style-type: lower-latin]
+ expected: FAIL
+
+ [list-style-type: upper-latin]
+ expected: FAIL
+
+ [list-style-type: armenian]
+ expected: FAIL
+
+ [list-style-type: georgian]
+ expected: FAIL
+
+ [orphans: 101]
+ expected: FAIL
+
+ [orphans: inherit]
+ expected: FAIL
+
+ [outline-color: invert]
+ expected: FAIL
+
+ [outline-width: thin]
+ expected: FAIL
+
+ [outline-width: medium]
+ expected: FAIL
+
+ [outline-width: thick]
+ expected: FAIL
+
+ [page-break-after: auto]
+ expected: FAIL
+
+ [page-break-after: always]
+ expected: FAIL
+
+ [page-break-after: avoid]
+ expected: FAIL
+
+ [page-break-after: left]
+ expected: FAIL
+
+ [page-break-after: right]
+ expected: FAIL
+
+ [page-break-after: inherit]
+ expected: FAIL
+
+ [page-break-before: auto]
+ expected: FAIL
+
+ [page-break-before: always]
+ expected: FAIL
+
+ [page-break-before: avoid]
+ expected: FAIL
+
+ [page-break-before: left]
+ expected: FAIL
+
+ [page-break-before: right]
+ expected: FAIL
+
+ [page-break-before: inherit]
+ expected: FAIL
+
+ [page-break-inside: avoid]
+ expected: FAIL
+
+ [page-break-inside: auto]
+ expected: FAIL
+
+ [page-break-inside: inherit]
+ expected: FAIL
+
+ [visibility: collapse]
+ expected: FAIL
+
+ [widows: 101]
+ expected: FAIL
+
+ [widows: inherit]
+ expected: FAIL
+
diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json
index 6a5ba1ed563..86ef8cfc0ff 100644
--- a/tests/wpt/mozilla/meta/MANIFEST.json
+++ b/tests/wpt/mozilla/meta/MANIFEST.json
@@ -22995,11 +22995,11 @@
"support"
],
"css/position_fixed_a.html": [
- "e0cec72521c5ad893c260f7d0f3542d1464161e9",
+ "afbcc31b0460931d7ed8a2fdc1399d2f84fe33d5",
"reftest"
],
"css/position_fixed_b.html": [
- "4a4589634026999bbb40d0cb92c114e7af4ad61a",
+ "251a490233a7836accc5883093a765f88e6006b5",
"support"
],
"css/position_fixed_background_color_a.html": [
@@ -25675,7 +25675,7 @@
"support"
],
"mozilla/interfaces.worker.js": [
- "3fbec39bafa473f0eeb7af3461f38151856bf362",
+ "9b3a3c96ec539bb323a0def92c747996deaa7331",
"testharness"
],
"mozilla/iterable.html": [
@@ -25703,7 +25703,7 @@
"testharness"
],
"mozilla/mime_sniffing_font_context.html": [
- "cd2c1b14ce7b1810f4b75148e0fa9abbfceb780d",
+ "1311e72e0a0dafa6fae594ca1ce2deca164acd36",
"testharness"
],
"mozilla/mozbrowser/crossorigin_xhr.html": [
diff --git a/tests/wpt/mozilla/tests/css/position_fixed_a.html b/tests/wpt/mozilla/tests/css/position_fixed_a.html
index 06fe7687ceb..708fc8bcf8e 100644
--- a/tests/wpt/mozilla/tests/css/position_fixed_a.html
+++ b/tests/wpt/mozilla/tests/css/position_fixed_a.html
@@ -13,6 +13,7 @@
because test reference depends on dynamic sizing, and different
fonts change the required margins. */
font-family: 'Ahem';
+ font-size: 20px;
}
.fixed_block {
background: green;
diff --git a/tests/wpt/mozilla/tests/css/position_fixed_b.html b/tests/wpt/mozilla/tests/css/position_fixed_b.html
index 80c078e2a6f..5d40c68109c 100644
--- a/tests/wpt/mozilla/tests/css/position_fixed_b.html
+++ b/tests/wpt/mozilla/tests/css/position_fixed_b.html
@@ -9,6 +9,7 @@
background: blue;
font-family: 'Ahem';
+ font-size: 20px;
}
div {
position: absolute;
diff --git a/tests/wpt/mozilla/tests/mozilla/interfaces.worker.js b/tests/wpt/mozilla/tests/mozilla/interfaces.worker.js
index 7e889ad0937..780200349de 100644
--- a/tests/wpt/mozilla/tests/mozilla/interfaces.worker.js
+++ b/tests/wpt/mozilla/tests/mozilla/interfaces.worker.js
@@ -37,8 +37,6 @@ test_interfaces([
"ProgressEvent",
"Request",
"Response",
- "Storage",
- "StorageEvent",
"TextDecoder",
"TextEncoder",
"URL",
diff --git a/tests/wpt/mozilla/tests/mozilla/mime_sniffing_font_context.html b/tests/wpt/mozilla/tests/mozilla/mime_sniffing_font_context.html
index 2182b7fcbd8..3d8a4d17059 100644
--- a/tests/wpt/mozilla/tests/mozilla/mime_sniffing_font_context.html
+++ b/tests/wpt/mozilla/tests/mozilla/mime_sniffing_font_context.html
@@ -77,7 +77,6 @@ function checkFontLoaded() {
return;
}
assert_not_equals(first.getBoundingClientRect().width, second.getBoundingClientRect().width);
- assert_not_equals(first.getBoundingClientRect().height, second.getBoundingClientRect().height);
this.done();
}