Auto merge of #10354 - perlun:implement-missing-html-script-element-attributes, r=Ms2ger

HTMLScriptElement: Added missing DOM properties

This should sort out most (all?) of the ones pointed out in #10227.

/cc @jdm

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10354)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-04-04 17:21:22 +05:30
commit 3b2a1a3c47
5 changed files with 31 additions and 419 deletions

View file

@ -600,6 +600,31 @@ impl HTMLScriptElementMethods for HTMLScriptElement {
// https://html.spec.whatwg.org/multipage/#dom-script-src
make_setter!(SetSrc, "src");
// https://html.spec.whatwg.org/multipage/#dom-script-type
make_getter!(Type, "type");
// https://html.spec.whatwg.org/multipage/#dom-script-type
make_setter!(SetType, "type");
// https://html.spec.whatwg.org/multipage/#dom-script-charset
make_getter!(Charset, "charset");
// https://html.spec.whatwg.org/multipage/#dom-script-charset
make_setter!(SetCharset, "charset");
// https://html.spec.whatwg.org/multipage/#dom-script-defer
make_bool_getter!(Defer, "defer");
// https://html.spec.whatwg.org/multipage/#dom-script-defer
make_bool_setter!(SetDefer, "defer");
// https://html.spec.whatwg.org/multipage/#dom-script-event
make_getter!(Event, "event");
// https://html.spec.whatwg.org/multipage/#dom-script-event
make_setter!(SetEvent, "event");
// https://html.spec.whatwg.org/multipage/#dom-script-htmlfor
make_getter!(HtmlFor, "for");
// https://html.spec.whatwg.org/multipage/#dom-script-htmlfor
make_setter!(SetHtmlFor, "for");
// https://html.spec.whatwg.org/multipage/#dom-script-text
fn Text(&self) -> DOMString {
Node::collect_text_contents(self.upcast::<Node>().children())

View file

@ -6,12 +6,12 @@
// https://html.spec.whatwg.org/multipage/#htmlscriptelement
interface HTMLScriptElement : HTMLElement {
attribute DOMString src;
// attribute DOMString type;
// attribute DOMString charset;
attribute DOMString type;
attribute DOMString charset;
// attribute boolean async;
// attribute boolean defer;
attribute boolean defer;
// attribute DOMString crossOrigin;
[Pure]
[Pure]
attribute DOMString text;
// also has obsolete members
@ -19,6 +19,6 @@ interface HTMLScriptElement : HTMLElement {
// https://html.spec.whatwg.org/multipage/#HTMLScriptElement-partial
partial interface HTMLScriptElement {
// attribute DOMString event;
// attribute DOMString htmlFor;
attribute DOMString event;
attribute DOMString htmlFor;
};

View file

@ -5481,48 +5481,18 @@
[HTMLDialogElement interface: operation close(DOMString)]
expected: FAIL
[HTMLScriptElement interface: attribute type]
expected: FAIL
[HTMLScriptElement interface: attribute charset]
expected: FAIL
[HTMLScriptElement interface: attribute async]
expected: FAIL
[HTMLScriptElement interface: attribute defer]
expected: FAIL
[HTMLScriptElement interface: attribute crossOrigin]
expected: FAIL
[HTMLScriptElement interface: attribute event]
expected: FAIL
[HTMLScriptElement interface: attribute htmlFor]
expected: FAIL
[HTMLScriptElement interface: document.createElement("script") must inherit property "type" with the proper type (1)]
expected: FAIL
[HTMLScriptElement interface: document.createElement("script") must inherit property "charset" with the proper type (2)]
expected: FAIL
[HTMLScriptElement interface: document.createElement("script") must inherit property "async" with the proper type (3)]
expected: FAIL
[HTMLScriptElement interface: document.createElement("script") must inherit property "defer" with the proper type (4)]
expected: FAIL
[HTMLScriptElement interface: document.createElement("script") must inherit property "crossOrigin" with the proper type (5)]
expected: FAIL
[HTMLScriptElement interface: document.createElement("script") must inherit property "event" with the proper type (7)]
expected: FAIL
[HTMLScriptElement interface: document.createElement("script") must inherit property "htmlFor" with the proper type (8)]
expected: FAIL
[HTMLCanvasElement interface: operation probablySupportsContext(DOMString,any)]
expected: FAIL

View file

@ -1317,372 +1317,6 @@
[script.tabIndex: IDL set to -2147483648 followed by getAttribute()]
expected: FAIL
[script.type: typeof IDL attribute]
expected: FAIL
[script.type: IDL get with DOM attribute unset]
expected: FAIL
[script.type: setAttribute() to "" followed by IDL get]
expected: FAIL
[script.type: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by IDL get]
expected: FAIL
[script.type: setAttribute() to undefined followed by IDL get]
expected: FAIL
[script.type: setAttribute() to 7 followed by IDL get]
expected: FAIL
[script.type: setAttribute() to 1.5 followed by IDL get]
expected: FAIL
[script.type: setAttribute() to true followed by IDL get]
expected: FAIL
[script.type: setAttribute() to false followed by IDL get]
expected: FAIL
[script.type: setAttribute() to object "[object Object\]" followed by IDL get]
expected: FAIL
[script.type: setAttribute() to NaN followed by IDL get]
expected: FAIL
[script.type: setAttribute() to Infinity followed by IDL get]
expected: FAIL
[script.type: setAttribute() to -Infinity followed by IDL get]
expected: FAIL
[script.type: setAttribute() to "\\0" followed by IDL get]
expected: FAIL
[script.type: setAttribute() to null followed by IDL get]
expected: FAIL
[script.type: setAttribute() to object "test-toString" followed by IDL get]
expected: FAIL
[script.type: setAttribute() to object "test-valueOf" followed by IDL get]
expected: FAIL
[script.type: IDL set to "" followed by getAttribute()]
expected: FAIL
[script.type: IDL set to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by getAttribute()]
expected: FAIL
[script.type: IDL set to undefined followed by getAttribute()]
expected: FAIL
[script.type: IDL set to undefined followed by IDL get]
expected: FAIL
[script.type: IDL set to 7 followed by getAttribute()]
expected: FAIL
[script.type: IDL set to 7 followed by IDL get]
expected: FAIL
[script.type: IDL set to 1.5 followed by getAttribute()]
expected: FAIL
[script.type: IDL set to 1.5 followed by IDL get]
expected: FAIL
[script.type: IDL set to true followed by getAttribute()]
expected: FAIL
[script.type: IDL set to true followed by IDL get]
expected: FAIL
[script.type: IDL set to false followed by getAttribute()]
expected: FAIL
[script.type: IDL set to false followed by IDL get]
expected: FAIL
[script.type: IDL set to object "[object Object\]" followed by getAttribute()]
expected: FAIL
[script.type: IDL set to object "[object Object\]" followed by IDL get]
expected: FAIL
[script.type: IDL set to NaN followed by getAttribute()]
expected: FAIL
[script.type: IDL set to NaN followed by IDL get]
expected: FAIL
[script.type: IDL set to Infinity followed by getAttribute()]
expected: FAIL
[script.type: IDL set to Infinity followed by IDL get]
expected: FAIL
[script.type: IDL set to -Infinity followed by getAttribute()]
expected: FAIL
[script.type: IDL set to -Infinity followed by IDL get]
expected: FAIL
[script.type: IDL set to "\\0" followed by getAttribute()]
expected: FAIL
[script.type: IDL set to null followed by getAttribute()]
expected: FAIL
[script.type: IDL set to null followed by IDL get]
expected: FAIL
[script.type: IDL set to object "test-toString" followed by getAttribute()]
expected: FAIL
[script.type: IDL set to object "test-toString" followed by IDL get]
expected: FAIL
[script.type: IDL set to object "test-valueOf" followed by IDL get]
expected: FAIL
[script.charset: typeof IDL attribute]
expected: FAIL
[script.charset: IDL get with DOM attribute unset]
expected: FAIL
[script.charset: setAttribute() to "" followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to undefined followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to 7 followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to 1.5 followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to true followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to false followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to object "[object Object\]" followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to NaN followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to Infinity followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to -Infinity followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to "\\0" followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to null followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to object "test-toString" followed by IDL get]
expected: FAIL
[script.charset: setAttribute() to object "test-valueOf" followed by IDL get]
expected: FAIL
[script.charset: IDL set to "" followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo " followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to undefined followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to undefined followed by IDL get]
expected: FAIL
[script.charset: IDL set to 7 followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to 7 followed by IDL get]
expected: FAIL
[script.charset: IDL set to 1.5 followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to 1.5 followed by IDL get]
expected: FAIL
[script.charset: IDL set to true followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to true followed by IDL get]
expected: FAIL
[script.charset: IDL set to false followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to false followed by IDL get]
expected: FAIL
[script.charset: IDL set to object "[object Object\]" followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to object "[object Object\]" followed by IDL get]
expected: FAIL
[script.charset: IDL set to NaN followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to NaN followed by IDL get]
expected: FAIL
[script.charset: IDL set to Infinity followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to Infinity followed by IDL get]
expected: FAIL
[script.charset: IDL set to -Infinity followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to -Infinity followed by IDL get]
expected: FAIL
[script.charset: IDL set to "\\0" followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to null followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to null followed by IDL get]
expected: FAIL
[script.charset: IDL set to object "test-toString" followed by getAttribute()]
expected: FAIL
[script.charset: IDL set to object "test-toString" followed by IDL get]
expected: FAIL
[script.charset: IDL set to object "test-valueOf" followed by IDL get]
expected: FAIL
[script.defer: typeof IDL attribute]
expected: FAIL
[script.defer: IDL get with DOM attribute unset]
expected: FAIL
[script.defer: setAttribute() to "" followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to " foo " followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to undefined followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to null followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to 7 followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to 1.5 followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to true followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to false followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to object "[object Object\]" followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to NaN followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to Infinity followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to -Infinity followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to "\\0" followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to object "test-toString" followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to object "test-valueOf" followed by IDL get]
expected: FAIL
[script.defer: setAttribute() to "defer" followed by IDL get]
expected: FAIL
[script.defer: IDL set to "" followed by hasAttribute()]
expected: FAIL
[script.defer: IDL set to "" followed by IDL get]
expected: FAIL
[script.defer: IDL set to " foo " followed by IDL get]
expected: FAIL
[script.defer: IDL set to undefined followed by hasAttribute()]
expected: FAIL
[script.defer: IDL set to undefined followed by IDL get]
expected: FAIL
[script.defer: IDL set to null followed by hasAttribute()]
expected: FAIL
[script.defer: IDL set to null followed by IDL get]
expected: FAIL
[script.defer: IDL set to 7 followed by IDL get]
expected: FAIL
[script.defer: IDL set to 1.5 followed by IDL get]
expected: FAIL
[script.defer: IDL set to false followed by hasAttribute()]
expected: FAIL
[script.defer: IDL set to object "[object Object\]" followed by IDL get]
expected: FAIL
[script.defer: IDL set to NaN followed by hasAttribute()]
expected: FAIL
[script.defer: IDL set to NaN followed by IDL get]
expected: FAIL
[script.defer: IDL set to Infinity followed by IDL get]
expected: FAIL
[script.defer: IDL set to -Infinity followed by IDL get]
expected: FAIL
[script.defer: IDL set to "\\0" followed by IDL get]
expected: FAIL
[script.defer: IDL set to object "test-toString" followed by IDL get]
expected: FAIL
[script.defer: IDL set to object "test-valueOf" followed by IDL get]
expected: FAIL
[script.crossOrigin: typeof IDL attribute]
expected: FAIL

View file

@ -1,17 +0,0 @@
[script-IDL-event-htmlfor.html]
type: testharness
[event and htmlFor IDL attributes of HTMLScriptElement]
expected: FAIL
[event and htmlFor IDL attributes of HTMLScriptElement 1]
expected: FAIL
[event and htmlFor IDL attributes of HTMLScriptElement 2]
expected: FAIL
[event and htmlFor IDL attributes of HTMLScriptElement 3]
expected: FAIL
[event and htmlFor IDL attributes of HTMLScriptElement 4]
expected: FAIL