Update rand to 0.7 (fixes #24448)

This commit is contained in:
Anthony Ramine 2019-10-16 14:07:39 +02:00
parent 4f8cfd9b48
commit 785a344e32
42 changed files with 200 additions and 254 deletions

View file

@ -23,8 +23,8 @@ uwp = ["js/uwp"]
vslatestinstalled = ["js/vslatestinstalled"]
[build-dependencies]
phf_codegen = "0.7"
phf_shared = "0.7"
phf_codegen = "0.8"
phf_shared = "0.8"
serde_json = "1.0"
[target.'cfg(target_os = "linux")'.dependencies]
@ -43,7 +43,7 @@ content-security-policy = {version = "0.3.0", features = ["serde"]}
cookie = "0.11"
chrono = "0.4"
crossbeam-channel = "0.3"
cssparser = "0.25"
cssparser = "0.27.1"
deny_public_fields = {path = "../deny_public_fields"}
devtools_traits = {path = "../devtools_traits"}
dom_struct = {path = "../dom_struct"}
@ -54,7 +54,7 @@ enum-iterator = "0.3"
euclid = "0.20"
fnv = "1.0"
headers = "0.2"
html5ever = "0.24"
html5ever = "0.25"
http = "0.1"
hyper = "0.12"
hyper_serde = "0.11"
@ -80,7 +80,7 @@ net_traits = {path = "../net_traits"}
num-traits = "0.2"
parking_lot = "0.9"
percent-encoding = "2.0"
phf = "0.7"
phf = "0.8"
pixels = {path = "../pixels"}
profile_traits = {path = "../profile_traits"}
ref_filter_map = "1.0.1"
@ -109,8 +109,8 @@ time = "0.1.12"
unicode-segmentation = "1.1.0"
url = "2.0"
utf-8 = "0.7"
uuid = {version = "0.7", features = ["v4"]}
xml5ever = {version = "0.15"}
uuid = {version = "0.8", features = ["v4"]}
xml5ever = "0.16"
webdriver = "0.40"
webrender_api = {git = "https://github.com/servo/webrender", features = ["ipc"]}
webvr_traits = {path = "../webvr_traits"}

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use phf_shared;
use phf_shared::{self, FmtConst};
use serde_json::{self, Value};
use std::env;
use std::fmt;
@ -40,18 +40,17 @@ fn main() {
let mut phf = File::create(&phf).unwrap();
write!(
&mut phf,
"pub static MAP: phf::Map<&'static [u8], fn(JSContext, HandleObject)> = "
"pub static MAP: phf::Map<&'static [u8], fn(JSContext, HandleObject)> = {};\n",
map.build(),
)
.unwrap();
map.build(&mut phf).unwrap();
write!(&mut phf, ";\n").unwrap();
}
#[derive(Eq, Hash, PartialEq)]
struct Bytes<'a>(&'a str);
impl<'a> fmt::Debug for Bytes<'a> {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
impl<'a> FmtConst for Bytes<'a> {
fn fmt_const(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
// https://github.com/rust-lang/rust/issues/55223
// should technically be just `write!(formatter, "b\"{}\"", self.0)
// but the referenced issue breaks promotion in the surrounding code

View file

@ -97,7 +97,7 @@ impl TokenSink for PrefetchSink {
_ => return TokenSinkResult::Continue,
};
match (tag.kind, &tag.name) {
(TagKind::StartTag, local_name!("script")) if self.prefetching => {
(TagKind::StartTag, &local_name!("script")) if self.prefetching => {
if let Some(url) = self.get_url(tag, local_name!("src")) {
debug!("Prefetch script {}", url);
let cors_setting = self.get_cors_settings(tag, local_name!("crossorigin"));
@ -120,7 +120,7 @@ impl TokenSink for PrefetchSink {
}
TokenSinkResult::RawData(RawKind::ScriptData)
},
(TagKind::StartTag, local_name!("img")) if self.prefetching => {
(TagKind::StartTag, &local_name!("img")) if self.prefetching => {
if let Some(url) = self.get_url(tag, local_name!("src")) {
debug!("Prefetch {} {}", tag.name, url);
let request = image_fetch_request(
@ -137,7 +137,7 @@ impl TokenSink for PrefetchSink {
}
TokenSinkResult::Continue
},
(TagKind::StartTag, local_name!("link")) if self.prefetching => {
(TagKind::StartTag, &local_name!("link")) if self.prefetching => {
if let Some(rel) = self.get_attr(tag, local_name!("rel")) {
if rel.value.eq_ignore_ascii_case("stylesheet") {
if let Some(url) = self.get_url(tag, local_name!("href")) {
@ -167,15 +167,15 @@ impl TokenSink for PrefetchSink {
}
TokenSinkResult::Continue
},
(TagKind::StartTag, local_name!("script")) => {
(TagKind::StartTag, &local_name!("script")) => {
TokenSinkResult::RawData(RawKind::ScriptData)
},
(TagKind::EndTag, local_name!("script")) => {
(TagKind::EndTag, &local_name!("script")) => {
// After the first script tag, the main parser is blocked, so it's worth prefetching.
self.prefetching = true;
TokenSinkResult::Script(PrefetchHandle)
},
(TagKind::StartTag, local_name!("base")) => {
(TagKind::StartTag, &local_name!("base")) => {
if let Some(url) = self.get_url(tag, local_name!("href")) {
if self.base_url.is_none() {
debug!("Setting base {}", url);