mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Auto merge of #23838 - servo:url-2.0, r=Manishearth
Update the url crate to 2.0 Blocked on: * [x] https://github.com/housleyjk/ws-rs/pull/283 + undoing corresponding `[patch.crates-io]` entry Soft-blocked on: (we could add to the crate duplication allow-list instead) * [x] ~https://github.com/rust-windowing/winit/pull/1066~ - [x] https://github.com/rust-windowing/winit/pull/1076 * [x] https://github.com/servo/media/pull/288 * [ ] https://github.com/servo/webrender/pull/3720 * [x] https://github.com/gobwas/influent.rs/pull/22 * [ ] https://bugzilla.mozilla.org/show_bug.cgi?id=1568540 - [x] https://github.com/seanmonstar/warp/pull/260 - [ ] https://github.com/abonander/multipart/pull/121 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23838) <!-- Reviewable:end -->
This commit is contained in:
commit
9bba14cb43
26 changed files with 96 additions and 362 deletions
53
Cargo.lock
generated
53
Cargo.lock
generated
|
@ -900,7 +900,7 @@ version = "0.0.1"
|
|||
dependencies = [
|
||||
"crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ws 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ws 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2743,7 +2743,7 @@ dependencies = [
|
|||
"string_cache 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"thin-slice 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"webrender_api 0.60.0 (git+https://github.com/servo/webrender)",
|
||||
"xml5ever 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3084,6 +3084,7 @@ dependencies = [
|
|||
"msg 0.0.1",
|
||||
"net_traits 0.0.1",
|
||||
"openssl 0.10.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pixels 0.0.1",
|
||||
"profile_traits 0.0.1",
|
||||
"rayon 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3099,10 +3100,10 @@ dependencies = [
|
|||
"tokio 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-openssl 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"webrender_api 0.60.0 (git+https://github.com/servo/webrender)",
|
||||
"ws 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ws 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3135,6 +3136,7 @@ dependencies = [
|
|||
"mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"msg 0.0.1",
|
||||
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pixels 0.0.1",
|
||||
"serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_arc 0.1.1",
|
||||
|
@ -3142,7 +3144,7 @@ dependencies = [
|
|||
"servo_url 0.0.1",
|
||||
"std_test_override 0.0.1",
|
||||
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"webrender_api 0.60.0 (git+https://github.com/servo/webrender)",
|
||||
]
|
||||
|
@ -4010,6 +4012,7 @@ dependencies = [
|
|||
"net_traits 0.0.1",
|
||||
"num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -4042,7 +4045,7 @@ dependencies = [
|
|||
"tinyfiledialogs 3.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"typetag 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-segmentation 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"utf-8 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"webdriver 0.40.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -4137,7 +4140,7 @@ dependencies = [
|
|||
"servo_url 0.0.1",
|
||||
"style_traits 0.0.1",
|
||||
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"webdriver 0.40.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"webrender_api 0.60.0 (git+https://github.com/servo/webrender)",
|
||||
"webvr_traits 0.0.1",
|
||||
|
@ -4494,7 +4497,7 @@ dependencies = [
|
|||
"servo_geometry 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
"std_test_override 0.0.1",
|
||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -4559,8 +4562,7 @@ dependencies = [
|
|||
"servo_rand 0.0.1",
|
||||
"to_shmem 0.0.1",
|
||||
"to_shmem_derive 0.0.1",
|
||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
@ -5402,15 +5404,7 @@ dependencies = [
|
|||
"idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "url_serde"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -5596,7 +5590,7 @@ dependencies = [
|
|||
"serde_json 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"servo_config 0.0.1",
|
||||
"servo_url 0.0.1",
|
||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"webdriver 0.40.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -5850,13 +5844,30 @@ dependencies = [
|
|||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mio 0.6.18 (git+https://github.com/servo/mio.git?branch=servo)",
|
||||
"mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"openssl 0.10.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ws"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mio 0.6.18 (git+https://github.com/servo/mio.git?branch=servo)",
|
||||
"mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"openssl 0.10.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "x11"
|
||||
version = "2.17.3"
|
||||
|
@ -6367,7 +6378,6 @@ dependencies = [
|
|||
"checksum unwind-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bd1c4a6d1cfe0072924d1b1d4ca6faa211c95056666979d7ef1bab4cd206057f"
|
||||
"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a"
|
||||
"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61"
|
||||
"checksum url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea"
|
||||
"checksum urlencoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3df3561629a8bb4c57e5a2e4c43348d9e29c7c29d9b1c4c1f47166deca8f37ed"
|
||||
"checksum utf-8 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7"
|
||||
"checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737"
|
||||
|
@ -6402,6 +6412,7 @@ dependencies = [
|
|||
"checksum wio 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5"
|
||||
"checksum wr_malloc_size_of 0.0.1 (git+https://github.com/servo/webrender)" = "<none>"
|
||||
"checksum ws 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ec91ea61b83ce033c43c06c52ddc7532f465c0153281610d44c58b74083aee1a"
|
||||
"checksum ws 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8a6f5bb86663ff4d1639408410f50bf6050367a8525d644d49a6894cd618a631"
|
||||
"checksum x11 2.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e5c4ac579b5d324dc4add02312b5d0e3e0218521e2d5779d526ac39ee4bb171"
|
||||
"checksum x11-clipboard 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d8617c6185c96e5fcf57ff156496d73c9c82b7f09a5fea21b518dd32c10e2e05"
|
||||
"checksum x11-dl 2.18.3 (registry+https://github.com/rust-lang/crates.io-index)" = "940586acb859ea05c53971ac231685799a7ec1dee66ac0bccc0e6ad96e06b4e3"
|
||||
|
|
|
@ -25,7 +25,7 @@ serde_derive = "1.0"
|
|||
serde_json = "1.0"
|
||||
servo_geometry = {path = "../geometry"}
|
||||
servo_url = {path = "../url"}
|
||||
url = "1.2"
|
||||
url = "2.0"
|
||||
servo_config_plugins = { path = "../config_plugins" }
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -14,4 +14,4 @@ crate_type = ["rlib"]
|
|||
[dependencies]
|
||||
crossbeam-channel = "0.3"
|
||||
log = "0.4"
|
||||
ws = "0.8"
|
||||
ws = "0.9"
|
||||
|
|
|
@ -41,7 +41,7 @@ smallvec = "0.6"
|
|||
string_cache = { version = "0.7", optional = true }
|
||||
thin-slice = "0.1.0"
|
||||
time = { version = "0.1.17", optional = true }
|
||||
url = { version = "1.2", optional = true }
|
||||
url = { version = "2.0", optional = true }
|
||||
webrender_api = { git = "https://github.com/servo/webrender", features = ["ipc"], optional = true }
|
||||
xml5ever = { version = "0.14", optional = true }
|
||||
void = "1.0.2"
|
||||
|
|
|
@ -42,6 +42,7 @@ mime_guess = "2.0.0-alpha.6"
|
|||
msg = {path = "../msg"}
|
||||
net_traits = {path = "../net_traits"}
|
||||
openssl = "0.10"
|
||||
percent-encoding = "2.0"
|
||||
pixels = {path = "../pixels"}
|
||||
profile_traits = {path = "../profile_traits"}
|
||||
rayon = "1"
|
||||
|
@ -55,10 +56,10 @@ tokio = "0.1"
|
|||
tokio-timer = "0.2"
|
||||
threadpool = "1.0"
|
||||
time = "0.1.17"
|
||||
url = "1.2"
|
||||
url = "2.0"
|
||||
uuid = {version = "0.7", features = ["v4"]}
|
||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
ws = { version = "0.8", features = ["ssl"] }
|
||||
ws = { version = "0.9", features = ["ssl"] }
|
||||
|
||||
[dev-dependencies]
|
||||
std_test_override = { path = "../std_test_override" }
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
use base64;
|
||||
use mime::Mime;
|
||||
use percent_encoding::percent_decode;
|
||||
use servo_url::ServoUrl;
|
||||
use url::percent_encoding::percent_decode;
|
||||
use url::Position;
|
||||
|
||||
pub enum DecodeError {
|
||||
|
|
|
@ -29,13 +29,14 @@ malloc_size_of_derive = "0.1"
|
|||
mime = "0.3"
|
||||
msg = {path = "../msg"}
|
||||
num-traits = "0.2"
|
||||
percent-encoding = "2.0"
|
||||
pixels = {path = "../pixels"}
|
||||
serde = "1.0"
|
||||
servo_arc = {path = "../servo_arc"}
|
||||
servo_config = {path = "../config"}
|
||||
servo_url = {path = "../url"}
|
||||
time = "0.1"
|
||||
url = "1.2"
|
||||
url = "2.0"
|
||||
uuid = {version = "0.7", features = ["v4", "serde"]}
|
||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
|
||||
|
|
|
@ -14,8 +14,6 @@ extern crate malloc_size_of;
|
|||
extern crate malloc_size_of_derive;
|
||||
#[macro_use]
|
||||
extern crate serde;
|
||||
#[macro_use]
|
||||
extern crate url;
|
||||
|
||||
use crate::filemanager_thread::FileManagerThreadMsg;
|
||||
use crate::request::{Request, RequestBuilder};
|
||||
|
@ -35,7 +33,6 @@ use msg::constellation_msg::HistoryStateId;
|
|||
use servo_url::ServoUrl;
|
||||
use std::error::Error;
|
||||
use time::precise_time_ns;
|
||||
use url::percent_encoding;
|
||||
|
||||
pub mod blob_url_store;
|
||||
pub mod filemanager_thread;
|
||||
|
@ -656,14 +653,29 @@ pub fn trim_http_whitespace(mut slice: &[u8]) -> &[u8] {
|
|||
}
|
||||
|
||||
pub fn http_percent_encode(bytes: &[u8]) -> String {
|
||||
define_encode_set! {
|
||||
// This encode set is used for HTTP header values and is defined at
|
||||
// https://tools.ietf.org/html/rfc5987#section-3.2
|
||||
pub HTTP_VALUE = [percent_encoding::SIMPLE_ENCODE_SET] | {
|
||||
' ', '"', '%', '\'', '(', ')', '*', ',', '/', ':', ';', '<', '-', '>', '?',
|
||||
'[', '\\', ']', '{', '}'
|
||||
}
|
||||
}
|
||||
// This encode set is used for HTTP header values and is defined at
|
||||
// https://tools.ietf.org/html/rfc5987#section-3.2
|
||||
const HTTP_VALUE: &percent_encoding::AsciiSet = &percent_encoding::CONTROLS
|
||||
.add(b' ')
|
||||
.add(b'"')
|
||||
.add(b'%')
|
||||
.add(b'\'')
|
||||
.add(b'(')
|
||||
.add(b')')
|
||||
.add(b'*')
|
||||
.add(b',')
|
||||
.add(b'/')
|
||||
.add(b':')
|
||||
.add(b';')
|
||||
.add(b'<')
|
||||
.add(b'-')
|
||||
.add(b'>')
|
||||
.add(b'?')
|
||||
.add(b'[')
|
||||
.add(b'\\')
|
||||
.add(b']')
|
||||
.add(b'{')
|
||||
.add(b'}');
|
||||
|
||||
url::percent_encoding::percent_encode(bytes, HTTP_VALUE).to_string()
|
||||
percent_encoding::percent_encode(bytes, HTTP_VALUE).to_string()
|
||||
}
|
||||
|
|
|
@ -79,6 +79,7 @@ msg = {path = "../msg"}
|
|||
net_traits = {path = "../net_traits"}
|
||||
num-traits = "0.2"
|
||||
parking_lot = "0.8"
|
||||
percent-encoding = "2.0"
|
||||
phf = "0.7"
|
||||
pixels = {path = "../pixels"}
|
||||
profile_traits = {path = "../profile_traits"}
|
||||
|
@ -107,7 +108,7 @@ tendril = {version = "0.4.1", features = ["encoding_rs"]}
|
|||
time = "0.1.12"
|
||||
typetag = "0.1"
|
||||
unicode-segmentation = "1.1.0"
|
||||
url = "1.6"
|
||||
url = "2.0"
|
||||
utf-8 = "0.7"
|
||||
uuid = {version = "0.7", features = ["v4"]}
|
||||
xml5ever = {version = "0.14"}
|
||||
|
|
|
@ -133,6 +133,7 @@ use net_traits::CookieSource::NonHTTP;
|
|||
use net_traits::CoreResourceMsg::{GetCookiesForUrl, SetCookiesForUrl};
|
||||
use net_traits::{FetchResponseMsg, IpcSend, ReferrerPolicy};
|
||||
use num_traits::ToPrimitive;
|
||||
use percent_encoding::percent_decode;
|
||||
use profile_traits::ipc as profile_ipc;
|
||||
use profile_traits::time::{TimerMetadata, TimerMetadataFrameType, TimerMetadataReflowType};
|
||||
use ref_slice::ref_slice;
|
||||
|
@ -163,7 +164,6 @@ use style::shared_lock::SharedRwLock as StyleSharedRwLock;
|
|||
use style::str::{split_html_space_chars, str_join};
|
||||
use style::stylesheet_set::DocumentStylesheetSet;
|
||||
use style::stylesheets::{Origin, OriginSet, Stylesheet};
|
||||
use url::percent_encoding::percent_decode;
|
||||
use url::Host;
|
||||
use uuid::Uuid;
|
||||
|
||||
|
|
|
@ -63,8 +63,6 @@ use std::borrow::ToOwned;
|
|||
use std::cell::Cell;
|
||||
use style::attr::AttrValue;
|
||||
use style::str::split_html_space_chars;
|
||||
use url::form_urlencoded::Serializer;
|
||||
use url::UrlQuery;
|
||||
|
||||
#[derive(Clone, Copy, JSTraceable, MallocSizeOf, PartialEq)]
|
||||
pub struct GenerationId(u32);
|
||||
|
@ -463,13 +461,12 @@ impl HTMLFormElement {
|
|||
) {
|
||||
let charset = encoding.name();
|
||||
|
||||
self.set_encoding_override(load_data.url.as_mut_url().query_pairs_mut())
|
||||
.clear()
|
||||
.extend_pairs(
|
||||
form_data
|
||||
.into_iter()
|
||||
.map(|field| (field.name.clone(), field.replace_value(charset))),
|
||||
);
|
||||
self.set_url_query_pairs(
|
||||
&mut load_data.url,
|
||||
form_data
|
||||
.iter()
|
||||
.map(|field| (&*field.name, field.replace_value(charset))),
|
||||
);
|
||||
|
||||
self.plan_to_navigate(load_data, target);
|
||||
}
|
||||
|
@ -492,13 +489,12 @@ impl HTMLFormElement {
|
|||
.typed_insert(ContentType::from(mime::APPLICATION_WWW_FORM_URLENCODED));
|
||||
|
||||
let mut url = load_data.url.clone();
|
||||
self.set_encoding_override(url.as_mut_url().query_pairs_mut())
|
||||
.clear()
|
||||
.extend_pairs(
|
||||
form_data
|
||||
.into_iter()
|
||||
.map(|field| (field.name.clone(), field.replace_value(charset))),
|
||||
);
|
||||
self.set_url_query_pairs(
|
||||
&mut url,
|
||||
form_data
|
||||
.iter()
|
||||
.map(|field| (&*field.name, field.replace_value(charset))),
|
||||
);
|
||||
|
||||
url.query().unwrap_or("").to_string().into_bytes()
|
||||
},
|
||||
|
@ -521,13 +517,17 @@ impl HTMLFormElement {
|
|||
self.plan_to_navigate(load_data, target);
|
||||
}
|
||||
|
||||
fn set_encoding_override<'a>(
|
||||
fn set_url_query_pairs<'a>(
|
||||
&self,
|
||||
mut serializer: Serializer<UrlQuery<'a>>,
|
||||
) -> Serializer<UrlQuery<'a>> {
|
||||
url: &mut servo_url::ServoUrl,
|
||||
pairs: impl Iterator<Item = (&'a str, String)>,
|
||||
) {
|
||||
let encoding = self.pick_encoding();
|
||||
serializer.custom_encoding_override(move |s| encoding.encode(s).0);
|
||||
serializer
|
||||
url.as_mut_url()
|
||||
.query_pairs_mut()
|
||||
.encoding_override(Some(&|s| encoding.encode(s).0))
|
||||
.clear()
|
||||
.extend_pairs(pairs);
|
||||
}
|
||||
|
||||
/// [Planned navigation](https://html.spec.whatwg.org/multipage/#planned-navigation)
|
||||
|
|
|
@ -123,6 +123,7 @@ use net_traits::{
|
|||
Metadata, NetworkError, ReferrerPolicy, ResourceFetchTiming, ResourceThreads,
|
||||
ResourceTimingType,
|
||||
};
|
||||
use percent_encoding::percent_decode;
|
||||
use profile_traits::mem::{self as profile_mem, OpaqueSender, ReportsChan};
|
||||
use profile_traits::time::{self as profile_time, profile, ProfilerCategory};
|
||||
use script_layout_interface::message::{self, LayoutThreadInit, Msg, ReflowGoal};
|
||||
|
@ -160,7 +161,6 @@ use std::time::{Duration, SystemTime};
|
|||
use style::dom::OpaqueNode;
|
||||
use style::thread_state::{self, ThreadState};
|
||||
use time::{at_utc, get_time, precise_time_ns, Timespec};
|
||||
use url::percent_encoding::percent_decode;
|
||||
use url::Position;
|
||||
use webrender_api::units::LayoutPixel;
|
||||
use webrender_api::{DocumentId, RenderApiSender};
|
||||
|
|
|
@ -37,7 +37,7 @@ servo_atoms = {path = "../atoms"}
|
|||
servo_url = {path = "../url"}
|
||||
style_traits = {path = "../style_traits", features = ["servo"]}
|
||||
time = "0.1.12"
|
||||
url = "1.2"
|
||||
url = "2.0"
|
||||
webdriver = "0.40"
|
||||
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
|
||||
webvr_traits = {path = "../webvr_traits"}
|
||||
|
|
|
@ -17,6 +17,5 @@ to_shmem = { path = "../to_shmem" }
|
|||
to_shmem_derive = { path = "../to_shmem_derive" }
|
||||
serde = {version = "1.0", features = ["derive"]}
|
||||
servo_rand = {path = "../rand"}
|
||||
url = "1.2"
|
||||
url_serde = {version = "0.2"}
|
||||
url = {version = "2.0", features = ["serde"]}
|
||||
uuid = {version = "0.7", features = ["v4", "serde"]}
|
||||
|
|
|
@ -30,7 +30,7 @@ use url::{Position, Url};
|
|||
|
||||
pub use url::Host;
|
||||
|
||||
#[derive(Clone, Eq, Hash, MallocSizeOf, Ord, PartialEq, PartialOrd)]
|
||||
#[derive(Clone, Deserialize, Eq, Hash, MallocSizeOf, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
pub struct ServoUrl(#[ignore_malloc_size_of = "Arc"] Arc<Url>);
|
||||
|
||||
impl ToShmem for ServoUrl {
|
||||
|
@ -222,21 +222,3 @@ impl From<Url> for ServoUrl {
|
|||
ServoUrl::from_url(url)
|
||||
}
|
||||
}
|
||||
|
||||
impl serde::Serialize for ServoUrl {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: serde::Serializer,
|
||||
{
|
||||
url_serde::serialize(&*self.0, serializer)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'de> serde::Deserialize<'de> for ServoUrl {
|
||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
D: serde::Deserializer<'de>,
|
||||
{
|
||||
url_serde::deserialize(deserializer).map(Self::from_url)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,15 +14,7 @@ pub enum ImmutableOrigin {
|
|||
Opaque(OpaqueOrigin),
|
||||
|
||||
/// Consists of the URL's scheme, host and port
|
||||
Tuple(
|
||||
String,
|
||||
#[serde(
|
||||
deserialize_with = "url_serde::deserialize",
|
||||
serialize_with = "url_serde::serialize"
|
||||
)]
|
||||
Host,
|
||||
u16,
|
||||
),
|
||||
Tuple(String, Host, u16),
|
||||
}
|
||||
|
||||
impl ImmutableOrigin {
|
||||
|
|
|
@ -29,6 +29,6 @@ serde_json = "1"
|
|||
script_traits = {path = "../script_traits"}
|
||||
servo_config = {path = "../config"}
|
||||
servo_url = {path = "../url"}
|
||||
url = "1.2"
|
||||
url = "2.0"
|
||||
uuid = {version = "0.7", features = ["v4"]}
|
||||
webdriver = "0.40"
|
||||
|
|
|
@ -50,6 +50,7 @@ packages = [
|
|||
"scopeguard",
|
||||
"unicase",
|
||||
"url", # https://github.com/servo/servo/pull/23838
|
||||
"ws",
|
||||
]
|
||||
# Files that are ignored for all tidy and lint checks.
|
||||
files = [
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[a-element-origin-xhtml.xhtml]
|
||||
type: testharness
|
||||
[Parsing origin: <https://faß.ExAmPlE/> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[a-element-origin.html]
|
||||
type: testharness
|
||||
[Parsing origin: <https://faß.ExAmPlE/> against <about:blank>]
|
||||
expected: FAIL
|
|
@ -42,9 +42,6 @@
|
|||
[Parsing: <////x/> against <sc://x/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <https://faß.ExAmPlE/> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <file:\\\\//> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -132,15 +129,9 @@
|
|||
[Parsing: <http://foo.bar/baz?qux#foo`bar> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://host/?'> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <sc://ñ> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <https://faß.ExAmPlE/> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <sc://ñ#x> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -42,9 +42,6 @@
|
|||
[Parsing: <////x/> against <sc://x/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <https://faß.ExAmPlE/> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <file:\\\\//> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -132,15 +129,9 @@
|
|||
[Parsing: <http://foo.bar/baz?qux#foo`bar> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://host/?'> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <sc://ñ> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <https://faß.ExAmPlE/> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <sc://ñ#x> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,191 +1,23 @@
|
|||
[toascii.window.html]
|
||||
type: testharness
|
||||
[aa-- (using URL)]
|
||||
expected: FAIL
|
||||
|
||||
[aa-- (using URL.host)]
|
||||
expected: FAIL
|
||||
|
||||
[aa-- (using URL.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[aa-- (using <a>)]
|
||||
expected: FAIL
|
||||
|
||||
[aa-- (using <a>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[aa-- (using <a>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[aa-- (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[a†-- (using URL)]
|
||||
expected: FAIL
|
||||
|
||||
[a†-- (using URL.host)]
|
||||
expected: FAIL
|
||||
|
||||
[a†-- (using URL.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[a†-- (using <a>)]
|
||||
expected: FAIL
|
||||
|
||||
[a†-- (using <a>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[a†-- (using <a>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[a†-- (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[a†-- (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[a†-- (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[-x (using URL)]
|
||||
expected: FAIL
|
||||
|
||||
[-x (using URL.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-x (using URL.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[-x (using <a>)]
|
||||
expected: FAIL
|
||||
|
||||
[-x (using <a>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-x (using <a>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[-x (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[-† (using URL)]
|
||||
expected: FAIL
|
||||
|
||||
[-† (using URL.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-† (using URL.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[-† (using <a>)]
|
||||
expected: FAIL
|
||||
|
||||
[-† (using <a>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-† (using <a>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[-† (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[-† (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-† (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.xn--nxa (using URL)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.xn--nxa (using URL.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.xn--nxa (using URL.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.xn--nxa (using <a>)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.xn--nxa (using <a>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.xn--nxa (using <a>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.xn--nxa (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.β (using URL)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.β (using URL.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.β (using URL.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.β (using <a>)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.β (using <a>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.β (using <a>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.β (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.β (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[-x.β (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.xn--nxa (using URL)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.xn--nxa (using URL.host)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.xn--nxa (using URL.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.xn--nxa (using <a>)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.xn--nxa (using <a>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.xn--nxa (using <a>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.xn--nxa (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.β (using URL)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.β (using URL.host)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.β (using URL.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.β (using <a>)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.β (using <a>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.β (using <a>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.β (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[x-.β (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -291,54 +123,12 @@
|
|||
[xn--a-yoc (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී (using URL)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී (using URL.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී (using URL.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී (using <a>)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී (using <a>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී (using <a>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[ශ්රී (using <area>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای (using URL)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای (using URL.host)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای (using URL.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای (using <a>)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای (using <a>.host)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای (using <a>.hostname)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای (using <area>)]
|
||||
expected: FAIL
|
||||
|
||||
[نامهای (using <area>.host)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -42,9 +42,6 @@
|
|||
[Parsing: <////x/> against <sc://x/>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <https://faß.ExAmPlE/> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <file:\\\\//> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -123,15 +120,9 @@
|
|||
[Parsing: <http://foo.bar/baz?qux#foo`bar> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://host/?'> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <sc://ñ> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <https://faß.ExAmPlE/> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <sc://ñ#x> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
[url-origin.html]
|
||||
type: testharness
|
||||
[Origin parsing: <https://faß.ExAmPlE/> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Origin parsing: <https://faß.ExAmPlE/> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
|
@ -663,12 +663,6 @@
|
|||
[<area>: Setting <sc://x/>.host = 'ß']
|
||||
expected: FAIL
|
||||
|
||||
[URL: Setting <https://x/>.host = 'ß' IDNA Nontransitional_Processing]
|
||||
expected: FAIL
|
||||
|
||||
[<a>: Setting <https://x/>.host = 'ß' IDNA Nontransitional_Processing]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <https://x/>.host = 'ß' IDNA Nontransitional_Processing]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -972,9 +966,6 @@
|
|||
[<area>: Setting <http://example.net>.password = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the userinfo encode set.]
|
||||
expected: FAIL
|
||||
|
||||
[<a>: Setting <https://x/>.host = 'ß' IDNA Nontransitional_Processing]
|
||||
expected: FAIL
|
||||
|
||||
[<a>: Setting <a:/>.hash = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' Simple percent-encoding; nuls, tabs, and newlines are removed]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -1038,9 +1029,6 @@
|
|||
[<area>: Setting <a:/>.hash = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' Simple percent-encoding; nuls, tabs, and newlines are removed]
|
||||
expected: FAIL
|
||||
|
||||
[URL: Setting <https://x/>.host = 'ß' IDNA Nontransitional_Processing]
|
||||
expected: FAIL
|
||||
|
||||
[<area>: Setting <ssh://me@example.net>.protocol = 'http' Can’t switch from non-special scheme to special]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue