Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE

Backs out https://github.com/servo/servo/pull/18809
This commit is contained in:
Gecko Backout 2017-10-19 21:26:51 +00:00 committed by moz-servo-sync
parent fe16c1d5c3
commit 11c64178d8
142 changed files with 1635 additions and 1685 deletions

View file

@ -7,7 +7,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use msg::constellation_msg::{Key, KeyModifiers};
#[cfg(target_os = "macos")]
use msg::constellation_msg::{ALT, SUPER};
use msg::constellation_msg::{Key, KeyModifiers, CONTROL};
use script::clipboard_provider::DummyClipboardContext;
use script::test::DOMString;
use script::textinput::{TextInput, TextPoint, Selection, Lines, Direction, SelectionDirection};
@ -428,29 +430,29 @@ fn test_navigation_keyboard_shortcuts() {
let mut textinput = text_input(Lines::Multiple, "hello áéc");
// Test that CMD + Right moves to the end of the current line.
textinput.handle_keydown_aux(None, Key::Right, KeyModifiers::SUPER);
textinput.handle_keydown_aux(None, Key::Right, SUPER);
assert_eq!(textinput.edit_point.index, 11);
// Test that CMD + Right moves to the beginning of the current line.
textinput.handle_keydown_aux(None, Key::Left, KeyModifiers::SUPER);
textinput.handle_keydown_aux(None, Key::Left, SUPER);
assert_eq!(textinput.edit_point.index, 0);
// Test that CTRL + ALT + E moves to the end of the current line also.
textinput.handle_keydown_aux(None, Key::E, KeyModifiers::CONTROL | KeyModifiers::ALT);
textinput.handle_keydown_aux(None, Key::E, CONTROL | ALT);
assert_eq!(textinput.edit_point.index, 11);
// Test that CTRL + ALT + A moves to the beginning of the current line also.
textinput.handle_keydown_aux(None, Key::A, KeyModifiers::CONTROL | KeyModifiers::ALT);
textinput.handle_keydown_aux(None, Key::A, CONTROL | ALT);
assert_eq!(textinput.edit_point.index, 0);
// Test that ALT + Right moves to the end of the word.
textinput.handle_keydown_aux(None, Key::Right, KeyModifiers::ALT);
textinput.handle_keydown_aux(None, Key::Right, ALT);
assert_eq!(textinput.edit_point.index, 5);
// Test that CTRL + ALT + F moves to the end of the word also.
textinput.handle_keydown_aux(None, Key::F, KeyModifiers::CONTROL | KeyModifiers::ALT);
textinput.handle_keydown_aux(None, Key::F, CONTROL | ALT);
assert_eq!(textinput.edit_point.index, 11);
// Test that ALT + Left moves to the end of the word.
textinput.handle_keydown_aux(None, Key::Left, KeyModifiers::ALT);
textinput.handle_keydown_aux(None, Key::Left, ALT);
assert_eq!(textinput.edit_point.index, 6);
// Test that CTRL + ALT + B moves to the end of the word also.
textinput.handle_keydown_aux(None, Key::B, KeyModifiers::CONTROL | KeyModifiers::ALT);
textinput.handle_keydown_aux(None, Key::B, CONTROL | ALT);
assert_eq!(textinput.edit_point.index, 0);
}
@ -509,9 +511,9 @@ fn test_textinput_set_content() {
#[test]
fn test_clipboard_paste() {
#[cfg(target_os = "macos")]
const MODIFIERS: KeyModifiers = KeyModifiers::SUPER;
const MODIFIERS: KeyModifiers = SUPER;
#[cfg(not(target_os = "macos"))]
const MODIFIERS: KeyModifiers = KeyModifiers::CONTROL;
const MODIFIERS: KeyModifiers = CONTROL;
let mut textinput = TextInput::new(Lines::Single,
DOMString::from("defg"),

View file

@ -3,24 +3,26 @@
* 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(),
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,
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,
]
}

View file

@ -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::{ParsingMode, ToCss};
use style_traits::{PARSING_MODE_ALLOW_UNITLESS_LENGTH, 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), ParsingMode::ALLOW_UNITLESS_LENGTH,
Some(CssRuleType::Style), PARSING_MODE_ALLOW_UNITLESS_LENGTH,
QuirksMode::NoQuirks);
let mut input = ParserInput::new("1");
let mut parser = Parser::new(&mut input);

View file

@ -8,7 +8,7 @@ use cssparser::{Parser, ParserInput};
use style::context::QuirksMode;
use style::parser::ParserContext;
use style::stylesheets::{CssRuleType, Origin};
use style_traits::{ParsingMode, ParseError};
use style_traits::{PARSING_MODE_DEFAULT, ParseError};
fn parse<T, F>(f: F, s: &'static str) -> Result<T, ParseError<'static>>
where F: for<'t> Fn(&ParserContext, &mut Parser<'static, 't>) -> Result<T, ParseError<'static>> {
@ -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<T, ParseError<'i>> {
let url = ::servo_url::ServoUrl::parse("http://localhost").unwrap();
let context = ParserContext::new(Origin::Author, &url, Some(CssRuleType::Style),
ParsingMode::DEFAULT,
PARSING_MODE_DEFAULT,
QuirksMode::NoQuirks);
let mut parser = Parser::new(input);
f(&context, &mut parser)

View file

@ -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::ParsingMode;
use style_traits::PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES;
#[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), ParsingMode::ALLOW_ALL_NUMERIC_VALUES,
Some(CssRuleType::Style), PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES,
QuirksMode::NoQuirks);
let mut input = ParserInput::new("-1");
let mut parser = Parser::new(&mut input);

View file

@ -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::{ParsingMode, ParseError};
use style_traits::{PARSING_MODE_DEFAULT, ParseError};
fn parse<T, F>(f: F, s: &'static str) -> Result<T, ParseError<'static>>
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),
ParsingMode::DEFAULT,
PARSING_MODE_DEFAULT,
QuirksMode::NoQuirks);
let reporter = CSSErrorReporterTest;
let error_context = ParserErrorContext { error_reporter: &reporter };

View file

@ -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::{self, ThreadState};
use style::thread_state;
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(ThreadState::SCRIPT);
thread_state::initialize(thread_state::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(ThreadState::SCRIPT);
thread_state::initialize(thread_state::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(ThreadState::SCRIPT);
thread_state::initialize(thread_state::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(ThreadState::SCRIPT);
thread_state::initialize(thread_state::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(ThreadState::SCRIPT);
thread_state::initialize(thread_state::SCRIPT);
let rules_matched = parse_rules(
".foo { width: 200px; } \

View file

@ -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::{self, ThreadState};
use style::thread_state;
/// 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(ThreadState::LAYOUT);
thread_state::initialize(thread_state::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(ThreadState::LAYOUT);
thread_state::initialize(thread_state::LAYOUT);
let stylist = mock_stylist();
stylist.rule_tree();
stylist.rule_tree().root();

View file

@ -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::{ParsingMode, PinchZoomFactor};
use style_traits::{PARSING_MODE_DEFAULT, 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),
ParsingMode::DEFAULT,
PARSING_MODE_DEFAULT,
QuirksMode::NoQuirks);
let error_context = ParserErrorContext { error_reporter: &CSSErrorReporterTest };