aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/encoding_support.rs
diff options
context:
space:
mode:
authorXidorn Quan <me@upsuper.org>2017-04-03 21:17:13 +1000
committerXidorn Quan <me@upsuper.org>2017-04-03 21:57:16 +1000
commit37585309e91f8c460c15b5ce82845e1953743833 (patch)
tree508c3afbe1b686a41b183c0f8997a03dcfe41147 /components/style/encoding_support.rs
parenta097a293b5b5caf6013bf28534d7a5d3b96acbf0 (diff)
downloadservo-37585309e91f8c460c15b5ce82845e1953743833.tar.gz
servo-37585309e91f8c460c15b5ce82845e1953743833.zip
Use a UrlExtraData type alias to unify url handling logic.
Diffstat (limited to 'components/style/encoding_support.rs')
-rw-r--r--components/style/encoding_support.rs20
1 files changed, 7 insertions, 13 deletions
diff --git a/components/style/encoding_support.rs b/components/style/encoding_support.rs
index 141291c896e..6712af0387e 100644
--- a/components/style/encoding_support.rs
+++ b/components/style/encoding_support.rs
@@ -9,12 +9,10 @@ extern crate encoding;
use cssparser::{stylesheet_encoding, EncodingSupport};
use error_reporting::ParseErrorReporter;
use media_queries::MediaList;
-use parser::ParserContextExtraData;
use self::encoding::{EncodingRef, DecoderTrap};
-use servo_url::ServoUrl;
use shared_lock::SharedRwLock;
use std::str;
-use stylesheets::{Stylesheet, StylesheetLoader, Origin};
+use stylesheets::{Stylesheet, StylesheetLoader, Origin, UrlExtraData};
struct RustEncoding;
@@ -50,26 +48,24 @@ impl Stylesheet {
/// Takes care of decoding the network bytes and forwards the resulting
/// string to `Stylesheet::from_str`.
pub fn from_bytes(bytes: &[u8],
- base_url: ServoUrl,
+ url_data: UrlExtraData,
protocol_encoding_label: Option<&str>,
environment_encoding: Option<EncodingRef>,
origin: Origin,
media: MediaList,
shared_lock: SharedRwLock,
stylesheet_loader: Option<&StylesheetLoader>,
- error_reporter: &ParseErrorReporter,
- extra_data: ParserContextExtraData)
+ error_reporter: &ParseErrorReporter)
-> Stylesheet {
let (string, _) = decode_stylesheet_bytes(
bytes, protocol_encoding_label, environment_encoding);
Stylesheet::from_str(&string,
- base_url,
+ url_data,
origin,
media,
shared_lock,
stylesheet_loader,
- error_reporter,
- extra_data)
+ error_reporter)
}
/// Updates an empty stylesheet with a set of bytes that reached over the
@@ -79,14 +75,12 @@ impl Stylesheet {
protocol_encoding_label: Option<&str>,
environment_encoding: Option<EncodingRef>,
stylesheet_loader: Option<&StylesheetLoader>,
- error_reporter: &ParseErrorReporter,
- extra_data: ParserContextExtraData) {
+ error_reporter: &ParseErrorReporter) {
let (string, _) = decode_stylesheet_bytes(
bytes, protocol_encoding_label, environment_encoding);
Self::update_from_str(existing,
&string,
stylesheet_loader,
- error_reporter,
- extra_data)
+ error_reporter)
}
}