aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
Diffstat (limited to 'components/script')
-rw-r--r--components/script/Cargo.toml6
-rw-r--r--components/script/build.rs18
-rw-r--r--components/script/cors.rs44
-rw-r--r--components/script/dom/bindings/error.rs2
-rw-r--r--components/script/dom/bindings/str.rs5
-rw-r--r--components/script/dom/bindings/trace.rs2
-rw-r--r--components/script/dom/domexception.rs2
-rw-r--r--components/script/dom/element.rs6
-rw-r--r--components/script/dom/htmlcollection.rs4
-rw-r--r--components/script/dom/htmlelement.rs2
-rw-r--r--components/script/dom/htmlformelement.rs2
-rw-r--r--components/script/dom/htmlmediaelement.rs2
-rw-r--r--components/script/dom/htmlserializer.rs2
-rw-r--r--components/script/dom/htmltablecellelement.rs2
-rw-r--r--components/script/dom/node.rs7
-rw-r--r--components/script/dom/servohtmlparser.rs5
-rw-r--r--components/script/dom/window.rs6
-rw-r--r--components/script/dom/xmlhttprequest.rs15
-rw-r--r--components/script/layout_interface.rs2
-rw-r--r--components/script/lib.rs5
-rw-r--r--components/script/parse/html.rs7
-rw-r--r--components/script/script_task.rs12
-rw-r--r--components/script/timers.rs2
23 files changed, 91 insertions, 69 deletions
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml
index 8b4d56891be..abe76755878 100644
--- a/components/script/Cargo.toml
+++ b/components/script/Cargo.toml
@@ -3,7 +3,7 @@ name = "script"
version = "0.0.1"
authors = ["The Servo Project Developers"]
-build = "make -f makefile.cargo"
+build = "build.rs"
[lib]
name = "script"
@@ -50,7 +50,7 @@ git = "https://github.com/servo/html5ever"
[dependencies.hyper]
git = "https://github.com/servo/hyper"
-branch = "old_servo_new_cookies"
+branch = "servo"
[dependencies.js]
git = "https://github.com/servo/rust-mozjs"
@@ -68,3 +68,5 @@ git = "https://github.com/servo/string-cache"
encoding = "0.2"
url = "0.2.16"
time = "0.1.12"
+bitflags = "*"
+rustc-serialize = "*"
diff --git a/components/script/build.rs b/components/script/build.rs
new file mode 100644
index 00000000000..ca5ecaf9369
--- /dev/null
+++ b/components/script/build.rs
@@ -0,0 +1,18 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#![feature(io)]
+
+use std::old_io::process::{Command, ProcessExit, StdioContainer};
+
+
+fn main() {
+ let result = Command::new("make")
+ .args(&["-f", "makefile.cargo"])
+ .stdout(StdioContainer::InheritFd(1))
+ .stderr(StdioContainer::InheritFd(2))
+ .status()
+ .unwrap();
+ assert_eq!(result, ProcessExit::ExitStatus(0));
+}
diff --git a/components/script/cors.rs b/components/script/cors.rs
index ebc2af7ec76..e326e891765 100644
--- a/components/script/cors.rs
+++ b/components/script/cors.rs
@@ -10,16 +10,16 @@
//! with CORSRequest being expanded into FetchRequest (etc)
use std::ascii::AsciiExt;
-use std::fmt::{self, Show};
+use std::fmt::{self, Display};
use std::str::from_utf8;
use time;
use time::{now, Timespec};
use hyper::header::{Headers, Header, HeaderFormat, HeaderView};
-use hyper::header::shared::util as header_util;
+use hyper::header::parsing as header_parsing;
use hyper::client::Request;
use hyper::mime::{Mime, TopLevel, SubLevel};
-use hyper::header::common::{ContentType, Host};
+use hyper::header::{ContentType, Host};
use hyper::method::Method;
use hyper::status::StatusClass::Success;
@@ -160,6 +160,7 @@ impl CORSRequest {
}
cors_response.headers = response.headers.clone();
// Substeps 1-3 (parsing rules: http://fetch.spec.whatwg.org/#http-new-header-syntax)
+ let methods_substep4 = [self.method.clone()];
let mut methods = match response.headers.get() {
Some(&AccessControlAllowMethods(ref v)) => v.as_slice(),
_ => return error
@@ -169,7 +170,6 @@ impl CORSRequest {
_ => return error
};
// Substep 4
- let methods_substep4 = [self.method.clone()];
if methods.len() == 0 || preflight.mode == RequestMode::ForcedPreflight {
methods = methods_substep4.as_slice();
}
@@ -388,19 +388,19 @@ struct AccessControlRequestMethod(pub Method);
impl Header for AccessControlRequestMethod {
#[inline]
- fn header_name(_: Option<AccessControlRequestMethod>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Request-Method"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<AccessControlRequestMethod> {
- header_util::from_one_raw_str(raw).map(AccessControlRequestMethod)
+ header_parsing::from_one_raw_str(raw).map(AccessControlRequestMethod)
}
}
impl HeaderFormat for AccessControlRequestMethod {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let AccessControlRequestMethod(ref method) = *self;
- method.fmt(f)
+ <_ as Display>::fmt(method, f)
}
}
@@ -409,19 +409,19 @@ struct AccessControlRequestHeaders(pub Vec<String>);
impl Header for AccessControlRequestHeaders {
#[inline]
- fn header_name(_: Option<AccessControlRequestHeaders>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Request-Headers"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<AccessControlRequestHeaders> {
- header_util::from_comma_delimited(raw).map(AccessControlRequestHeaders)
+ header_parsing::from_comma_delimited(raw).map(AccessControlRequestHeaders)
}
}
impl HeaderFormat for AccessControlRequestHeaders {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let AccessControlRequestHeaders(ref parts) = *self;
- header_util::fmt_comma_delimited(f, parts.as_slice())
+ header_parsing::fmt_comma_delimited(f, parts.as_slice())
}
}
@@ -430,19 +430,19 @@ struct AccessControlAllowMethods(pub Vec<Method>);
impl Header for AccessControlAllowMethods {
#[inline]
- fn header_name(_: Option<AccessControlAllowMethods>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Allow-Methods"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<AccessControlAllowMethods> {
- header_util::from_comma_delimited(raw).map(AccessControlAllowMethods)
+ header_parsing::from_comma_delimited(raw).map(AccessControlAllowMethods)
}
}
impl HeaderFormat for AccessControlAllowMethods {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let AccessControlAllowMethods(ref parts) = *self;
- header_util::fmt_comma_delimited(f, parts.as_slice())
+ header_parsing::fmt_comma_delimited(f, parts.as_slice())
}
}
@@ -451,19 +451,19 @@ struct AccessControlAllowHeaders(pub Vec<String>);
impl Header for AccessControlAllowHeaders {
#[inline]
- fn header_name(_: Option<AccessControlAllowHeaders>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Allow-Headers"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<AccessControlAllowHeaders> {
- header_util::from_comma_delimited(raw).map(AccessControlAllowHeaders)
+ header_parsing::from_comma_delimited(raw).map(AccessControlAllowHeaders)
}
}
impl HeaderFormat for AccessControlAllowHeaders {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let AccessControlAllowHeaders(ref parts) = *self;
- header_util::fmt_comma_delimited(f, parts.as_slice())
+ header_parsing::fmt_comma_delimited(f, parts.as_slice())
}
}
@@ -476,7 +476,7 @@ enum AccessControlAllowOrigin {
impl Header for AccessControlAllowOrigin {
#[inline]
- fn header_name(_: Option<AccessControlAllowOrigin>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Allow-Origin"
}
@@ -498,8 +498,8 @@ impl Header for AccessControlAllowOrigin {
impl HeaderFormat for AccessControlAllowOrigin {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
- AccessControlAllowOrigin::AllowStar => "*".fmt(f),
- AccessControlAllowOrigin::AllowOrigin(ref url) => url.fmt(f)
+ AccessControlAllowOrigin::AllowStar => <_ as Display>::fmt("*", f),
+ AccessControlAllowOrigin::AllowOrigin(ref url) => <_ as Display>::fmt(url, f)
}
}
}
@@ -509,19 +509,19 @@ struct AccessControlMaxAge(pub u32);
impl Header for AccessControlMaxAge {
#[inline]
- fn header_name(_: Option<AccessControlMaxAge>) -> &'static str {
+ fn header_name() -> &'static str {
"Access-Control-Max-Age"
}
fn parse_header(raw: &[Vec<u8>]) -> Option<AccessControlMaxAge> {
- header_util::from_one_raw_str(raw).map(AccessControlMaxAge)
+ header_parsing::from_one_raw_str(raw).map(AccessControlMaxAge)
}
}
impl HeaderFormat for AccessControlMaxAge {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let AccessControlMaxAge(ref num) = *self;
- num.fmt(f)
+ <_ as Display>::fmt(num, f)
}
}
diff --git a/components/script/dom/bindings/error.rs b/components/script/dom/bindings/error.rs
index bed13bcc32d..806e3c21ffe 100644
--- a/components/script/dom/bindings/error.rs
+++ b/components/script/dom/bindings/error.rs
@@ -20,7 +20,7 @@ use std::ffi::CString;
use std::ptr;
/// DOM exceptions that can be thrown by a native DOM method.
-#[derive(Show, Clone)]
+#[derive(Debug, Clone)]
pub enum Error {
/// IndexSizeError
IndexSize,
diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs
index f9ac9947af8..54ad9c45fb3 100644
--- a/components/script/dom/bindings/str.rs
+++ b/components/script/dom/bindings/str.rs
@@ -152,7 +152,8 @@ impl Hash<SipHasher> for ByteString {
}
impl FromStr for ByteString {
- fn from_str(s: &str) -> Option<ByteString> {
- Some(ByteString::new(s.to_owned().into_bytes()))
+ type Err = ();
+ fn from_str(s: &str) -> Result<ByteString, ()> {
+ Ok(ByteString::new(s.to_owned().into_bytes()))
}
}
diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs
index 5737830994d..2dfb35d3f48 100644
--- a/components/script/dom/bindings/trace.rs
+++ b/components/script/dom/bindings/trace.rs
@@ -57,7 +57,7 @@ use std::collections::HashMap;
use std::collections::hash_state::HashState;
use std::ffi::CString;
use std::hash::{Hash, Hasher};
-use std::io::timer::Timer;
+use std::old_io::timer::Timer;
use std::rc::Rc;
use std::sync::mpsc::{Receiver, Sender};
use string_cache::{Atom, Namespace};
diff --git a/components/script/dom/domexception.rs b/components/script/dom/domexception.rs
index 98a17d50d51..f28ea1f9eff 100644
--- a/components/script/dom/domexception.rs
+++ b/components/script/dom/domexception.rs
@@ -14,7 +14,7 @@ use util::str::DOMString;
use std::borrow::ToOwned;
#[repr(uint)]
-#[derive(Copy, Show)]
+#[derive(Copy, Debug)]
#[jstraceable]
pub enum DOMErrorName {
IndexSizeError = DOMExceptionConstants::INDEX_SIZE_ERR as uint,
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 69eb3f2ee23..56e971b8522 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -92,7 +92,7 @@ impl ElementDerived for EventTarget {
}
}
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum ElementTypeId {
HTMLElement(HTMLElementTypeId),
@@ -1404,8 +1404,8 @@ impl<'a> style::node::TElement<'a> for JSRef<'a, Element> {
has_class(self, name)
}
- fn each_class<F>(self, callback: F)
- where F: Fn(&Atom)
+ fn each_class<F>(self, mut callback: F)
+ where F: FnMut(&Atom)
{
match self.get_attribute(ns!(""), &atom!("class")).root() {
None => {}
diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs
index 243c51e3b90..161e72ddc69 100644
--- a/components/script/dom/htmlcollection.rs
+++ b/components/script/dom/htmlcollection.rs
@@ -165,9 +165,7 @@ impl HTMLCollection {
}
fn traverse<'a>(root: JSRef<'a, Node>)
- -> FilterMap<JSRef<'a, Node>,
- JSRef<'a, Element>,
- Skip<TreeIterator<'a>>,
+ -> FilterMap<Skip<TreeIterator<'a>>,
fn(JSRef<Node>) -> Option<JSRef<Element>>> {
root.traverse_preorder()
.skip(1)
diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs
index c5a8249fc14..b2b10ab9377 100644
--- a/components/script/dom/htmlelement.rs
+++ b/components/script/dom/htmlelement.rs
@@ -206,7 +206,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLElement> {
}
}
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum HTMLElementTypeId {
HTMLElement,
diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs
index 04b1c5019c3..230f9411330 100644
--- a/components/script/dom/htmlformelement.rs
+++ b/components/script/dom/htmlformelement.rs
@@ -23,7 +23,7 @@ use dom::htmlbuttonelement::{HTMLButtonElement};
use dom::htmltextareaelement::{HTMLTextAreaElement, HTMLTextAreaElementHelpers};
use dom::node::{Node, NodeHelpers, NodeTypeId, document_from_node, window_from_node};
use hyper::method::Method;
-use hyper::header::common::ContentType;
+use hyper::header::ContentType;
use hyper::mime;
use msg::constellation_msg::LoadData;
use util::str::DOMString;
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs
index 0105d08d226..331d43e8aba 100644
--- a/components/script/dom/htmlmediaelement.rs
+++ b/components/script/dom/htmlmediaelement.rs
@@ -38,7 +38,7 @@ impl HTMLMediaElement {
}
}
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum HTMLMediaElementTypeId {
HTMLAudioElement,
diff --git a/components/script/dom/htmlserializer.rs b/components/script/dom/htmlserializer.rs
index a0ab5b82d03..7d0cc77387c 100644
--- a/components/script/dom/htmlserializer.rs
+++ b/components/script/dom/htmlserializer.rs
@@ -22,7 +22,7 @@ pub fn serialize(iterator: &mut NodeIterator) -> String {
let mut html = String::new();
let mut open_elements: Vec<String> = vec!();
let depth = iterator.depth;
- for node in *iterator {
+ for node in iterator {
while open_elements.len() > depth {
html.push_str("</");
html.push_str(open_elements.pop().unwrap().as_slice());
diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs
index e847ba6afd0..6d9c20626da 100644
--- a/components/script/dom/htmltablecellelement.rs
+++ b/components/script/dom/htmltablecellelement.rs
@@ -16,7 +16,7 @@ use cssparser::RGBA;
use util::str::{self, DOMString, LengthOrPercentageOrAuto};
use std::cell::Cell;
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum HTMLTableCellElementTypeId {
HTMLTableDataCellElement,
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 5bb79e827f0..cdeb7565a8c 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -261,7 +261,7 @@ impl LayoutDataRef {
unsafe impl Send for LayoutDataRef {}
/// The different types of nodes.
-#[derive(Copy, PartialEq, Show)]
+#[derive(Copy, PartialEq, Debug)]
#[jstraceable]
pub enum NodeTypeId {
DocumentType,
@@ -1020,10 +1020,7 @@ impl RawLayoutNodeHelpers for Node {
//
pub type ChildElementIterator<'a> =
- Peekable<JSRef<'a, Element>,
- FilterMap<JSRef<'a, Node>,
- JSRef<'a, Element>,
- NodeChildrenIterator<'a>,
+ Peekable<FilterMap<NodeChildrenIterator<'a>,
fn(JSRef<Node>) -> Option<JSRef<Element>>>>;
pub struct NodeChildrenIterator<'a> {
diff --git a/components/script/dom/servohtmlparser.rs b/components/script/dom/servohtmlparser.rs
index 1a2fd4fe564..c41cdcdd93c 100644
--- a/components/script/dom/servohtmlparser.rs
+++ b/components/script/dom/servohtmlparser.rs
@@ -92,7 +92,8 @@ struct Tracer {
trc: *mut JSTracer,
}
-impl tree_builder::Tracer<JS<Node>> for Tracer {
+impl tree_builder::Tracer for Tracer {
+ type Handle = JS<Node>;
#[allow(unrooted_must_root)]
fn trace_handle(&self, node: JS<Node>) {
node.trace(self.trc);
@@ -107,7 +108,7 @@ impl JSTraceable for ServoHTMLParser {
let tracer = Tracer {
trc: trc,
};
- let tracer = &tracer as &tree_builder::Tracer<JS<Node>>;
+ let tracer = &tracer as &tree_builder::Tracer<Handle=JS<Node>>;
unsafe {
// Assertion: If the parser is mutably borrowed, we're in the
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 1564d77541a..2e599e373a5 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -47,7 +47,7 @@ use js::rust::with_compartment;
use url::{Url, UrlParser};
use libc;
-use rustc_serialize::base64::{FromBase64, ToBase64, STANDARD};
+use serialize::base64::{FromBase64, ToBase64, STANDARD};
use std::cell::{Ref, RefMut};
use std::default::Default;
use std::ffi::CString;
@@ -140,7 +140,7 @@ pub fn base64_btoa(btoa: DOMString) -> Fallible<DOMString> {
// http://www.whatwg.org/html/#atob
pub fn base64_atob(atob: DOMString) -> Fallible<DOMString> {
// "Let input be the string being parsed."
- let mut input = atob.as_slice();
+ let input = atob.as_slice();
// "Remove all space characters from input."
// serialize::base64::from_base64 ignores \r and \n,
@@ -152,7 +152,7 @@ pub fn base64_atob(atob: DOMString) -> Fallible<DOMString> {
let without_spaces = input.chars()
.filter(|&c| ! is_html_space(c))
.collect::<String>();
- input = without_spaces.as_slice();
+ let mut input = without_spaces.as_slice();
// "If the length of input divides by 4 leaving no remainder, then:
// if input ends with one or two U+003D EQUALS SIGN (=) characters,
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs
index f9f75fbbf7e..5bef26a7c84 100644
--- a/components/script/dom/xmlhttprequest.rs
+++ b/components/script/dom/xmlhttprequest.rs
@@ -33,8 +33,7 @@ use encoding::label::encoding_from_whatwg_label;
use encoding::types::{DecoderTrap, Encoding, EncodingRef, EncoderTrap};
use hyper::header::Headers;
-use hyper::header::common::{Accept, ContentLength, ContentType};
-use hyper::header::quality_item::QualityItem;
+use hyper::header::{Accept, ContentLength, ContentType, QualityItem};
use hyper::http::RawStatus;
use hyper::mime::{self, Mime};
use hyper::method::Method;
@@ -55,7 +54,7 @@ use std::borrow::ToOwned;
use std::cell::Cell;
use std::sync::mpsc::{Sender, Receiver, channel};
use std::default::Default;
-use std::io::Timer;
+use std::old_io::Timer;
use std::str::FromStr;
use std::time::duration::Duration;
use time;
@@ -361,8 +360,8 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> {
match upper.as_slice() {
"DELETE" | "GET" | "HEAD" | "OPTIONS" |
"POST" | "PUT" | "CONNECT" | "TRACE" |
- "TRACK" => upper.parse(),
- _ => s.parse()
+ "TRACK" => upper.parse().ok(),
+ _ => s.parse().ok()
}
});
// Step 2
@@ -830,7 +829,7 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
// Substep 2
status.map(|RawStatus(code, reason)| {
self.status.set(code);
- *self.status_text.borrow_mut() = ByteString::new(reason.into_bytes());
+ *self.status_text.borrow_mut() = ByteString::new(reason.into_owned().into_bytes());
});
headers.as_ref().map(|h| *self.response_headers.borrow_mut() = h.clone());
@@ -990,13 +989,13 @@ impl<'a> PrivateXMLHttpRequestHelpers for JSRef<'a, XMLHttpRequest> {
// http://fetch.spec.whatwg.org/#concept-response-header-list
use std::fmt;
use hyper::header::{Header, HeaderFormat};
- use hyper::header::common::SetCookie;
+ use hyper::header::SetCookie;
// a dummy header so we can use headers.remove::<SetCookie2>()
#[derive(Clone)]
struct SetCookie2;
impl Header for SetCookie2 {
- fn header_name(_: Option<SetCookie2>) -> &'static str {
+ fn header_name() -> &'static str {
"set-cookie2"
}
diff --git a/components/script/layout_interface.rs b/components/script/layout_interface.rs
index ff2f643fd63..c82370207cf 100644
--- a/components/script/layout_interface.rs
+++ b/components/script/layout_interface.rs
@@ -77,7 +77,7 @@ pub struct HitTestResponse(pub UntrustedNodeAddress);
pub struct MouseOverResponse(pub Vec<UntrustedNodeAddress>);
/// Why we're doing reflow.
-#[derive(PartialEq, Show)]
+#[derive(PartialEq, Debug)]
pub enum ReflowGoal {
/// We're reflowing in order to send a display list to the screen.
ForDisplay,
diff --git a/components/script/lib.rs b/components/script/lib.rs
index e3cc44e9f49..6cbf6943e75 100644
--- a/components/script/lib.rs
+++ b/components/script/lib.rs
@@ -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 http://mozilla.org/MPL/2.0/. */
-#![feature(unsafe_destructor, plugin, box_syntax, int_uint)]
+#![feature(unsafe_destructor, plugin, box_syntax, int_uint, core)]
#![deny(unsafe_blocks)]
#![allow(non_snake_case)]
@@ -14,6 +14,7 @@
#[macro_use]
extern crate log;
+#[macro_use] extern crate bitflags;
extern crate core;
extern crate devtools_traits;
extern crate cssparser;
@@ -26,7 +27,7 @@ extern crate js;
extern crate libc;
extern crate msg;
extern crate net;
-extern crate "rustc-serialize" as rustc_serialize;
+extern crate "rustc-serialize" as serialize;
extern crate time;
extern crate canvas;
extern crate script_traits;
diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs
index 387d031ff6c..6da3dac1ec8 100644
--- a/components/script/parse/html.rs
+++ b/components/script/parse/html.rs
@@ -55,7 +55,8 @@ impl SinkHelpers for servohtmlparser::Sink {
}
}
-impl<'a> TreeSink<JS<Node>> for servohtmlparser::Sink {
+impl<'a> TreeSink for servohtmlparser::Sink {
+ type Handle = JS<Node>;
fn get_document(&mut self) -> JS<Node> {
let doc = self.document.root();
let node: JSRef<Node> = NodeCast::from_ref(doc.r());
@@ -162,6 +163,10 @@ impl<'a> TreeSink<JS<Node>> for servohtmlparser::Sink {
let script: Option<JSRef<HTMLScriptElement>> = HTMLScriptElementCast::to_ref(node.r());
script.map(|script| script.prepare());
}
+
+ fn reparent_children(&mut self, _node: JS<Node>, _new_parent: JS<Node>) {
+ panic!("unimplemented")
+ }
}
pub fn parse_html(document: JSRef<Document>,
diff --git a/components/script/script_task.rs b/components/script/script_task.rs
index 983ec996794..6a261e5c128 100644
--- a/components/script/script_task.rs
+++ b/components/script/script_task.rs
@@ -71,7 +71,7 @@ use util::task_state;
use geom::point::Point2D;
use hyper::header::{Header, Headers, HeaderFormat};
-use hyper::header::shared::util as header_util;
+use hyper::header::parsing as header_parsing;
use js::jsapi::{JS_SetWrapObjectCallbacks, JS_SetGCZeal, JS_DEFAULT_ZEAL_FREQ, JS_GC};
use js::jsapi::{JSContext, JSRuntime, JSObject};
use js::jsapi::{JS_SetGCParameter, JSGC_MAX_BYTES};
@@ -84,7 +84,7 @@ use libc;
use std::any::Any;
use std::borrow::ToOwned;
use std::cell::Cell;
-use std::fmt::{self, Show};
+use std::fmt::{self, Display};
use std::mem::replace;
use std::num::ToPrimitive;
use std::rc::Rc;
@@ -1363,13 +1363,13 @@ struct LastModified(pub Tm);
impl Header for LastModified {
#[inline]
- fn header_name(_: Option<LastModified>) -> &'static str {
+ fn header_name() -> &'static str {
"Last-Modified"
}
// Parses an RFC 2616 compliant date/time string,
fn parse_header(raw: &[Vec<u8>]) -> Option<LastModified> {
- header_util::from_one_raw_str(raw).and_then(|s: String| {
+ header_parsing::from_one_raw_str(raw).and_then(|s: String| {
let s = s.as_slice();
strptime(s, "%a, %d %b %Y %T %Z").or_else(|_| {
strptime(s, "%A, %d-%b-%y %T %Z")
@@ -1386,8 +1386,8 @@ impl HeaderFormat for LastModified {
fn fmt_header(&self, f: &mut fmt::Formatter) -> fmt::Result {
let LastModified(ref tm) = *self;
match tm.tm_utcoff {
- 0 => tm.rfc822().fmt(f),
- _ => tm.to_utc().rfc822().fmt(f)
+ 0 => <_ as Display>::fmt(&tm.rfc822(), f),
+ _ => <_ as Display>::fmt(&tm.to_utc().rfc822(), f)
}
}
}
diff --git a/components/script/timers.rs b/components/script/timers.rs
index a5e0c5bf312..8f361ebcb7b 100644
--- a/components/script/timers.rs
+++ b/components/script/timers.rs
@@ -24,7 +24,7 @@ use std::collections::HashMap;
use std::sync::mpsc::{channel, Sender};
use std::sync::mpsc::Select;
use std::hash::{Hash, Hasher, Writer};
-use std::io::timer::Timer;
+use std::old_io::timer::Timer;
use std::time::duration::Duration;
#[derive(PartialEq, Eq)]