Use encoding-rs instead of rust-encoding for CSS parsing

This commit is contained in:
Simon Sapin 2017-10-31 17:52:31 +01:00
parent a3ac21d23d
commit 3c36a36cc9
6 changed files with 37 additions and 26 deletions

View file

@ -40,6 +40,7 @@ devtools_traits = {path = "../devtools_traits"}
dom_struct = {path = "../dom_struct"}
domobject_derive = {path = "../domobject_derive"}
encoding = "0.2"
encoding_rs = "0.7"
euclid = "0.15"
fnv = "1.0"
gleam = "0.4"

View file

@ -35,6 +35,7 @@ extern crate dom_struct;
#[macro_use]
extern crate domobject_derive;
extern crate encoding;
extern crate encoding_rs;
extern crate euclid;
extern crate fnv;
extern crate gleam;

View file

@ -13,8 +13,7 @@ use dom::eventtarget::EventTarget;
use dom::htmlelement::HTMLElement;
use dom::htmllinkelement::{RequestGenerationId, HTMLLinkElement};
use dom::node::{document_from_node, window_from_node};
use encoding::EncodingRef;
use encoding::all::UTF_8;
use encoding_rs::UTF_8;
use hyper::header::ContentType;
use hyper::mime::{Mime, TopLevel, SubLevel};
use hyper_serde::Serde;
@ -127,7 +126,7 @@ impl FetchResponseListener for StylesheetContext {
let data = if is_css { mem::replace(&mut self.data, vec![]) } else { vec![] };
// TODO: Get the actual value. http://dev.w3.org/csswg/css-syntax/#environment-encoding
let environment_encoding = UTF_8 as EncodingRef;
let environment_encoding = UTF_8;
let protocol_encoding_label = metadata.charset.as_ref().map(|s| &**s);
let final_url = metadata.final_url;