diff options
author | Per Lundberg <perlun@gmail.com> | 2016-04-02 00:35:22 +0300 |
---|---|---|
committer | Per Lundberg <perlun@gmail.com> | 2016-04-03 22:33:57 +0300 |
commit | 99f473631affce4f3dc7aee125712c1e379ed2af (patch) | |
tree | 2d2ac10e5e8e8e279db0af6926e0d5c4ea0e268d | |
parent | 4e4a213c73d49641fdfbf83c31152295d4856ae0 (diff) | |
download | servo-99f473631affce4f3dc7aee125712c1e379ed2af.tar.gz servo-99f473631affce4f3dc7aee125712c1e379ed2af.zip |
HTMLScriptElement: Added missing DOM properties
This should sort out most (all?) of the ones pointed out in #10227.
(Amended with suggested fixes in PR #10354.)
5 files changed, 32 insertions, 420 deletions
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index eb63d524c9c..70d96f25fe7 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -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()) diff --git a/components/script/dom/webidls/HTMLScriptElement.webidl b/components/script/dom/webidls/HTMLScriptElement.webidl index 945cac2e0c7..8bd588a232b 100644 --- a/components/script/dom/webidls/HTMLScriptElement.webidl +++ b/components/script/dom/webidls/HTMLScriptElement.webidl @@ -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; }; diff --git a/tests/wpt/metadata/html/dom/interfaces.html.ini b/tests/wpt/metadata/html/dom/interfaces.html.ini index f8bce1adc76..7419e7f872c 100644 --- a/tests/wpt/metadata/html/dom/interfaces.html.ini +++ b/tests/wpt/metadata/html/dom/interfaces.html.ini @@ -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 @@ -8036,7 +8006,7 @@ [Document interface: iframe.contentDocument must inherit property "createTreeWalker" with the proper type (27)] expected: FAIL - + [Document interface: iframe.contentDocument must inherit property "styleSheets" with the proper type (28)] expected: FAIL diff --git a/tests/wpt/metadata/html/dom/reflection-misc.html.ini b/tests/wpt/metadata/html/dom/reflection-misc.html.ini index efa1eef00ea..953d81ccd68 100644 --- a/tests/wpt/metadata/html/dom/reflection-misc.html.ini +++ b/tests/wpt/metadata/html/dom/reflection-misc.html.ini @@ -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 diff --git a/tests/wpt/metadata/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/script-IDL-event-htmlfor.html.ini b/tests/wpt/metadata/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/script-IDL-event-htmlfor.html.ini deleted file mode 100644 index e9d433552ad..00000000000 --- a/tests/wpt/metadata/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/script-IDL-event-htmlfor.html.ini +++ /dev/null @@ -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 - |