auto merge of #4865 : psdh/servo/prepscript, r=Ms2ger

#4176
This commit is contained in:
bors-servo 2015-02-20 17:03:53 -07:00
commit e39e75865b
4 changed files with 18 additions and 50 deletions

View file

@ -170,9 +170,25 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
// these steps at this point. The script is not executed.
// Step 12.
// TODO: If the script element has an `event` attribute and a `for` attribute, then run
// these substeps...
match element.get_attribute(ns!(""), &atom!("for")).root() {
Some(for_script) => {
if for_script.r().Value().to_ascii_lowercase().trim_matches(HTML_SPACE_CHARACTERS) != "window" {
return;
}
}
_ => { }
}
match element.get_attribute(ns!(""), &Atom::from_slice("event")).root() {
Some(event) => {
let event = event.r().Value().to_ascii_lowercase();
let event = event.trim_matches(HTML_SPACE_CHARACTERS);
if event != "onload" && event != "onload()" {
return;
}
}
_ => { }
}
// Step 13.
// TODO: If the script element has a `charset` attribute, then let the script block's
// character encoding for this script element be the result of getting an encoding from the

View file

@ -1,38 +0,0 @@
[script-for-event.html]
type: testharness
[Script 0]
expected: FAIL
[Script 1]
expected: FAIL
[Script 2]
expected: FAIL
[Script 3]
expected: FAIL
[Script 4]
expected: FAIL
[Script 5]
expected: FAIL
[Script 6]
expected: FAIL
[Script 7]
expected: FAIL
[Script 8]
expected: FAIL
[Script 9]
expected: FAIL
[Script 10]
expected: FAIL
[Script 11]
expected: FAIL

View file

@ -1,5 +0,0 @@
[script-for-event.xhtml]
type: testharness
[Scripts with for and event attributes should not run.]
expected: FAIL

View file

@ -1,5 +0,0 @@
[script-for-onload.html]
type: testharness
[Script for and onload attributes]
expected: FAIL