LibWeb: Add a non-DeprecatedString version of Element::get_attribute

Renaming the DeprecatedString version of this function to
Element::get_deprecated_attribute.

While performing this rename, port over functions where it is trivial to
do so to the Optional<String> version of this function.
This commit is contained in:
Shannon Booth 2023-10-01 17:46:26 +13:00 committed by Andreas Kling
parent ebe01b51c8
commit 50350fb79c
Notes: sideshowbarker 2024-07-17 01:27:18 +09:00
17 changed files with 52 additions and 56 deletions

View file

@ -175,7 +175,7 @@ unsigned HTMLImageElement::width() const
return paintable_box->content_width().to_int();
// NOTE: This step seems to not be in the spec, but all browsers do it.
auto width_attr = get_attribute(HTML::AttributeNames::width);
auto width_attr = deprecated_get_attribute(HTML::AttributeNames::width);
if (auto converted = width_attr.to_uint(); converted.has_value())
return *converted;
@ -203,7 +203,7 @@ unsigned HTMLImageElement::height() const
return paintable_box->content_height().to_int();
// NOTE: This step seems to not be in the spec, but all browsers do it.
auto height_attr = get_attribute(HTML::AttributeNames::height);
auto height_attr = deprecated_get_attribute(HTML::AttributeNames::height);
if (auto converted = height_attr.to_uint(); converted.has_value())
return *converted;