Script: Change script/dom/{bluetooth,canvas,html} to not rely on Deref<str> for DOMString (#39480)

This is part of the future work of implementing LazyDOMString as
outlined in https://github.com/servo/servo/issues/39479.

We use str() method or direct implementations on DOMString for these
methods. We also change some types.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>


Testing: This is essentially just renaming a method and a type and
should not change functionality.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
Narfinger 2025-09-25 17:53:21 +02:00 committed by GitHub
parent 1e471b9b41
commit a4c8ffe753
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 97 additions and 95 deletions

View file

@ -304,7 +304,7 @@ impl HTMLAreaElement {
pub(crate) fn get_shape_from_coords(&self) -> Option<Area> {
let elem = self.upcast::<Element>();
let shape = elem.get_string_attribute(&"shape".into());
let shp: Shape = match_ignore_ascii_case! { &shape,
let shp: Shape = match_ignore_ascii_case! { shape.str(),
"circle" => Shape::Circle,
"circ" => Shape::Circle,
"rectangle" => Shape::Rectangle,
@ -315,7 +315,7 @@ impl HTMLAreaElement {
};
if elem.has_attribute(&"coords".into()) {
let attribute = elem.get_string_attribute(&"coords".into());
Area::parse(&attribute, shp)
Area::parse(attribute.str(), shp)
} else {
None
}