mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
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:
committed by
Andreas Kling
parent
ebe01b51c8
commit
50350fb79c
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user