mirror of
https://github.com/servo/servo.git
synced 2025-08-13 17:35:36 +01:00
Move DOMString back to script
This entirely removes the 'non-geckolib' feature of the util crate.
This commit is contained in:
parent
7b467ee52d
commit
cdc7bca944
188 changed files with 501 additions and 529 deletions
|
@ -13,8 +13,8 @@ use msg::constellation_msg::CONTROL;
|
|||
use msg::constellation_msg::SUPER;
|
||||
use msg::constellation_msg::{Key, KeyModifiers};
|
||||
use script::clipboard_provider::DummyClipboardContext;
|
||||
use script::dom::bindings::str::DOMString;
|
||||
use script::textinput::{TextInput, TextPoint, Selection, Lines, Direction, SelectionDirection};
|
||||
use util::str::DOMString;
|
||||
|
||||
fn text_input(lines: Lines, s: &str) -> TextInput<DummyClipboardContext> {
|
||||
TextInput::new(lines, DOMString::from(s), DummyClipboardContext::new(""), None, SelectionDirection::None)
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
use app_units::Au;
|
||||
use style::attr::{AttrValue, parse_length};
|
||||
use util::str::{DOMString, LengthOrPercentageOrAuto};
|
||||
use util::str::{LengthOrPercentageOrAuto};
|
||||
|
||||
#[test]
|
||||
fn test_parse_double() {
|
||||
let value = DOMString::from("432.5e2");
|
||||
let value = String::from("432.5e2");
|
||||
match AttrValue::from_double(value, 0.0) {
|
||||
AttrValue::Double(_, num) => assert_eq!(num, 43250f64),
|
||||
_ => panic!("expected a double value")
|
||||
|
@ -17,7 +17,7 @@ fn test_parse_double() {
|
|||
|
||||
#[test]
|
||||
fn test_from_limited_i32_should_be_default_when_less_than_0() {
|
||||
let value = DOMString::from("-1");
|
||||
let value = String::from("-1");
|
||||
match AttrValue::from_limited_i32(value, 0) {
|
||||
AttrValue::Int(_, 0) => (),
|
||||
_ => panic!("expected an IndexSize error")
|
||||
|
@ -26,7 +26,7 @@ fn test_from_limited_i32_should_be_default_when_less_than_0() {
|
|||
|
||||
#[test]
|
||||
fn test_from_limited_i32_should_parse_a_uint_when_value_is_0_or_greater() {
|
||||
match AttrValue::from_limited_i32(DOMString::from("1"), 0) {
|
||||
match AttrValue::from_limited_i32(String::from("1"), 0) {
|
||||
AttrValue::Int(_, 1) => (),
|
||||
_ => panic!("expected an successful parsing")
|
||||
}
|
||||
|
@ -34,9 +34,9 @@ fn test_from_limited_i32_should_parse_a_uint_when_value_is_0_or_greater() {
|
|||
|
||||
#[test]
|
||||
fn test_from_limited_i32_should_keep_parsed_value_when_not_an_int() {
|
||||
match AttrValue::from_limited_i32(DOMString::from("parsed-value"), 0) {
|
||||
match AttrValue::from_limited_i32(String::from("parsed-value"), 0) {
|
||||
AttrValue::Int(p, 0) => {
|
||||
assert_eq!(p, DOMString::from("parsed-value"))
|
||||
assert_eq!(p, String::from("parsed-value"))
|
||||
},
|
||||
_ => panic!("expected an successful parsing")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue