mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-06 19:22:53 +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:
parent
ebe01b51c8
commit
50350fb79c
Notes:
sideshowbarker
2024-07-17 01:27:18 +09:00
Author: https://github.com/shannonbooth
Commit: 50350fb79c
Pull-request: https://github.com/SerenityOS/serenity/pull/21283
17 changed files with 52 additions and 56 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue