script: implement autofocus IDL reflection (#32170)

* script: implement autofocus IDL reflection

* test: update wpt results files
This commit is contained in:
Nolan Lawson 2024-04-29 08:05:15 -07:00 committed by GitHub
parent 6ca3bb440e
commit 3014e201ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 45 additions and 24193 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use dom_struct::dom_struct;
use html5ever::{namespace_url, ns, LocalName, Prefix};
use html5ever::{local_name, namespace_url, ns, LocalName, Prefix};
use js::rust::HandleObject;
use style_traits::dom::ElementState;
@ -76,4 +76,15 @@ impl SVGElementMethods for SVGElement {
)
})
}
// https://html.spec.whatwg.org/multipage/#dom-fe-autofocus
fn Autofocus(&self) -> bool {
self.element.has_attribute(&local_name!("autofocus"))
}
// https://html.spec.whatwg.org/multipage/#dom-fe-autofocus
fn SetAutofocus(&self, autofocus: bool) {
self.element
.set_bool_attribute(&local_name!("autofocus"), autofocus);
}
}