From 29b4eec14187c96a1518af6a954bd00194375382 Mon Sep 17 00:00:00 2001 From: Bastien Orivel Date: Mon, 30 Oct 2017 12:15:30 +0100 Subject: Bump bitflags to 1.0 in every servo crate --- tests/unit/style/logical_geometry.rs | 26 ++++++++++++-------------- tests/unit/style/parsing/length.rs | 4 ++-- tests/unit/style/parsing/mod.rs | 4 ++-- tests/unit/style/parsing/value.rs | 4 ++-- tests/unit/style/properties/mod.rs | 4 ++-- tests/unit/style/rule_tree/bench.rs | 12 ++++++------ tests/unit/style/stylist.rs | 6 +++--- tests/unit/style/viewport.rs | 4 ++-- 8 files changed, 31 insertions(+), 33 deletions(-) (limited to 'tests/unit/style') diff --git a/tests/unit/style/logical_geometry.rs b/tests/unit/style/logical_geometry.rs index 1001508b8d7..d1681ddd271 100644 --- a/tests/unit/style/logical_geometry.rs +++ b/tests/unit/style/logical_geometry.rs @@ -3,26 +3,24 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use euclid::{Size2D, Point2D, SideOffsets2D, Rect}; -use style::logical_geometry::{FLAG_RTL, FLAG_VERTICAL, FLAG_VERTICAL_LR}; -use style::logical_geometry::{FLAG_SIDEWAYS, FLAG_UPRIGHT}; use style::logical_geometry::{WritingMode, LogicalSize, LogicalPoint, LogicalMargin, LogicalRect}; #[cfg(test)] fn modes() -> [WritingMode; 13] { [ WritingMode::empty(), - FLAG_VERTICAL, - FLAG_VERTICAL | FLAG_VERTICAL_LR, - FLAG_VERTICAL | FLAG_VERTICAL_LR | FLAG_SIDEWAYS, - FLAG_VERTICAL | FLAG_SIDEWAYS, - FLAG_VERTICAL | FLAG_UPRIGHT, - FLAG_RTL, - FLAG_VERTICAL | FLAG_RTL, - FLAG_VERTICAL | FLAG_VERTICAL_LR | FLAG_RTL, - FLAG_VERTICAL | FLAG_VERTICAL_LR | FLAG_SIDEWAYS | FLAG_RTL, - FLAG_VERTICAL | FLAG_VERTICAL_LR | FLAG_UPRIGHT | FLAG_RTL, - FLAG_VERTICAL | FLAG_SIDEWAYS | FLAG_RTL, - FLAG_VERTICAL | FLAG_UPRIGHT | FLAG_RTL, + WritingMode::VERTICAL, + WritingMode::VERTICAL | WritingMode::VERTICAL_LR, + WritingMode::VERTICAL | WritingMode::VERTICAL_LR | WritingMode::SIDEWAYS, + WritingMode::VERTICAL | WritingMode::SIDEWAYS, + WritingMode::VERTICAL | WritingMode::UPRIGHT, + WritingMode::RTL, + WritingMode::VERTICAL | WritingMode::RTL, + WritingMode::VERTICAL | WritingMode::VERTICAL_LR | WritingMode::RTL, + WritingMode::VERTICAL | WritingMode::VERTICAL_LR | WritingMode::SIDEWAYS | WritingMode::RTL, + WritingMode::VERTICAL | WritingMode::VERTICAL_LR | WritingMode::UPRIGHT | WritingMode::RTL, + WritingMode::VERTICAL | WritingMode::SIDEWAYS | WritingMode::RTL, + WritingMode::VERTICAL | WritingMode::UPRIGHT | WritingMode::RTL, ] } diff --git a/tests/unit/style/parsing/length.rs b/tests/unit/style/parsing/length.rs index 6b4da561e49..7b691311ebd 100644 --- a/tests/unit/style/parsing/length.rs +++ b/tests/unit/style/parsing/length.rs @@ -10,7 +10,7 @@ use style::stylesheets::{CssRuleType, Origin}; use style::values::Either; use style::values::specified::{LengthOrPercentageOrNumber, Number}; use style::values::specified::length::{AbsoluteLength, Length, NoCalcLength}; -use style_traits::{PARSING_MODE_ALLOW_UNITLESS_LENGTH, ToCss}; +use style_traits::{ParsingMode, ToCss}; #[test] fn test_calc() { @@ -41,7 +41,7 @@ fn test_parsing_modes() { // In SVG length mode, non-zero lengths are assumed to be px. let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap(); let context = ParserContext::new(Origin::Author, &url, - Some(CssRuleType::Style), PARSING_MODE_ALLOW_UNITLESS_LENGTH, + Some(CssRuleType::Style), ParsingMode::ALLOW_UNITLESS_LENGTH, QuirksMode::NoQuirks); let mut input = ParserInput::new("1"); let mut parser = Parser::new(&mut input); diff --git a/tests/unit/style/parsing/mod.rs b/tests/unit/style/parsing/mod.rs index 3a18935dcdf..1c1dfc3d185 100644 --- a/tests/unit/style/parsing/mod.rs +++ b/tests/unit/style/parsing/mod.rs @@ -8,7 +8,7 @@ use cssparser::{Parser, ParserInput}; use style::context::QuirksMode; use style::parser::ParserContext; use style::stylesheets::{CssRuleType, Origin}; -use style_traits::{PARSING_MODE_DEFAULT, ParseError}; +use style_traits::{ParsingMode, ParseError}; fn parse(f: F, s: &'static str) -> Result> where F: for<'t> Fn(&ParserContext, &mut Parser<'static, 't>) -> Result> { @@ -20,7 +20,7 @@ fn parse_input<'i: 't, 't, T, F>(f: F, input: &'t mut ParserInput<'i>) -> Result where F: Fn(&ParserContext, &mut Parser<'i, 't>) -> Result> { let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap(); let context = ParserContext::new(Origin::Author, &url, Some(CssRuleType::Style), - PARSING_MODE_DEFAULT, + ParsingMode::DEFAULT, QuirksMode::NoQuirks); let mut parser = Parser::new(input); f(&context, &mut parser) diff --git a/tests/unit/style/parsing/value.rs b/tests/unit/style/parsing/value.rs index 5c1f51dcc4c..d464831f56b 100644 --- a/tests/unit/style/parsing/value.rs +++ b/tests/unit/style/parsing/value.rs @@ -7,14 +7,14 @@ use style::context::QuirksMode; use style::parser::ParserContext; use style::stylesheets::{CssRuleType, Origin}; use style::values::specified::Number; -use style_traits::PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES; +use style_traits::ParsingMode; #[test] fn test_parsing_allo_all_numeric_values() { // In SVG length mode, non-zero lengths are assumed to be px. let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap(); let context = ParserContext::new(Origin::Author, &url, - Some(CssRuleType::Style), PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES, + Some(CssRuleType::Style), ParsingMode::ALLOW_ALL_NUMERIC_VALUES, QuirksMode::NoQuirks); let mut input = ParserInput::new("-1"); let mut parser = Parser::new(&mut input); diff --git a/tests/unit/style/properties/mod.rs b/tests/unit/style/properties/mod.rs index 96b8ffdf617..ccd4fdd7a0b 100644 --- a/tests/unit/style/properties/mod.rs +++ b/tests/unit/style/properties/mod.rs @@ -7,7 +7,7 @@ use media_queries::CSSErrorReporterTest; use style::context::QuirksMode; use style::parser::{ParserContext, ParserErrorContext}; use style::stylesheets::{CssRuleType, Origin}; -use style_traits::{PARSING_MODE_DEFAULT, ParseError}; +use style_traits::{ParsingMode, ParseError}; fn parse(f: F, s: &'static str) -> Result> where F: for<'t> Fn(&ParserContext, @@ -25,7 +25,7 @@ fn parse_input<'i: 't, 't, T, F>(f: F, input: &'t mut ParserInput<'i>) -> Result { let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap(); let context = ParserContext::new(Origin::Author, &url, Some(CssRuleType::Style), - PARSING_MODE_DEFAULT, + ParsingMode::DEFAULT, QuirksMode::NoQuirks); let reporter = CSSErrorReporterTest; let error_context = ParserErrorContext { error_reporter: &reporter }; diff --git a/tests/unit/style/rule_tree/bench.rs b/tests/unit/style/rule_tree/bench.rs index 35abf6119fe..b09bc1e5103 100644 --- a/tests/unit/style/rule_tree/bench.rs +++ b/tests/unit/style/rule_tree/bench.rs @@ -13,7 +13,7 @@ use style::properties::{longhands, Importance, PropertyDeclaration, PropertyDecl use style::rule_tree::{CascadeLevel, RuleTree, StrongRuleNode, StyleSource}; use style::shared_lock::SharedRwLock; use style::stylesheets::{Origin, Stylesheet, CssRule}; -use style::thread_state; +use style::thread_state::{self, ThreadState}; use test::{self, Bencher}; struct ErrorringErrorReporter; @@ -89,7 +89,7 @@ fn test_insertion_style_attribute(rule_tree: &RuleTree, rules: &[(StyleSource, C #[bench] fn bench_insertion_basic(b: &mut Bencher) { let r = RuleTree::new(); - thread_state::initialize(thread_state::SCRIPT); + thread_state::initialize(ThreadState::SCRIPT); let rules_matched = parse_rules( ".foo { width: 200px; } \ @@ -108,7 +108,7 @@ fn bench_insertion_basic(b: &mut Bencher) { #[bench] fn bench_insertion_basic_per_element(b: &mut Bencher) { let r = RuleTree::new(); - thread_state::initialize(thread_state::SCRIPT); + thread_state::initialize(ThreadState::SCRIPT); let rules_matched = parse_rules( ".foo { width: 200px; } \ @@ -125,7 +125,7 @@ fn bench_insertion_basic_per_element(b: &mut Bencher) { #[bench] fn bench_expensive_insertion(b: &mut Bencher) { let r = RuleTree::new(); - thread_state::initialize(thread_state::SCRIPT); + thread_state::initialize(ThreadState::SCRIPT); // This test case tests a case where you style a bunch of siblings // matching the same rules, with a different style attribute each @@ -148,7 +148,7 @@ fn bench_expensive_insertion(b: &mut Bencher) { #[bench] fn bench_insertion_basic_parallel(b: &mut Bencher) { let r = RuleTree::new(); - thread_state::initialize(thread_state::SCRIPT); + thread_state::initialize(ThreadState::SCRIPT); let rules_matched = parse_rules( ".foo { width: 200px; } \ @@ -180,7 +180,7 @@ fn bench_insertion_basic_parallel(b: &mut Bencher) { #[bench] fn bench_expensive_insertion_parallel(b: &mut Bencher) { let r = RuleTree::new(); - thread_state::initialize(thread_state::SCRIPT); + thread_state::initialize(ThreadState::SCRIPT); let rules_matched = parse_rules( ".foo { width: 200px; } \ diff --git a/tests/unit/style/stylist.rs b/tests/unit/style/stylist.rs index 33faf7b5210..e41c865cfb5 100644 --- a/tests/unit/style/stylist.rs +++ b/tests/unit/style/stylist.rs @@ -18,7 +18,7 @@ use style::shared_lock::SharedRwLock; use style::stylesheets::StyleRule; use style::stylist::{Stylist, Rule}; use style::stylist::needs_revalidation_for_testing; -use style::thread_state; +use style::thread_state::{self, ThreadState}; /// Helper method to get some Rules from selector strings. /// Each sublist of the result contains the Rules for one StyleRule. @@ -185,7 +185,7 @@ fn mock_stylist() -> Stylist { #[test] fn test_stylist_device_accessors() { - thread_state::initialize(thread_state::LAYOUT); + thread_state::initialize(ThreadState::LAYOUT); let stylist = mock_stylist(); assert_eq!(stylist.device().media_type(), MediaType::screen()); let mut stylist_mut = mock_stylist(); @@ -194,7 +194,7 @@ fn test_stylist_device_accessors() { #[test] fn test_stylist_rule_tree_accessors() { - thread_state::initialize(thread_state::LAYOUT); + thread_state::initialize(ThreadState::LAYOUT); let stylist = mock_stylist(); stylist.rule_tree(); stylist.rule_tree().root(); diff --git a/tests/unit/style/viewport.rs b/tests/unit/style/viewport.rs index b7744be60fc..c84792ffb99 100644 --- a/tests/unit/style/viewport.rs +++ b/tests/unit/style/viewport.rs @@ -18,7 +18,7 @@ use style::stylesheets::viewport_rule::*; use style::values::specified::LengthOrPercentageOrAuto::{self, Auto}; use style::values::specified::NoCalcLength::{self, ViewportPercentage}; use style::values::specified::ViewportPercentageLength::Vw; -use style_traits::{PARSING_MODE_DEFAULT, PinchZoomFactor}; +use style_traits::{ParsingMode, PinchZoomFactor}; use style_traits::viewport::*; macro_rules! stylesheet { @@ -303,7 +303,7 @@ fn multiple_stylesheets_cascading() { fn constrain_viewport() { let url = ServoUrl::parse("http://localhost").unwrap(); let context = ParserContext::new(Origin::Author, &url, Some(CssRuleType::Viewport), - PARSING_MODE_DEFAULT, + ParsingMode::DEFAULT, QuirksMode::NoQuirks); let error_context = ParserErrorContext { error_reporter: &CSSErrorReporterTest }; -- cgit v1.2.3