Support align attribute on HTMLParagraphElement interface (#36054)

Signed-off-by: Stephen Muss <stephenmuss@gmail.com>
This commit is contained in:
Stephen Muss 2025-03-19 18:57:43 +11:00 committed by GitHub
parent a442a11330
commit 07e06f5635
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 122 deletions

View file

@ -6,7 +6,9 @@ use dom_struct::dom_struct;
use html5ever::{LocalName, Prefix};
use js::rust::HandleObject;
use crate::dom::bindings::codegen::Bindings::HTMLParagraphElementBinding::HTMLParagraphElementMethods;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::document::Document;
use crate::dom::htmlelement::HTMLElement;
use crate::dom::node::Node;
@ -46,3 +48,11 @@ impl HTMLParagraphElement {
)
}
}
impl HTMLParagraphElementMethods<crate::DomTypeHolder> for HTMLParagraphElement {
// https://html.spec.whatwg.org/multipage/#dom-p-align
make_getter!(Align, "align");
// https://html.spec.whatwg.org/multipage/#dom-p-align
make_setter!(SetAlign, "align");
}

View file

@ -12,6 +12,5 @@ interface HTMLParagraphElement : HTMLElement {
// https://html.spec.whatwg.org/multipage/#HTMLParagraphElement-partial
partial interface HTMLParagraphElement {
// [CEReactions]
// attribute DOMString align;
[CEReactions] attribute DOMString align;
};

View file

@ -6292,12 +6292,6 @@
[HTMLHeadingElement interface: document.createElement("h1") must inherit property "align" with the proper type]
expected: FAIL
[HTMLParagraphElement interface: attribute align]
expected: FAIL
[HTMLParagraphElement interface: document.createElement("p") must inherit property "align" with the proper type]
expected: FAIL
[HTMLHRElement interface: attribute noShade]
expected: FAIL

View file

@ -191,120 +191,6 @@
[p.tabIndex: IDL set to -2147483648]
expected: FAIL
[p.align: typeof IDL attribute]
expected: FAIL
[p.align: IDL get with DOM attribute unset]
expected: FAIL
[p.align: setAttribute() to ""]
expected: FAIL
[p.align: 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 "]
expected: FAIL
[p.align: setAttribute() to undefined]
expected: FAIL
[p.align: setAttribute() to 7]
expected: FAIL
[p.align: setAttribute() to 1.5]
expected: FAIL
[p.align: setAttribute() to "5%"]
expected: FAIL
[p.align: setAttribute() to "+100"]
expected: FAIL
[p.align: setAttribute() to ".5"]
expected: FAIL
[p.align: setAttribute() to true]
expected: FAIL
[p.align: setAttribute() to false]
expected: FAIL
[p.align: setAttribute() to object "[object Object\]"]
expected: FAIL
[p.align: setAttribute() to NaN]
expected: FAIL
[p.align: setAttribute() to Infinity]
expected: FAIL
[p.align: setAttribute() to -Infinity]
expected: FAIL
[p.align: setAttribute() to "\\0"]
expected: FAIL
[p.align: setAttribute() to null]
expected: FAIL
[p.align: setAttribute() to object "test-toString"]
expected: FAIL
[p.align: setAttribute() to object "test-valueOf"]
expected: FAIL
[p.align: IDL set to ""]
expected: FAIL
[p.align: 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 "]
expected: FAIL
[p.align: IDL set to undefined]
expected: FAIL
[p.align: IDL set to 7]
expected: FAIL
[p.align: IDL set to 1.5]
expected: FAIL
[p.align: IDL set to "5%"]
expected: FAIL
[p.align: IDL set to "+100"]
expected: FAIL
[p.align: IDL set to ".5"]
expected: FAIL
[p.align: IDL set to true]
expected: FAIL
[p.align: IDL set to false]
expected: FAIL
[p.align: IDL set to object "[object Object\]"]
expected: FAIL
[p.align: IDL set to NaN]
expected: FAIL
[p.align: IDL set to Infinity]
expected: FAIL
[p.align: IDL set to -Infinity]
expected: FAIL
[p.align: IDL set to "\\0"]
expected: FAIL
[p.align: IDL set to null]
expected: FAIL
[p.align: IDL set to object "test-toString"]
expected: FAIL
[p.align: IDL set to object "test-valueOf"]
expected: FAIL
[hr.accessKey: typeof IDL attribute]
expected: FAIL