Switch to synchronous script loading

This removes the old code for asyncronously loading scripts during HTML
parsing and then executing them afterward.

Fixes #3356.
This commit is contained in:
Matt Brubeck 2014-10-17 09:48:31 -07:00
parent 65a0d1fe9a
commit fe123ad07c
39 changed files with 284 additions and 1006 deletions

View file

@ -55,7 +55,7 @@ use dom::range::Range;
use dom::treewalker::TreeWalker; use dom::treewalker::TreeWalker;
use dom::uievent::UIEvent; use dom::uievent::UIEvent;
use dom::window::{Window, WindowHelpers}; use dom::window::{Window, WindowHelpers};
use parse::html::build_element_from_tag; use parse::html::{build_element_from_tag, ScriptCreated};
use servo_util::namespace; use servo_util::namespace;
use servo_util::str::{DOMString, split_html_space_chars}; use servo_util::str::{DOMString, split_html_space_chars};
@ -529,7 +529,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
} }
let local_name = local_name.as_slice().to_ascii_lower(); let local_name = local_name.as_slice().to_ascii_lower();
let name = QualName::new(ns!(HTML), Atom::from_slice(local_name.as_slice())); let name = QualName::new(ns!(HTML), Atom::from_slice(local_name.as_slice()));
Ok(build_element_from_tag(name, None, self)) Ok(build_element_from_tag(name, None, self, ScriptCreated))
} }
// http://dom.spec.whatwg.org/#dom-document-createelementns // http://dom.spec.whatwg.org/#dom-document-createelementns
@ -574,7 +574,8 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
if ns == ns!(HTML) { if ns == ns!(HTML) {
let name = QualName::new(ns!(HTML), Atom::from_slice(local_name_from_qname)); let name = QualName::new(ns!(HTML), Atom::from_slice(local_name_from_qname));
Ok(build_element_from_tag(name, prefix_from_qname.map(|s| s.to_string()), self)) Ok(build_element_from_tag(name, prefix_from_qname.map(|s| s.to_string()), self,
ScriptCreated))
} else { } else {
Ok(Element::new(local_name_from_qname.to_string(), ns, Ok(Element::new(local_name_from_qname.to_string(), ns,
prefix_from_qname.map(|s| s.to_string()), self)) prefix_from_qname.map(|s| s.to_string()), self))

View file

@ -2,12 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::Attr;
use dom::attr::AttrHelpers;
use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
use dom::bindings::codegen::Bindings::HTMLScriptElementBinding; use dom::bindings::codegen::Bindings::HTMLScriptElementBinding;
use dom::bindings::codegen::Bindings::HTMLScriptElementBinding::HTMLScriptElementMethods; use dom::bindings::codegen::Bindings::HTMLScriptElementBinding::HTMLScriptElementMethods;
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
use dom::bindings::codegen::InheritTypes::HTMLScriptElementDerived; use dom::bindings::codegen::InheritTypes::HTMLScriptElementDerived;
use dom::bindings::codegen::InheritTypes::{ElementCast, NodeCast}; use dom::bindings::codegen::InheritTypes::{ElementCast, HTMLElementCast, NodeCast};
use dom::bindings::js::{JSRef, Temporary, OptionalRootable}; use dom::bindings::js::{JSRef, Temporary, OptionalRootable};
use dom::bindings::utils::{Reflectable, Reflector}; use dom::bindings::utils::{Reflectable, Reflector};
use dom::document::Document; use dom::document::Document;
@ -15,10 +17,12 @@ use dom::element::{HTMLScriptElementTypeId, Element, AttributeHandlers};
use dom::eventtarget::{EventTarget, NodeTargetTypeId}; use dom::eventtarget::{EventTarget, NodeTargetTypeId};
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{Node, NodeHelpers, ElementNodeTypeId, window_from_node}; use dom::node::{Node, NodeHelpers, ElementNodeTypeId, window_from_node};
use dom::virtualmethods::VirtualMethods;
use dom::window::WindowHelpers; use dom::window::WindowHelpers;
use encoding::all::UTF_8; use encoding::all::UTF_8;
use encoding::types::{Encoding, DecodeReplace}; use encoding::types::{Encoding, DecodeReplace};
use parse::html::{ElementCreator, ParserCreated};
use servo_net::resource_task::load_whole_resource; use servo_net::resource_task::load_whole_resource;
use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec}; use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec};
use std::cell::Cell; use std::cell::Cell;
@ -53,20 +57,20 @@ impl HTMLScriptElementDerived for EventTarget {
impl HTMLScriptElement { impl HTMLScriptElement {
fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>, fn new_inherited(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>,
parser_inserted: bool) -> HTMLScriptElement { creator: ElementCreator) -> HTMLScriptElement {
HTMLScriptElement { HTMLScriptElement {
htmlelement: HTMLElement::new_inherited(HTMLScriptElementTypeId, localName, prefix, document), htmlelement: HTMLElement::new_inherited(HTMLScriptElementTypeId, localName, prefix, document),
already_started: Cell::new(false), already_started: Cell::new(false),
parser_inserted: Cell::new(parser_inserted), parser_inserted: Cell::new(creator == ParserCreated),
non_blocking: Cell::new(!parser_inserted), non_blocking: Cell::new(creator != ParserCreated),
ready_to_be_parser_executed: Cell::new(false), ready_to_be_parser_executed: Cell::new(false),
} }
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>, pub fn new(localName: DOMString, prefix: Option<DOMString>, document: JSRef<Document>,
parser_inserted: bool) -> Temporary<HTMLScriptElement> { creator: ElementCreator) -> Temporary<HTMLScriptElement> {
let element = HTMLScriptElement::new_inherited(localName, prefix, document, parser_inserted); let element = HTMLScriptElement::new_inherited(localName, prefix, document, creator);
Node::reflect_node(box element, document, HTMLScriptElementBinding::Wrap) Node::reflect_node(box element, document, HTMLScriptElementBinding::Wrap)
} }
} }
@ -77,6 +81,9 @@ pub trait HTMLScriptElementHelpers {
/// Prepare a script, steps 6 and 7. /// Prepare a script, steps 6 and 7.
fn is_javascript(self) -> bool; fn is_javascript(self) -> bool;
/// Set the "already started" flag (<https://whatwg.org/html/#already-started>)
fn mark_already_started(self);
} }
/// Supported script types as defined by /// Supported script types as defined by
@ -232,6 +239,50 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
} }
} }
} }
fn mark_already_started(self) {
self.already_started.set(true);
}
}
impl<'a> VirtualMethods for JSRef<'a, HTMLScriptElement> {
fn super_type<'a>(&'a self) -> Option<&'a VirtualMethods> {
let htmlelement: &JSRef<HTMLElement> = HTMLElementCast::from_borrowed_ref(self);
Some(htmlelement as &VirtualMethods)
}
fn after_set_attr(&self, attr: JSRef<Attr>) {
match self.super_type() {
Some(ref s) => s.after_set_attr(attr),
_ => (),
}
let node: JSRef<Node> = NodeCast::from_ref(*self);
if attr.local_name() == &atom!("src") && !self.parser_inserted.get() && node.is_in_doc() {
self.prepare();
}
}
fn child_inserted(&self, child: JSRef<Node>) {
match self.super_type() {
Some(ref s) => s.child_inserted(child),
_ => (),
}
let node: JSRef<Node> = NodeCast::from_ref(*self);
if !self.parser_inserted.get() && node.is_in_doc() {
self.prepare();
}
}
fn bind_to_tree(&self, tree_in_doc: bool) {
match self.super_type() {
Some(ref s) => s.bind_to_tree(tree_in_doc),
_ => ()
}
if tree_in_doc && !self.parser_inserted.get() {
self.prepare();
}
}
} }
impl<'a> HTMLScriptElementMethods for JSRef<'a, HTMLScriptElement> { impl<'a> HTMLScriptElementMethods for JSRef<'a, HTMLScriptElement> {

View file

@ -45,7 +45,7 @@ use dom::text::Text;
use dom::virtualmethods::{VirtualMethods, vtable_for}; use dom::virtualmethods::{VirtualMethods, vtable_for};
use dom::window::Window; use dom::window::Window;
use geom::rect::Rect; use geom::rect::Rect;
use parse::html::build_element_from_tag; use parse::html::{build_element_from_tag, ScriptCreated};
use layout_interface::{ContentBoxResponse, ContentBoxesResponse, LayoutRPC, use layout_interface::{ContentBoxResponse, ContentBoxesResponse, LayoutRPC,
LayoutChan, ReapLayoutDataMsg}; LayoutChan, ReapLayoutDataMsg};
use devtools_traits::NodeInfo; use devtools_traits::NodeInfo;
@ -1521,7 +1521,7 @@ impl Node {
local: element.local_name().clone() local: element.local_name().clone()
}; };
let element = build_element_from_tag(name, let element = build_element_from_tag(name,
Some(element.prefix().as_slice().to_string()), *document); Some(element.prefix().as_slice().to_string()), *document, ScriptCreated);
NodeCast::from_temporary(element) NodeCast::from_temporary(element)
}, },
TextNodeTypeId => { TextNodeTypeId => {

View file

@ -13,7 +13,6 @@ use dom::bindings::js::{JS, JSRef, Temporary};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::node::TrustedNodeAddress; use dom::node::TrustedNodeAddress;
use dom::document::{Document, DocumentHelpers}; use dom::document::{Document, DocumentHelpers};
use parse::html::JSMessage;
use parse::Parser; use parse::Parser;
use servo_util::task_state; use servo_util::task_state;
@ -28,7 +27,6 @@ use html5ever::tree_builder::{TreeBuilder, TreeBuilderOpts};
#[must_root] #[must_root]
#[jstraceable] #[jstraceable]
pub struct Sink { pub struct Sink {
pub js_chan: Sender<JSMessage>,
pub base_url: Option<Url>, pub base_url: Option<Url>,
pub document: JS<Document>, pub document: JS<Document>,
} }
@ -55,11 +53,9 @@ impl Parser for ServoHTMLParser{
impl ServoHTMLParser { impl ServoHTMLParser {
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn new(js_chan: Sender<JSMessage>, base_url: Option<Url>, document: JSRef<Document>) pub fn new(base_url: Option<Url>, document: JSRef<Document>) -> Temporary<ServoHTMLParser> {
-> Temporary<ServoHTMLParser> {
let window = document.window().root(); let window = document.window().root();
let sink = Sink { let sink = Sink {
js_chan: js_chan,
base_url: base_url, base_url: base_url,
document: JS::from_rooted(document), document: JS::from_rooted(document),
}; };

View file

@ -18,6 +18,7 @@ use dom::bindings::codegen::InheritTypes::HTMLLinkElementCast;
use dom::bindings::codegen::InheritTypes::HTMLObjectElementCast; use dom::bindings::codegen::InheritTypes::HTMLObjectElementCast;
use dom::bindings::codegen::InheritTypes::HTMLOptGroupElementCast; use dom::bindings::codegen::InheritTypes::HTMLOptGroupElementCast;
use dom::bindings::codegen::InheritTypes::HTMLOptionElementCast; use dom::bindings::codegen::InheritTypes::HTMLOptionElementCast;
use dom::bindings::codegen::InheritTypes::HTMLScriptElementCast;
use dom::bindings::codegen::InheritTypes::HTMLSelectElementCast; use dom::bindings::codegen::InheritTypes::HTMLSelectElementCast;
use dom::bindings::codegen::InheritTypes::HTMLStyleElementCast; use dom::bindings::codegen::InheritTypes::HTMLStyleElementCast;
use dom::bindings::codegen::InheritTypes::HTMLTableCellElementCast; use dom::bindings::codegen::InheritTypes::HTMLTableCellElementCast;
@ -37,6 +38,7 @@ use dom::element::HTMLLinkElementTypeId;
use dom::element::HTMLObjectElementTypeId; use dom::element::HTMLObjectElementTypeId;
use dom::element::HTMLOptGroupElementTypeId; use dom::element::HTMLOptGroupElementTypeId;
use dom::element::HTMLOptionElementTypeId; use dom::element::HTMLOptionElementTypeId;
use dom::element::HTMLScriptElementTypeId;
use dom::element::HTMLSelectElementTypeId; use dom::element::HTMLSelectElementTypeId;
use dom::element::HTMLStyleElementTypeId; use dom::element::HTMLStyleElementTypeId;
use dom::element::HTMLTableDataCellElementTypeId; use dom::element::HTMLTableDataCellElementTypeId;
@ -56,6 +58,7 @@ use dom::htmllinkelement::HTMLLinkElement;
use dom::htmlobjectelement::HTMLObjectElement; use dom::htmlobjectelement::HTMLObjectElement;
use dom::htmloptgroupelement::HTMLOptGroupElement; use dom::htmloptgroupelement::HTMLOptGroupElement;
use dom::htmloptionelement::HTMLOptionElement; use dom::htmloptionelement::HTMLOptionElement;
use dom::htmlscriptelement::HTMLScriptElement;
use dom::htmlselectelement::HTMLSelectElement; use dom::htmlselectelement::HTMLSelectElement;
use dom::htmlstyleelement::HTMLStyleElement; use dom::htmlstyleelement::HTMLStyleElement;
use dom::htmltablecellelement::HTMLTableCellElement; use dom::htmltablecellelement::HTMLTableCellElement;
@ -189,6 +192,10 @@ pub fn vtable_for<'a>(node: &'a JSRef<'a, Node>) -> &'a VirtualMethods + 'a {
let element: &'a JSRef<'a, HTMLOptionElement> = HTMLOptionElementCast::to_borrowed_ref(node).unwrap(); let element: &'a JSRef<'a, HTMLOptionElement> = HTMLOptionElementCast::to_borrowed_ref(node).unwrap();
element as &'a VirtualMethods + 'a element as &'a VirtualMethods + 'a
} }
ElementNodeTypeId(HTMLScriptElementTypeId) => {
let element: &'a JSRef<'a, HTMLScriptElement> = HTMLScriptElementCast::to_borrowed_ref(node).unwrap();
element as &'a VirtualMethods + 'a
}
ElementNodeTypeId(HTMLSelectElementTypeId) => { ElementNodeTypeId(HTMLSelectElementTypeId) => {
let element: &'a JSRef<'a, HTMLSelectElement> = HTMLSelectElementCast::to_borrowed_ref(node).unwrap(); let element: &'a JSRef<'a, HTMLSelectElement> = HTMLSelectElementCast::to_borrowed_ref(node).unwrap();
element as &'a VirtualMethods + 'a element as &'a VirtualMethods + 'a

View file

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::AttrHelpers; use dom::attr::AttrHelpers;
use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, HTMLScriptElementCast}; use dom::bindings::codegen::InheritTypes::{NodeCast, ElementCast, HTMLScriptElementCast};
use dom::bindings::js::{JS, JSRef, Temporary, OptionalRootable, Root}; use dom::bindings::js::{JS, JSRef, Temporary, OptionalRootable, Root};
@ -23,82 +22,26 @@ use parse::Parser;
use encoding::all::UTF_8; use encoding::all::UTF_8;
use encoding::types::{Encoding, DecodeReplace}; use encoding::types::{Encoding, DecodeReplace};
use servo_net::resource_task::{Load, LoadData, Payload, Done, ResourceTask, load_whole_resource}; use servo_net::resource_task::{Load, LoadData, Payload, Done, ResourceTask};
use servo_msg::constellation_msg::LoadData as MsgLoadData; use servo_msg::constellation_msg::LoadData as MsgLoadData;
use servo_util::task::spawn_named;
use servo_util::task_state; use servo_util::task_state;
use servo_util::task_state::InHTMLParser; use servo_util::task_state::InHTMLParser;
use servo_util::str::DOMString; use servo_util::str::DOMString;
use std::ascii::StrAsciiExt; use std::ascii::StrAsciiExt;
use std::comm::{channel, Sender, Receiver}; use std::comm::channel;
use std::str::MaybeOwned; use std::str::MaybeOwned;
use url::{Url, UrlParser}; use url::Url;
use http::headers::HeaderEnum; use http::headers::HeaderEnum;
use time; use time;
use html5ever::Attribute; use html5ever::Attribute;
use html5ever::tree_builder::{TreeSink, QuirksMode, NodeOrText, AppendNode, AppendText}; use html5ever::tree_builder::{TreeSink, QuirksMode, NodeOrText, AppendNode, AppendText};
use string_cache::QualName; use string_cache::QualName;
pub struct JSFile {
pub data: String,
pub url: Option<Url>,
}
pub type JSResult = Vec<JSFile>;
pub enum HTMLInput { pub enum HTMLInput {
InputString(String), InputString(String),
InputUrl(Url), InputUrl(Url),
} }
pub enum JSMessage {
JSTaskNewFile(Url),
JSTaskNewInlineScript(String, Option<Url>),
JSTaskExit
}
/// Messages generated by the HTML parser upon discovery of additional resources
pub enum HtmlDiscoveryMessage {
HtmlDiscoveredScript(JSResult)
}
pub struct HtmlParserResult {
pub discovery_port: Receiver<HtmlDiscoveryMessage>,
}
fn js_script_listener(to_parent: Sender<HtmlDiscoveryMessage>,
from_parent: Receiver<JSMessage>,
resource_task: ResourceTask) {
let mut result_vec = vec!();
loop {
match from_parent.recv_opt() {
Ok(JSTaskNewFile(url)) => {
match load_whole_resource(&resource_task, url.clone()) {
Err(_) => {
error!("error loading script {:s}", url.serialize());
}
Ok((metadata, bytes)) => {
let decoded = UTF_8.decode(bytes.as_slice(), DecodeReplace).unwrap();
result_vec.push(JSFile {
data: decoded.to_string(),
url: Some(metadata.final_url),
});
}
}
}
Ok(JSTaskNewInlineScript(data, url)) => {
result_vec.push(JSFile { data: data, url: url });
}
Ok(JSTaskExit) | Err(()) => {
break;
}
}
}
assert!(to_parent.send_opt(HtmlDiscoveredScript(result_vec)).is_ok());
}
// Parses an RFC 2616 compliant date/time string, and returns a localized // Parses an RFC 2616 compliant date/time string, and returns a localized
// date/time string in a format suitable for document.lastModified. // date/time string in a format suitable for document.lastModified.
fn parse_last_modified(timestamp: &str) -> String { fn parse_last_modified(timestamp: &str) -> String {
@ -123,9 +66,16 @@ fn parse_last_modified(timestamp: &str) -> String {
} }
} }
#[deriving(PartialEq)]
pub enum ElementCreator {
ParserCreated,
ScriptCreated,
}
pub fn build_element_from_tag(name: QualName, pub fn build_element_from_tag(name: QualName,
prefix: Option<DOMString>, prefix: Option<DOMString>,
document: JSRef<Document>) -> Temporary<Element> { document: JSRef<Document>,
creator: ElementCreator) -> Temporary<Element> {
if name.ns != ns!(HTML) { if name.ns != ns!(HTML) {
return Element::new(name.local.as_slice().to_string(), name.ns, None, document); return Element::new(name.local.as_slice().to_string(), name.ns, None, document);
} }
@ -233,7 +183,7 @@ pub fn build_element_from_tag(name: QualName,
atom!("ruby") => make!(HTMLElement), atom!("ruby") => make!(HTMLElement),
atom!("s") => make!(HTMLElement), atom!("s") => make!(HTMLElement),
atom!("samp") => make!(HTMLElement), atom!("samp") => make!(HTMLElement),
atom!("script") => make!(HTMLScriptElement, true), atom!("script") => make!(HTMLScriptElement, creator),
atom!("section") => make!(HTMLElement), atom!("section") => make!(HTMLElement),
atom!("select") => make!(HTMLSelectElement), atom!("select") => make!(HTMLSelectElement),
atom!("small") => make!(HTMLElement), atom!("small") => make!(HTMLElement),
@ -307,7 +257,7 @@ impl<'a> TreeSink<TrustedNodeAddress> for servohtmlparser::Sink {
fn create_element(&mut self, name: QualName, attrs: Vec<Attribute>) fn create_element(&mut self, name: QualName, attrs: Vec<Attribute>)
-> TrustedNodeAddress { -> TrustedNodeAddress {
let doc = self.document.root(); let doc = self.document.root();
let elem = build_element_from_tag(name, None, *doc).root(); let elem = build_element_from_tag(name, None, *doc, ParserCreated).root();
for attr in attrs.into_iter() { for attr in attrs.into_iter() {
elem.set_attribute_from_parser(attr.name, attr.value, None); elem.set_attribute_from_parser(attr.name, attr.value, None);
@ -378,42 +328,16 @@ impl<'a> TreeSink<TrustedNodeAddress> for servohtmlparser::Sink {
error!("remove_from_parent not implemented!"); error!("remove_from_parent not implemented!");
} }
fn mark_script_already_started(&mut self, _node: TrustedNodeAddress) { fn mark_script_already_started(&mut self, node: TrustedNodeAddress) {
error!("mark_script_already_started not implemented!"); let node: Root<Node> = unsafe { JS::from_trusted_node_address(node).root() };
let script: Option<JSRef<HTMLScriptElement>> = HTMLScriptElementCast::to_ref(*node);
script.map(|script| script.mark_already_started());
} }
fn complete_script(&mut self, node: TrustedNodeAddress) { fn complete_script(&mut self, node: TrustedNodeAddress) {
let node: Root<Node> = unsafe { JS::from_trusted_node_address(node).root() }; let node: Root<Node> = unsafe { JS::from_trusted_node_address(node).root() };
let script: Option<JSRef<HTMLScriptElement>> = let script: Option<JSRef<HTMLScriptElement>> = HTMLScriptElementCast::to_ref(*node);
HTMLScriptElementCast::to_ref(*node); script.map(|script| script.prepare());
let script = match script {
Some(script) if script.is_javascript() => script,
_ => return,
};
let script_element: JSRef<Element> = ElementCast::from_ref(script);
match script_element.get_attribute(ns!(""), &atom!("src")).root() {
Some(src) => {
debug!("found script: {:s}", src.deref().Value());
let mut url_parser = UrlParser::new();
match self.base_url {
None => (),
Some(ref base_url) => {
url_parser.base_url(base_url);
}
};
match url_parser.parse(src.deref().value().as_slice()) {
Ok(new_url) => self.js_chan.send(JSTaskNewFile(new_url)),
Err(e) => debug!("Parsing url {:s} failed: {:?}", src.deref().Value(), e)
};
}
None => {
let scriptnode: JSRef<Node> = NodeCast::from_ref(script);
let data = Node::collect_text_contents(scriptnode.children());
debug!("script data = {:?}", data);
self.js_chan.send(JSTaskNewInlineScript(data, self.base_url.clone()));
}
}
} }
} }
@ -422,17 +346,7 @@ pub fn parse_html(page: &Page,
document: JSRef<Document>, document: JSRef<Document>,
input: HTMLInput, input: HTMLInput,
resource_task: ResourceTask, resource_task: ResourceTask,
msg_load_data: Option<MsgLoadData>) msg_load_data: Option<MsgLoadData>) {
-> HtmlParserResult {
// Spawn a JS parser to receive JavaScript.
let (discovery_chan, discovery_port) = channel();
let resource_task2 = resource_task.clone();
let js_result_chan = discovery_chan.clone();
let (js_chan, js_msg_port) = channel();
spawn_named("parse_html:js", proc() {
js_script_listener(js_result_chan, js_msg_port, resource_task2.clone());
});
let (base_url, load_response) = match input { let (base_url, load_response) = match input {
InputUrl(ref url) => { InputUrl(ref url) => {
// Wait for the LoadResponse so that the parser knows the final URL. // Wait for the LoadResponse so that the parser knows the final URL.
@ -480,7 +394,7 @@ pub fn parse_html(page: &Page,
}, },
}; };
let parser = ServoHTMLParser::new(js_chan.clone(), base_url.clone(), document).root(); let parser = ServoHTMLParser::new(base_url.clone(), document).root();
let parser: JSRef<ServoHTMLParser> = *parser; let parser: JSRef<ServoHTMLParser> = *parser;
task_state::enter(InHTMLParser); task_state::enter(InHTMLParser);
@ -520,9 +434,4 @@ pub fn parse_html(page: &Page,
task_state::exit(InHTMLParser); task_state::exit(InHTMLParser);
debug!("finished parsing"); debug!("finished parsing");
js_chan.send(JSTaskExit);
HtmlParserResult {
discovery_port: discovery_port,
}
} }

View file

@ -16,7 +16,6 @@ use dom::bindings::conversions::{FromJSValConvertible, Empty};
use dom::bindings::global; use dom::bindings::global;
use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalRootable}; use dom::bindings::js::{JS, JSRef, RootCollection, Temporary, OptionalRootable};
use dom::bindings::trace::JSTraceable; use dom::bindings::trace::JSTraceable;
use dom::bindings::utils::Reflectable;
use dom::bindings::utils::{wrap_for_same_compartment, pre_wrap}; use dom::bindings::utils::{wrap_for_same_compartment, pre_wrap};
use dom::document::{Document, HTMLDocument, DocumentHelpers, FromParser}; use dom::document::{Document, HTMLDocument, DocumentHelpers, FromParser};
use dom::element::{Element, HTMLButtonElementTypeId, HTMLInputElementTypeId}; use dom::element::{Element, HTMLButtonElementTypeId, HTMLInputElementTypeId};
@ -29,7 +28,7 @@ use dom::node::{ElementNodeTypeId, Node, NodeHelpers};
use dom::window::{Window, WindowHelpers}; use dom::window::{Window, WindowHelpers};
use dom::worker::{Worker, TrustedWorkerAddress}; use dom::worker::{Worker, TrustedWorkerAddress};
use dom::xmlhttprequest::{TrustedXHRAddress, XMLHttpRequest, XHRProgress}; use dom::xmlhttprequest::{TrustedXHRAddress, XMLHttpRequest, XHRProgress};
use parse::html::{InputString, InputUrl, HtmlParserResult, HtmlDiscoveredScript, parse_html}; use parse::html::{InputString, InputUrl, parse_html};
use layout_interface::{ScriptLayoutChan, LayoutChan, ReflowForDisplay}; use layout_interface::{ScriptLayoutChan, LayoutChan, ReflowForDisplay};
use layout_interface; use layout_interface;
use page::{Page, IterablePage, Frame}; use page::{Page, IterablePage, Frame};
@ -62,7 +61,6 @@ use js::jsapi::{JSContext, JSRuntime, JSTracer};
use js::jsapi::{JS_SetGCParameter, JSGC_MAX_BYTES}; use js::jsapi::{JS_SetGCParameter, JSGC_MAX_BYTES};
use js::jsapi::{JS_SetGCCallback, JSGCStatus, JSGC_BEGIN, JSGC_END}; use js::jsapi::{JS_SetGCCallback, JSGCStatus, JSGC_BEGIN, JSGC_END};
use js::rust::{Cx, RtUtils}; use js::rust::{Cx, RtUtils};
use js::rust::with_compartment;
use js; use js;
use url::Url; use url::Url;
@ -797,13 +795,6 @@ impl ScriptTask {
InputString(strval.unwrap_or("".to_string())) InputString(strval.unwrap_or("".to_string()))
}; };
// Parse HTML.
//
// Note: We can parse the next document in parallel with any previous documents.
let HtmlParserResult { discovery_port }
= parse_html(&*page, *document, parser_input, self.resource_task.clone(),
Some(load_data));
{ {
// Create the root frame. // Create the root frame.
let mut frame = page.mut_frame(); let mut frame = page.mut_frame();
@ -813,18 +804,9 @@ impl ScriptTask {
}); });
} }
document.set_ready_state(DocumentReadyStateValues::Interactive); parse_html(&*page, *document, parser_input, self.resource_task.clone(), Some(load_data));
let mut js_scripts = None; document.set_ready_state(DocumentReadyStateValues::Interactive);
loop {
match discovery_port.recv_opt() {
Ok(HtmlDiscoveredScript(scripts)) => {
assert!(js_scripts.is_none());
js_scripts = Some(scripts);
}
Err(()) => break
}
}
// Kick off the initial reflow of the page. // Kick off the initial reflow of the page.
debug!("kicking off initial reflow of {}", url); debug!("kicking off initial reflow of {}", url);
@ -841,31 +823,6 @@ impl ScriptTask {
*page_url = Some((url.clone(), false)); *page_url = Some((url.clone(), false));
} }
// Receive the JavaScript scripts.
assert!(js_scripts.is_some());
let js_scripts = js_scripts.take().unwrap();
debug!("js_scripts: {:?}", js_scripts);
with_compartment((**cx).ptr, window.reflector().get_jsobject(), || {
// Evaluate every script in the document.
for file in js_scripts.iter() {
let global_obj = window.reflector().get_jsobject();
let filename = match file.url {
None => String::new(),
Some(ref url) => url.serialize(),
};
//FIXME: this should have some kind of error handling, or explicitly
// drop an exception on the floor.
match cx.evaluate_script(global_obj, file.data.clone(), filename, 1) {
Ok(_) => (),
Err(_) => println!("evaluate_script failed")
}
window.flush_layout(ReflowForDisplay);
}
});
// https://html.spec.whatwg.org/multipage/#the-end step 4 // https://html.spec.whatwg.org/multipage/#the-end step 4
let event = Event::new(&global::Window(*window), "DOMContentLoaded".to_string(), let event = Event::new(&global::Window(*window), "DOMContentLoaded".to_string(),
DoesNotBubble, NotCancelable).root(); DoesNotBubble, NotCancelable).root();

View file

@ -5,6 +5,64 @@
page </title> page </title>
<base href="./"></base> <base href="./"></base>
<script src="harness.js"></script> <script src="harness.js"></script>
</head>
<body>
<div id="first" name="test">fffff<br><br><br><br>fffffffffffffffff</div>
<div id="second">ggg</div>
<span id="third" name="test">hhhhhhhh</span>
<div id="fourth">iiiiiiiiiiiiiiiiiii</div>
<a href="http://www.mozilla.org"></a>
<img src="test.jpg"/>
<embed></embed>
<form>
<fieldset>
<legend>legend</legend>
<label for="">label<input type="text" value="input" /></label>
</fieldset>
</form>
<hr />
<canvas/>
<p>pppppppppp</p>
<q>qqqqqqqqqqqqqqqqqqqqqqqqqqq</q>
<progress max="100" value="80">80%</progress>
<applet></applet>
<input type="text" value="input"/>
<iframe></iframe>
<ol type="1">
<li>li</li>
</ol>
<table>
<caption>sample table</caption>
<colgroup>
<col/>
</colgroup>
<tbody>
<tr><th>head</th></tr>
<tr><td>data</td></tr>
</tbody>
</table>
<section>section</section>
<aside>aside</aside>
<b>b</b>
<i>i</i>
<small>small</small>
<textarea>textarea</textarea>
<time datetime="2014-02-14">Valentines day</time>
<area></area>
<data></data>
<template></template>
<pre>pre</pre>
<audio>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
</audio>
<video src="">
<track></track>
</video>
<foo-á>hi</foo-á>
<script> <script>
function check_collection(obj, num, classes, name) { function check_collection(obj, num, classes, name) {
is_a(obj, HTMLCollection); is_a(obj, HTMLCollection);
@ -81,63 +139,5 @@ check_tag("foo-á", 1, [HTMLUnknownElement], "FOO-á");
finish(); finish();
</script> </script>
</head>
<body>
<div id="first" name="test">fffff<br><br><br><br>fffffffffffffffff</div>
<div id="second">ggg</div>
<span id="third" name="test">hhhhhhhh</span>
<div id="fourth">iiiiiiiiiiiiiiiiiii</div>
<a href="http://www.mozilla.org"></a>
<img src="test.jpg"/>
<embed></embed>
<form>
<fieldset>
<legend>legend</legend>
<label for="">label<input type="text" value="input" /></label>
</fieldset>
</form>
<hr />
<canvas/>
<p>pppppppppp</p>
<q>qqqqqqqqqqqqqqqqqqqqqqqqqqq</q>
<progress max="100" value="80">80%</progress>
<applet></applet>
<input type="text" value="input"/>
<iframe></iframe>
<ol type="1">
<li>li</li>
</ol>
<table>
<caption>sample table</caption>
<colgroup>
<col/>
</colgroup>
<tbody>
<tr><th>head</th></tr>
<tr><td>data</td></tr>
</tbody>
</table>
<section>section</section>
<aside>aside</aside>
<b>b</b>
<i>i</i>
<small>small</small>
<textarea>textarea</textarea>
<time datetime="2014-02-14">Valentines day</time>
<area></area>
<data></data>
<template></template>
<pre>pre</pre>
<audio>
<source src="horse.ogg" type="audio/ogg">
<source src="horse.mp3" type="audio/mpeg">
</audio>
<video src="">
<track></track>
</video>
<foo-á>hi</foo-á>
</body> </body>
</html> </html>

View file

@ -2,6 +2,9 @@
<html> <html>
<head> <head>
<script src="harness.js"></script> <script src="harness.js"></script>
</head>
<body>
<div id="foo"><div id="bar"></div></div>
<script> <script>
let foo = document.getElementById("foo"); let foo = document.getElementById("foo");
let doc = document.implementation.createHTMLDocument("title"); let doc = document.implementation.createHTMLDocument("title");
@ -18,8 +21,5 @@
finish(); finish();
</script> </script>
</head>
<body>
<div id="foo"><div id="bar"></div></div>
</body> </body>
</html> </html>

View file

@ -2,6 +2,8 @@
<html> <html>
<head> <head>
<script src="harness.js"></script> <script src="harness.js"></script>
</head>
<body>
<script> <script>
var links = document.links; var links = document.links;
is(links, document.links); is(links, document.links);
@ -33,5 +35,5 @@
finish(); finish();
</script> </script>
</head> </body>
</html> </html>

View file

@ -2,14 +2,13 @@
<head> <head>
<script src="harness.js"></script> <script src="harness.js"></script>
</head> </head>
<!-- gNumChanges should be 2 once synchronous script execution is supported --> <body onload="is(document.readyState, 'complete'); is(gNumChanges, 2); finish()">
<body onload="is(document.readyState, 'complete'); is(gNumChanges, 1); finish()">
<script> <script>
gNumChanges = 0; gNumChanges = 0;
document.addEventListener('readystatechange', function() { document.addEventListener('readystatechange', function() {
gNumChanges++; gNumChanges++;
}, true); }, true);
is(document.readyState, "interactive"); is(document.readyState, "loading");
</script> </script>
</body> </body>
</html> </html>

View file

@ -2,6 +2,10 @@
<html> <html>
<head> <head>
<script src="harness.js"></script> <script src="harness.js"></script>
</head>
<body>
<div id="foo-1" class="foo"></div>
<div id="foo-2" class="baz"></div>
<script> <script>
let foo1 = document.getElementById("foo-1"); let foo1 = document.getElementById("foo-1");
let foo2 = document.getElementById("foo-2"); let foo2 = document.getElementById("foo-2");
@ -30,9 +34,5 @@
finish(); finish();
</script> </script>
</head>
<body>
<div id="foo-1" class="foo"></div>
<div id="foo-2" class="baz"></div>
</body> </body>
</html> </html>

View file

@ -3,6 +3,54 @@
<head> <head>
<title>Tests for :enabled and :disabled selectors</title> <title>Tests for :enabled and :disabled selectors</title>
<script src="harness.js"></script> <script src="harness.js"></script>
</head>
<body>
<button id="button-1"></button>
<button id="button-2" disabled></button>
<input id="input-1"></input>
<input id="input-2" disabled></input>
<option id="option-1"></option>
<option id="option-2" disabled></option>
<select id="select-1"></select>
<select id="select-2" disabled></select>
<textarea id="textarea-1"></textarea>
<textarea id="textarea-2" disabled></textarea>
<optgroup disabled>
<option id="option-3"></option>
</optgroup>
<fieldset disabled>
<fieldset>
<button id="button-3"></button>
<input id="input-3"></input>
<select id="select-3"></select>
<textarea id="textarea-3"></textarea>
</fieldset>
</fieldset>
<fieldset disabled>
<legend>
<button id="button-4"></button>
<input id="input-4"></input>
<select id="select-4"></select>
<textarea id="textarea-4"></textarea>
</legend>
</fieldset>
<fieldset disabled>
<legend></legend>
<legend>
<button id="button-5"></button>
<input id="input-5"></input>
<select id="select-5"></select>
<textarea id="textarea-5"></textarea>
</legend>
</fieldset>
<script> <script>
{ // Simple initialization checks. { // Simple initialization checks.
var list, i, elem; var list, i, elem;
@ -127,53 +175,5 @@
finish(); finish();
</script> </script>
</head>
<body>
<button id="button-1"></button>
<button id="button-2" disabled></button>
<input id="input-1"></input>
<input id="input-2" disabled></input>
<option id="option-1"></option>
<option id="option-2" disabled></option>
<select id="select-1"></select>
<select id="select-2" disabled></select>
<textarea id="textarea-1"></textarea>
<textarea id="textarea-2" disabled></textarea>
<optgroup disabled>
<option id="option-3"></option>
</optgroup>
<fieldset disabled>
<fieldset>
<button id="button-3"></button>
<input id="input-3"></input>
<select id="select-3"></select>
<textarea id="textarea-3"></textarea>
</fieldset>
</fieldset>
<fieldset disabled>
<legend>
<button id="button-4"></button>
<input id="input-4"></input>
<select id="select-4"></select>
<textarea id="textarea-4"></textarea>
</legend>
</fieldset>
<fieldset disabled>
<legend></legend>
<legend>
<button id="button-5"></button>
<input id="input-5"></input>
<select id="select-5"></select>
<textarea id="textarea-5"></textarea>
</legend>
</fieldset>
</body> </body>
</html> </html>

View file

@ -1,25 +1,6 @@
<html> <html>
<head> <head>
<script src="harness.js"></script> <script src="harness.js"></script>
<script>
is_function(DOMRect, "DOMRect");
var elems = document.getElementsByTagName('div');
var rect = elems[0].getBoundingClientRect();
is_a(rect, DOMRect);
geq(rect.top, 100);
geq(rect.bottom, 200);
geq(rect.left, 100);
geq(rect.right, 200);
is(rect.width, 100);
is(rect.height, 100);
is(rect.width, rect.right - rect.left);
is(rect.height, rect.bottom - rect.top);
finish();
</script>
<style> <style>
div { div {
margin-top: 100px; margin-top: 100px;
@ -31,5 +12,24 @@ div {
</head> </head>
<body> <body>
<div>my div</div> <div>my div</div>
<script>
is_function(DOMRect, "DOMRect");
var elems = document.getElementsByTagName('div');
var rect = elems[0].getBoundingClientRect();
is_a(rect, DOMRect);
geq(rect.top, 100);
geq(rect.bottom, 200);
geq(rect.left, 100);
geq(rect.right, 200);
is(rect.width, 100);
is(rect.height, 100);
is(rect.width, rect.right - rect.left);
is(rect.height, rect.bottom - rect.top);
finish();
</script>
</body> </body>
</html> </html>

View file

@ -2,6 +2,17 @@
<html> <html>
<head> <head>
<script src="harness.js"></script> <script src="harness.js"></script>
</head>
<body>
<div id="foo-1" class="foo"></div>
<div id="foo-2" class="foo"></div>
<div id="bar" class="bar"></div>
<div id="live" class="live"></div>
<div id="class-example">
<p id="p1" class="aaa bbb"/>
<p id="p2" class="aaa ccc"/>
<p id="p3" class="bbb ccc"/>
</div>
<script> <script>
let foo1 = document.getElementById("foo-1"); let foo1 = document.getElementById("foo-1");
let foo2 = document.getElementById("foo-2"); let foo2 = document.getElementById("foo-2");
@ -104,16 +115,5 @@
finish(); finish();
</script> </script>
</head>
<body>
<div id="foo-1" class="foo"></div>
<div id="foo-2" class="foo"></div>
<div id="bar" class="bar"></div>
<div id="live" class="live"></div>
<div id="class-example">
<p id="p1" class="aaa bbb"/>
<p id="p2" class="aaa ccc"/>
<p id="p3" class="bbb ccc"/>
</div>
</body> </body>
</html> </html>

View file

@ -2,11 +2,6 @@
<html> <html>
<head> <head>
<script src="harness.js"></script> <script src="harness.js"></script>
<script>
is(document.getElementsByClassName("foo").length, 6);
is_not(document.getElementById("bar").className, "ggg foo");
finish();
</script>
</head> </head>
<body> <body>
<!-- \u0020 Space --> <!-- \u0020 Space -->
@ -23,5 +18,10 @@
<div id="foo-6" class="fff foo"></div> <div id="foo-6" class="fff foo"></div>
<!-- Non-HTML space character --> <!-- Non-HTML space character -->
<div id="bar" class="ggg&#11;foo"></div> <div id="bar" class="ggg&#11;foo"></div>
<script>
is(document.getElementsByClassName("foo").length, 6);
is_not(document.getElementById("bar").className, "ggg foo");
finish();
</script>
</body> </body>
</html> </html>

View file

@ -2,6 +2,12 @@
<html> <html>
<head> <head>
<script src="harness.js"></script> <script src="harness.js"></script>
</head>
<body>
<div id="foo"></div>
<div id="foo\bar"></div>
<div id="foo:bar"></div>
<div id="bar" class="myClass"></p>
<script> <script>
{ // document.querySelector { // document.querySelector
let div = document.getElementById("foo"); let div = document.getElementById("foo");
@ -60,11 +66,5 @@
} }
finish(); finish();
</script> </script>
</head>
<body>
<div id="foo"></div>
<div id="foo\bar"></div>
<div id="foo:bar"></div>
<div id="bar" class="myClass"></p>
</body> </body>
</html> </html>

View file

@ -2,6 +2,13 @@
<html> <html>
<head> <head>
<script src="harness.js"></script> <script src="harness.js"></script>
</head>
<body>
<div id="parent">
<div id="foo" class="test"></div>
<div id="bar" class="test"></div>
<div id="baz" class="test"></div>
</div>
<script> <script>
let foo = document.getElementById("foo"); let foo = document.getElementById("foo");
let bar = document.getElementById("bar"); let bar = document.getElementById("bar");
@ -48,12 +55,5 @@
finish(); finish();
</script> </script>
</head>
<body>
<div id="parent">
<div id="foo" class="test"></div>
<div id="bar" class="test"></div>
<div id="baz" class="test"></div>
</div>
</body> </body>
</html> </html>

View file

@ -3,22 +3,24 @@
<meta charset="utf-8"> <meta charset="utf-8">
<script src="harness.js"></script> <script src="harness.js"></script>
</head> </head>
<body> <body onload="test()">
<foo-á>foo</foo-á> <foo-á>foo</foo-á>
<script> <script>
is_a(window.document, Node); function test() {
gc(); // ensure that our document rooting works; subsequent accesses should be valid. is_a(window.document, Node);
is_a(window.document, Node); gc(); // ensure that our document rooting works; subsequent accesses should be valid.
is(window.document.nodeType, Node.DOCUMENT_NODE); is_a(window.document, Node);
is_a(window.document.documentElement, Node); is(window.document.nodeType, Node.DOCUMENT_NODE);
is_a(window.document.documentElement, Element); is_a(window.document.documentElement, Node);
is_a(window.document.documentElement, HTMLElement); is_a(window.document.documentElement, Element);
is_a(window.document.documentElement, HTMLHtmlElement); is_a(window.document.documentElement, HTMLElement);
is_a(window.document, Document); is_a(window.document.documentElement, HTMLHtmlElement);
is(window.document.documentElement.tagName, "HTML"); is_a(window.document, Document);
is_a(window.document.getElementsByTagName('foo-á')[0], HTMLUnknownElement); is(window.document.documentElement.tagName, "HTML");
is(window.document.getElementsByTagName('foo-á')[0].tagName, "FOO-á"); is_a(window.document.getElementsByTagName('foo-á')[0], HTMLUnknownElement);
finish(); is(window.document.getElementsByTagName('foo-á')[0].tagName, "FOO-á");
finish();
}
</script> </script>
</body> </body>
</html> </html>

View file

@ -1,6 +1,10 @@
<html> <html>
<head> <head>
<script src="harness.js"></script> <script src="harness.js"></script>
</head>
<body>
<div>this is
text content</div>
<script> <script>
var div = document.getElementsByTagName('div')[0]; var div = document.getElementsByTagName('div')[0];
is(div.textContent, "this is\n text content"); is(div.textContent, "this is\n text content");
@ -9,9 +13,5 @@
is(div.textContent, newContent); is(div.textContent, newContent);
finish(); finish();
</script> </script>
</head>
<body>
<div>this is
text content</div>
</body> </body>
</html> </html>

View file

@ -1,3 +1,3 @@
[Document-createElement-namespace.html] [Document-createElement-namespace.html]
type: testharness type: testharness
expected: TIMEOUT expected: CRASH

View file

@ -1,4 +0,0 @@
[document-readyState.html]
type: testharness
[readystatechange event is fired each time document.readyState changes]
expected: FAIL

View file

@ -1,20 +1,5 @@
[script-languages-02.html] [script-languages-02.html]
type: testharness type: testharness
[Script should run with type=""]
expected: FAIL
[Script should run with type="application/ecmascript"]
expected: FAIL
[Script should run with type="application/javascript"]
expected: FAIL
[Script should run with type="application/x-ecmascript"]
expected: FAIL
[Script should run with type="application/x-javascript"]
expected: FAIL
[Script should run with type="APPLICATION/ECMASCRIPT"] [Script should run with type="APPLICATION/ECMASCRIPT"]
expected: FAIL expected: FAIL
@ -27,162 +12,6 @@
[Script should run with type="APPLICATION/X-JAVASCRIPT"] [Script should run with type="APPLICATION/X-JAVASCRIPT"]
expected: FAIL expected: FAIL
[Script should run with type="application/ecmascript "]
expected: FAIL
[Script should run with type="application/javascript "]
expected: FAIL
[Script should run with type="application/x-ecmascript "]
expected: FAIL
[Script should run with type="application/x-javascript "]
expected: FAIL
[Script should run with type=" application/ecmascript"]
expected: FAIL
[Script should run with type=" application/javascript"]
expected: FAIL
[Script should run with type=" application/x-ecmascript"]
expected: FAIL
[Script should run with type=" application/x-javascript"]
expected: FAIL
[Script should run with type="application/ecmascript\\t"]
expected: FAIL
[Script should run with type="application/javascript\\t"]
expected: FAIL
[Script should run with type="application/x-ecmascript\\t"]
expected: FAIL
[Script should run with type="application/x-javascript\\t"]
expected: FAIL
[Script should run with type="\\tapplication/ecmascript"]
expected: FAIL
[Script should run with type="\\tapplication/javascript"]
expected: FAIL
[Script should run with type="\\tapplication/x-ecmascript"]
expected: FAIL
[Script should run with type="\\tapplication/x-javascript"]
expected: FAIL
[Script should run with type="application/ecmascript\\n"]
expected: FAIL
[Script should run with type="application/javascript\\n"]
expected: FAIL
[Script should run with type="application/x-ecmascript\\n"]
expected: FAIL
[Script should run with type="application/x-javascript\\n"]
expected: FAIL
[Script should run with type="\\napplication/ecmascript"]
expected: FAIL
[Script should run with type="\\napplication/javascript"]
expected: FAIL
[Script should run with type="\\napplication/x-ecmascript"]
expected: FAIL
[Script should run with type="\\napplication/x-javascript"]
expected: FAIL
[Script should run with type="application/ecmascript\\r"]
expected: FAIL
[Script should run with type="application/javascript\\r"]
expected: FAIL
[Script should run with type="application/x-ecmascript\\r"]
expected: FAIL
[Script should run with type="application/x-javascript\\r"]
expected: FAIL
[Script should run with type="\\rapplication/ecmascript"]
expected: FAIL
[Script should run with type="\\rapplication/javascript"]
expected: FAIL
[Script should run with type="\\rapplication/x-ecmascript"]
expected: FAIL
[Script should run with type="\\rapplication/x-javascript"]
expected: FAIL
[Script should run with type="application/ecmascript\\f"]
expected: FAIL
[Script should run with type="application/javascript\\f"]
expected: FAIL
[Script should run with type="application/x-ecmascript\\f"]
expected: FAIL
[Script should run with type="application/x-javascript\\f"]
expected: FAIL
[Script should run with type="\\fapplication/ecmascript"]
expected: FAIL
[Script should run with type="\\fapplication/javascript"]
expected: FAIL
[Script should run with type="\\fapplication/x-ecmascript"]
expected: FAIL
[Script should run with type="\\fapplication/x-javascript"]
expected: FAIL
[Script should run with type="text/ecmascript"]
expected: FAIL
[Script should run with type="text/javascript"]
expected: FAIL
[Script should run with type="text/javascript1.0"]
expected: FAIL
[Script should run with type="text/javascript1.1"]
expected: FAIL
[Script should run with type="text/javascript1.2"]
expected: FAIL
[Script should run with type="text/javascript1.3"]
expected: FAIL
[Script should run with type="text/javascript1.4"]
expected: FAIL
[Script should run with type="text/javascript1.5"]
expected: FAIL
[Script should run with type="text/jscript"]
expected: FAIL
[Script should run with type="text/livescript"]
expected: FAIL
[Script should run with type="text/x-ecmascript"]
expected: FAIL
[Script should run with type="text/x-javascript"]
expected: FAIL
[Script should run with type="TEXT/ECMASCRIPT"] [Script should run with type="TEXT/ECMASCRIPT"]
expected: FAIL expected: FAIL
@ -219,405 +48,6 @@
[Script should run with type="TEXT/X-JAVASCRIPT"] [Script should run with type="TEXT/X-JAVASCRIPT"]
expected: FAIL expected: FAIL
[Script should run with type="text/ecmascript "]
expected: FAIL
[Script should run with type="text/javascript "]
expected: FAIL
[Script should run with type="text/javascript1.0 "]
expected: FAIL
[Script should run with type="text/javascript1.1 "]
expected: FAIL
[Script should run with type="text/javascript1.2 "]
expected: FAIL
[Script should run with type="text/javascript1.3 "]
expected: FAIL
[Script should run with type="text/javascript1.4 "]
expected: FAIL
[Script should run with type="text/javascript1.5 "]
expected: FAIL
[Script should run with type="text/jscript "]
expected: FAIL
[Script should run with type="text/livescript "]
expected: FAIL
[Script should run with type="text/x-ecmascript "]
expected: FAIL
[Script should run with type="text/x-javascript "]
expected: FAIL
[Script should run with type=" text/ecmascript"]
expected: FAIL
[Script should run with type=" text/javascript"]
expected: FAIL
[Script should run with type=" text/javascript1.0"]
expected: FAIL
[Script should run with type=" text/javascript1.1"]
expected: FAIL
[Script should run with type=" text/javascript1.2"]
expected: FAIL
[Script should run with type=" text/javascript1.3"]
expected: FAIL
[Script should run with type=" text/javascript1.4"]
expected: FAIL
[Script should run with type=" text/javascript1.5"]
expected: FAIL
[Script should run with type=" text/jscript"]
expected: FAIL
[Script should run with type=" text/livescript"]
expected: FAIL
[Script should run with type=" text/x-ecmascript"]
expected: FAIL
[Script should run with type=" text/x-javascript"]
expected: FAIL
[Script should run with type="text/ecmascript\\t"]
expected: FAIL
[Script should run with type="text/javascript\\t"]
expected: FAIL
[Script should run with type="text/javascript1.0\\t"]
expected: FAIL
[Script should run with type="text/javascript1.1\\t"]
expected: FAIL
[Script should run with type="text/javascript1.2\\t"]
expected: FAIL
[Script should run with type="text/javascript1.3\\t"]
expected: FAIL
[Script should run with type="text/javascript1.4\\t"]
expected: FAIL
[Script should run with type="text/javascript1.5\\t"]
expected: FAIL
[Script should run with type="text/jscript\\t"]
expected: FAIL
[Script should run with type="text/livescript\\t"]
expected: FAIL
[Script should run with type="text/x-ecmascript\\t"]
expected: FAIL
[Script should run with type="text/x-javascript\\t"]
expected: FAIL
[Script should run with type="\\ttext/ecmascript"]
expected: FAIL
[Script should run with type="\\ttext/javascript"]
expected: FAIL
[Script should run with type="\\ttext/javascript1.0"]
expected: FAIL
[Script should run with type="\\ttext/javascript1.1"]
expected: FAIL
[Script should run with type="\\ttext/javascript1.2"]
expected: FAIL
[Script should run with type="\\ttext/javascript1.3"]
expected: FAIL
[Script should run with type="\\ttext/javascript1.4"]
expected: FAIL
[Script should run with type="\\ttext/javascript1.5"]
expected: FAIL
[Script should run with type="\\ttext/jscript"]
expected: FAIL
[Script should run with type="\\ttext/livescript"]
expected: FAIL
[Script should run with type="\\ttext/x-ecmascript"]
expected: FAIL
[Script should run with type="\\ttext/x-javascript"]
expected: FAIL
[Script should run with type="text/ecmascript\\n"]
expected: FAIL
[Script should run with type="text/javascript\\n"]
expected: FAIL
[Script should run with type="text/javascript1.0\\n"]
expected: FAIL
[Script should run with type="text/javascript1.1\\n"]
expected: FAIL
[Script should run with type="text/javascript1.2\\n"]
expected: FAIL
[Script should run with type="text/javascript1.3\\n"]
expected: FAIL
[Script should run with type="text/javascript1.4\\n"]
expected: FAIL
[Script should run with type="text/javascript1.5\\n"]
expected: FAIL
[Script should run with type="text/jscript\\n"]
expected: FAIL
[Script should run with type="text/livescript\\n"]
expected: FAIL
[Script should run with type="text/x-ecmascript\\n"]
expected: FAIL
[Script should run with type="text/x-javascript\\n"]
expected: FAIL
[Script should run with type="\\ntext/ecmascript"]
expected: FAIL
[Script should run with type="\\ntext/javascript"]
expected: FAIL
[Script should run with type="\\ntext/javascript1.0"]
expected: FAIL
[Script should run with type="\\ntext/javascript1.1"]
expected: FAIL
[Script should run with type="\\ntext/javascript1.2"]
expected: FAIL
[Script should run with type="\\ntext/javascript1.3"]
expected: FAIL
[Script should run with type="\\ntext/javascript1.4"]
expected: FAIL
[Script should run with type="\\ntext/javascript1.5"]
expected: FAIL
[Script should run with type="\\ntext/jscript"]
expected: FAIL
[Script should run with type="\\ntext/livescript"]
expected: FAIL
[Script should run with type="\\ntext/x-ecmascript"]
expected: FAIL
[Script should run with type="\\ntext/x-javascript"]
expected: FAIL
[Script should run with type="text/ecmascript\\r"]
expected: FAIL
[Script should run with type="text/javascript\\r"]
expected: FAIL
[Script should run with type="text/javascript1.0\\r"]
expected: FAIL
[Script should run with type="text/javascript1.1\\r"]
expected: FAIL
[Script should run with type="text/javascript1.2\\r"]
expected: FAIL
[Script should run with type="text/javascript1.3\\r"]
expected: FAIL
[Script should run with type="text/javascript1.4\\r"]
expected: FAIL
[Script should run with type="text/javascript1.5\\r"]
expected: FAIL
[Script should run with type="text/jscript\\r"]
expected: FAIL
[Script should run with type="text/livescript\\r"]
expected: FAIL
[Script should run with type="text/x-ecmascript\\r"]
expected: FAIL
[Script should run with type="text/x-javascript\\r"]
expected: FAIL
[Script should run with type="\\rtext/ecmascript"]
expected: FAIL
[Script should run with type="\\rtext/javascript"]
expected: FAIL
[Script should run with type="\\rtext/javascript1.0"]
expected: FAIL
[Script should run with type="\\rtext/javascript1.1"]
expected: FAIL
[Script should run with type="\\rtext/javascript1.2"]
expected: FAIL
[Script should run with type="\\rtext/javascript1.3"]
expected: FAIL
[Script should run with type="\\rtext/javascript1.4"]
expected: FAIL
[Script should run with type="\\rtext/javascript1.5"]
expected: FAIL
[Script should run with type="\\rtext/jscript"]
expected: FAIL
[Script should run with type="\\rtext/livescript"]
expected: FAIL
[Script should run with type="\\rtext/x-ecmascript"]
expected: FAIL
[Script should run with type="\\rtext/x-javascript"]
expected: FAIL
[Script should run with type="text/ecmascript\\f"]
expected: FAIL
[Script should run with type="text/javascript\\f"]
expected: FAIL
[Script should run with type="text/javascript1.0\\f"]
expected: FAIL
[Script should run with type="text/javascript1.1\\f"]
expected: FAIL
[Script should run with type="text/javascript1.2\\f"]
expected: FAIL
[Script should run with type="text/javascript1.3\\f"]
expected: FAIL
[Script should run with type="text/javascript1.4\\f"]
expected: FAIL
[Script should run with type="text/javascript1.5\\f"]
expected: FAIL
[Script should run with type="text/jscript\\f"]
expected: FAIL
[Script should run with type="text/livescript\\f"]
expected: FAIL
[Script should run with type="text/x-ecmascript\\f"]
expected: FAIL
[Script should run with type="text/x-javascript\\f"]
expected: FAIL
[Script should run with type="\\ftext/ecmascript"]
expected: FAIL
[Script should run with type="\\ftext/javascript"]
expected: FAIL
[Script should run with type="\\ftext/javascript1.0"]
expected: FAIL
[Script should run with type="\\ftext/javascript1.1"]
expected: FAIL
[Script should run with type="\\ftext/javascript1.2"]
expected: FAIL
[Script should run with type="\\ftext/javascript1.3"]
expected: FAIL
[Script should run with type="\\ftext/javascript1.4"]
expected: FAIL
[Script should run with type="\\ftext/javascript1.5"]
expected: FAIL
[Script should run with type="\\ftext/jscript"]
expected: FAIL
[Script should run with type="\\ftext/livescript"]
expected: FAIL
[Script should run with type="\\ftext/x-ecmascript"]
expected: FAIL
[Script should run with type="\\ftext/x-javascript"]
expected: FAIL
[Script should run with language=""]
expected: FAIL
[Script should run with language="ecmascript"]
expected: FAIL
[Script should run with language="javascript"]
expected: FAIL
[Script should run with language="javascript1.0"]
expected: FAIL
[Script should run with language="javascript1.1"]
expected: FAIL
[Script should run with language="javascript1.2"]
expected: FAIL
[Script should run with language="javascript1.3"]
expected: FAIL
[Script should run with language="javascript1.4"]
expected: FAIL
[Script should run with language="javascript1.5"]
expected: FAIL
[Script should run with language="jscript"]
expected: FAIL
[Script should run with language="livescript"]
expected: FAIL
[Script should run with language="x-ecmascript"]
expected: FAIL
[Script should run with language="x-javascript"]
expected: FAIL
[Script should run with language="ECMASCRIPT"] [Script should run with language="ECMASCRIPT"]
expected: FAIL expected: FAIL

View file

@ -1,5 +0,0 @@
[013.html]
type: testharness
[ scheduler: DOM added inline script earlier in document]
expected: FAIL

View file

@ -1,5 +0,0 @@
[016.html]
type: testharness
[ scheduler: DOM added inline script later in document]
expected: FAIL

View file

@ -1,5 +0,0 @@
[025.html]
type: testharness
[ scheduler: DOM added script, .src set on script with content]
expected: FAIL

View file

@ -1,5 +0,0 @@
[036.html]
type: testharness
[ scheduler: DOM cloning]
expected: FAIL

View file

@ -1,5 +0,0 @@
[037.html]
type: testharness
[ scheduler: DOM movement with appendChild, inline]
expected: FAIL

View file

@ -1,5 +0,0 @@
[048.html]
type: testharness
[ scheduler: adding inline script which sets its own .src ]
expected: FAIL

View file

@ -1,5 +0,0 @@
[052.html]
type: testharness
[ scheduler: interaction of parsing and script execution - external script ]
expected: FAIL

View file

@ -1,5 +0,0 @@
[056.html]
type: testharness
[ scheduler: appending code to initially empty SCRIPT tag in DOM ]
expected: FAIL

View file

@ -1,6 +1,5 @@
[069.html] [069.html]
type: testharness type: testharness
expected: TIMEOUT
[scheduler: external files added through DOM should not block further parsing while loading] [scheduler: external files added through DOM should not block further parsing while loading]
expected: TIMEOUT expected: FAIL

View file

@ -1,5 +0,0 @@
[104.html]
type: testharness
[ scheduler: adding defer attribute at runtime]
expected: FAIL

View file

@ -1,6 +1,5 @@
[116.html] [116.html]
type: testharness type: testharness
expected: TIMEOUT
[scheduler: adding script to head of frameset document] [scheduler: adding script to head of frameset document]
expected: TIMEOUT expected: FAIL

View file

@ -1,5 +0,0 @@
[124.html]
type: testharness
[scheduler: altering the type attribute and changing script data inline script ]
expected: FAIL

View file

@ -1,5 +0,0 @@
[127.html]
type: testharness
[scheduler: appending non-text children to script ]
expected: FAIL

View file

@ -1,5 +0,0 @@
[129.html]
type: testharness
[scheduler: appending multiple script elements]
expected: FAIL

View file

@ -1,5 +0,0 @@
[133.html]
type: testharness
[scheduler: inline HTML script added by SVG script ]
expected: FAIL

View file

@ -1,5 +0,0 @@
[145.html]
type: testharness
[scheduler: SVG inline script adding text to empty script ]
expected: FAIL