From fc5f8e9237f95153b642846f8d89682cc4061573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=BClker?= Date: Wed, 4 Sep 2024 13:29:59 +0200 Subject: [PATCH] Implement HTMLQuoteElement "cite" attribute (#33307) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simon Wülker --- components/script/dom/htmlquoteelement.rs | 10 ++ .../dom/webidls/HTMLQuoteElement.webidl | 4 +- .../HTMLQuoteElement.html.ini | 12 -- .../meta/html/dom/idlharness.https.html.ini | 9 -- .../html/dom/reflection-grouping.html.ini | 132 ------------------ .../meta/html/dom/reflection-text.html.ini | 132 ------------------ .../dynamic-urls.sub.html.ini | 6 - .../historical.sub.xhtml.ini | 6 - 8 files changed, 12 insertions(+), 299 deletions(-) delete mode 100644 tests/wpt/meta/custom-elements/reactions/customized-builtins/HTMLQuoteElement.html.ini diff --git a/components/script/dom/htmlquoteelement.rs b/components/script/dom/htmlquoteelement.rs index 3254ca5b7e7..e8fc6f30407 100644 --- a/components/script/dom/htmlquoteelement.rs +++ b/components/script/dom/htmlquoteelement.rs @@ -6,7 +6,9 @@ use dom_struct::dom_struct; use html5ever::{LocalName, Prefix}; use js::rust::HandleObject; +use crate::dom::bindings::codegen::Bindings::HTMLQuoteElementBinding::HTMLQuoteElementMethods; use crate::dom::bindings::root::DomRoot; +use crate::dom::bindings::str::USVString; use crate::dom::document::Document; use crate::dom::htmlelement::HTMLElement; use crate::dom::node::Node; @@ -43,3 +45,11 @@ impl HTMLQuoteElement { ) } } + +impl HTMLQuoteElementMethods for HTMLQuoteElement { + // https://html.spec.whatwg.org/multipage/#dom-quote-cite + make_url_getter!(Cite, "cite"); + + // https://html.spec.whatwg.org/multipage/#dom-quote-cite + make_url_setter!(SetCite, "cite"); +} diff --git a/components/script/dom/webidls/HTMLQuoteElement.webidl b/components/script/dom/webidls/HTMLQuoteElement.webidl index d7623fb47b9..8bc30cdb4c1 100644 --- a/components/script/dom/webidls/HTMLQuoteElement.webidl +++ b/components/script/dom/webidls/HTMLQuoteElement.webidl @@ -7,6 +7,6 @@ interface HTMLQuoteElement : HTMLElement { [HTMLConstructor] constructor(); - // [CEReactions] - // attribute DOMString cite; + [CEReactions] + attribute USVString cite; }; diff --git a/tests/wpt/meta/custom-elements/reactions/customized-builtins/HTMLQuoteElement.html.ini b/tests/wpt/meta/custom-elements/reactions/customized-builtins/HTMLQuoteElement.html.ini deleted file mode 100644 index b3598f04958..00000000000 --- a/tests/wpt/meta/custom-elements/reactions/customized-builtins/HTMLQuoteElement.html.ini +++ /dev/null @@ -1,12 +0,0 @@ -[HTMLQuoteElement.html] - [cite on blockquote use HTMLQuoteElement must enqueue an attributeChanged reaction when adding cite content attribute] - expected: FAIL - - [cite on blockquote use HTMLQuoteElement must enqueue an attributeChanged reaction when replacing an existing attribute] - expected: FAIL - - [cite on q use HTMLQuoteElement must enqueue an attributeChanged reaction when adding cite content attribute] - expected: FAIL - - [cite on q use HTMLQuoteElement must enqueue an attributeChanged reaction when replacing an existing attribute] - expected: FAIL diff --git a/tests/wpt/meta/html/dom/idlharness.https.html.ini b/tests/wpt/meta/html/dom/idlharness.https.html.ini index a34d014991c..cd1a16e9f4f 100644 --- a/tests/wpt/meta/html/dom/idlharness.https.html.ini +++ b/tests/wpt/meta/html/dom/idlharness.https.html.ini @@ -2745,9 +2745,6 @@ [HTMLTableCellElement interface: attribute vAlign] expected: FAIL - [HTMLQuoteElement interface: attribute cite] - expected: FAIL - [HTMLModElement interface: document.createElement("ins") must inherit property "dateTime" with the proper type] expected: FAIL @@ -3942,9 +3939,6 @@ [HTMLParamElement interface: document.createElement("param") must inherit property "value" with the proper type] expected: FAIL - [HTMLQuoteElement interface: document.createElement("q") must inherit property "cite" with the proper type] - expected: FAIL - [HTMLMarqueeElement interface: operation start()] expected: FAIL @@ -3975,9 +3969,6 @@ [HTMLInputElement interface: createInput("checkbox") must inherit property "autocomplete" with the proper type] expected: FAIL - [HTMLQuoteElement interface: document.createElement("blockquote") must inherit property "cite" with the proper type] - expected: FAIL - [HTMLObjectElement interface: document.createElement("object") must inherit property "name" with the proper type] expected: FAIL diff --git a/tests/wpt/meta/html/dom/reflection-grouping.html.ini b/tests/wpt/meta/html/dom/reflection-grouping.html.ini index 9cfdba0633f..41b71e15802 100644 --- a/tests/wpt/meta/html/dom/reflection-grouping.html.ini +++ b/tests/wpt/meta/html/dom/reflection-grouping.html.ini @@ -1121,138 +1121,6 @@ [blockquote.tabIndex: IDL set to -2147483648] expected: FAIL - [blockquote.cite: typeof IDL attribute] - expected: FAIL - - [blockquote.cite: IDL get with DOM attribute unset] - expected: FAIL - - [blockquote.cite: setAttribute() to ""] - expected: FAIL - - [blockquote.cite: setAttribute() to " foo "] - expected: FAIL - - [blockquote.cite: setAttribute() to "http://site.example/"] - expected: FAIL - - [blockquote.cite: setAttribute() to "//site.example/path???@#l"] - expected: FAIL - - [blockquote.cite: 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 "] - expected: FAIL - - [blockquote.cite: setAttribute() to undefined] - expected: FAIL - - [blockquote.cite: setAttribute() to 7] - expected: FAIL - - [blockquote.cite: setAttribute() to 1.5] - expected: FAIL - - [blockquote.cite: setAttribute() to "5%"] - expected: FAIL - - [blockquote.cite: setAttribute() to "+100"] - expected: FAIL - - [blockquote.cite: setAttribute() to ".5"] - expected: FAIL - - [blockquote.cite: setAttribute() to true] - expected: FAIL - - [blockquote.cite: setAttribute() to false] - expected: FAIL - - [blockquote.cite: setAttribute() to object "[object Object\]"] - expected: FAIL - - [blockquote.cite: setAttribute() to NaN] - expected: FAIL - - [blockquote.cite: setAttribute() to Infinity] - expected: FAIL - - [blockquote.cite: setAttribute() to -Infinity] - expected: FAIL - - [blockquote.cite: setAttribute() to "\\0"] - expected: FAIL - - [blockquote.cite: setAttribute() to null] - expected: FAIL - - [blockquote.cite: setAttribute() to object "test-toString"] - expected: FAIL - - [blockquote.cite: setAttribute() to object "test-valueOf"] - expected: FAIL - - [blockquote.cite: IDL set to ""] - expected: FAIL - - [blockquote.cite: IDL set to " foo "] - expected: FAIL - - [blockquote.cite: IDL set to "http://site.example/"] - expected: FAIL - - [blockquote.cite: IDL set to "//site.example/path???@#l"] - expected: FAIL - - [blockquote.cite: 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 "] - expected: FAIL - - [blockquote.cite: IDL set to undefined] - expected: FAIL - - [blockquote.cite: IDL set to 7] - expected: FAIL - - [blockquote.cite: IDL set to 1.5] - expected: FAIL - - [blockquote.cite: IDL set to "5%"] - expected: FAIL - - [blockquote.cite: IDL set to "+100"] - expected: FAIL - - [blockquote.cite: IDL set to ".5"] - expected: FAIL - - [blockquote.cite: IDL set to true] - expected: FAIL - - [blockquote.cite: IDL set to false] - expected: FAIL - - [blockquote.cite: IDL set to object "[object Object\]"] - expected: FAIL - - [blockquote.cite: IDL set to NaN] - expected: FAIL - - [blockquote.cite: IDL set to Infinity] - expected: FAIL - - [blockquote.cite: IDL set to -Infinity] - expected: FAIL - - [blockquote.cite: IDL set to "\\0"] - expected: FAIL - - [blockquote.cite: IDL set to null] - expected: FAIL - - [blockquote.cite: IDL set to object "test-toString"] - expected: FAIL - - [blockquote.cite: IDL set to object "test-valueOf"] - expected: FAIL - [ol.accessKey: typeof IDL attribute] expected: FAIL diff --git a/tests/wpt/meta/html/dom/reflection-text.html.ini b/tests/wpt/meta/html/dom/reflection-text.html.ini index cab2e606e30..6277b7b3aa6 100644 --- a/tests/wpt/meta/html/dom/reflection-text.html.ini +++ b/tests/wpt/meta/html/dom/reflection-text.html.ini @@ -2297,138 +2297,6 @@ [q.tabIndex: IDL set to -2147483648] expected: FAIL - [q.cite: typeof IDL attribute] - expected: FAIL - - [q.cite: IDL get with DOM attribute unset] - expected: FAIL - - [q.cite: setAttribute() to ""] - expected: FAIL - - [q.cite: setAttribute() to " foo "] - expected: FAIL - - [q.cite: setAttribute() to "http://site.example/"] - expected: FAIL - - [q.cite: setAttribute() to "//site.example/path???@#l"] - expected: FAIL - - [q.cite: 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 "] - expected: FAIL - - [q.cite: setAttribute() to undefined] - expected: FAIL - - [q.cite: setAttribute() to 7] - expected: FAIL - - [q.cite: setAttribute() to 1.5] - expected: FAIL - - [q.cite: setAttribute() to "5%"] - expected: FAIL - - [q.cite: setAttribute() to "+100"] - expected: FAIL - - [q.cite: setAttribute() to ".5"] - expected: FAIL - - [q.cite: setAttribute() to true] - expected: FAIL - - [q.cite: setAttribute() to false] - expected: FAIL - - [q.cite: setAttribute() to object "[object Object\]"] - expected: FAIL - - [q.cite: setAttribute() to NaN] - expected: FAIL - - [q.cite: setAttribute() to Infinity] - expected: FAIL - - [q.cite: setAttribute() to -Infinity] - expected: FAIL - - [q.cite: setAttribute() to "\\0"] - expected: FAIL - - [q.cite: setAttribute() to null] - expected: FAIL - - [q.cite: setAttribute() to object "test-toString"] - expected: FAIL - - [q.cite: setAttribute() to object "test-valueOf"] - expected: FAIL - - [q.cite: IDL set to ""] - expected: FAIL - - [q.cite: IDL set to " foo "] - expected: FAIL - - [q.cite: IDL set to "http://site.example/"] - expected: FAIL - - [q.cite: IDL set to "//site.example/path???@#l"] - expected: FAIL - - [q.cite: 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 "] - expected: FAIL - - [q.cite: IDL set to undefined] - expected: FAIL - - [q.cite: IDL set to 7] - expected: FAIL - - [q.cite: IDL set to 1.5] - expected: FAIL - - [q.cite: IDL set to "5%"] - expected: FAIL - - [q.cite: IDL set to "+100"] - expected: FAIL - - [q.cite: IDL set to ".5"] - expected: FAIL - - [q.cite: IDL set to true] - expected: FAIL - - [q.cite: IDL set to false] - expected: FAIL - - [q.cite: IDL set to object "[object Object\]"] - expected: FAIL - - [q.cite: IDL set to NaN] - expected: FAIL - - [q.cite: IDL set to Infinity] - expected: FAIL - - [q.cite: IDL set to -Infinity] - expected: FAIL - - [q.cite: IDL set to "\\0"] - expected: FAIL - - [q.cite: IDL set to null] - expected: FAIL - - [q.cite: IDL set to object "test-toString"] - expected: FAIL - - [q.cite: IDL set to object "test-valueOf"] - expected: FAIL - [dfn.accessKey: typeof IDL attribute] expected: FAIL diff --git a/tests/wpt/meta/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.html.ini b/tests/wpt/meta/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.html.ini index a22b22f3f1c..818c224095a 100644 --- a/tests/wpt/meta/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.html.ini +++ b/tests/wpt/meta/html/infrastructure/urls/dynamic-changes-to-base-urls/dynamic-urls.sub.html.ini @@ -2,12 +2,6 @@ [The 'href' attribute of the 'area' element] expected: FAIL - [The 'cite' attribute of the 'q' element] - expected: FAIL - - [The 'cite' attribute of the 'blockquote' element] - expected: FAIL - [The 'cite' attribute of the 'ins' element] expected: FAIL diff --git a/tests/wpt/meta/html/infrastructure/urls/dynamic-changes-to-base-urls/historical.sub.xhtml.ini b/tests/wpt/meta/html/infrastructure/urls/dynamic-changes-to-base-urls/historical.sub.xhtml.ini index 3d5213e3fec..93a7186792a 100644 --- a/tests/wpt/meta/html/infrastructure/urls/dynamic-changes-to-base-urls/historical.sub.xhtml.ini +++ b/tests/wpt/meta/html/infrastructure/urls/dynamic-changes-to-base-urls/historical.sub.xhtml.ini @@ -2,12 +2,6 @@ [The 'href' attribute of the 'area' element] expected: FAIL - [The 'cite' attribute of the 'q' element] - expected: FAIL - - [The 'cite' attribute of the 'blockquote' element] - expected: FAIL - [The 'cite' attribute of the 'ins' element] expected: FAIL