mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 00:38:48 +00:00
LibWeb: Use HTML::AttributeNames::foo instead of FlyString("foo")
To avoid the costly instantiation of FlyStrings whenever we're looking up attributes, use the premade HTML::AttributeNames globals. :^)
This commit is contained in:
parent
ff55d00261
commit
2149820260
Notes:
sideshowbarker
2024-07-19 05:51:40 +09:00
Author: https://github.com/awesomekling
Commit: 2149820260
16 changed files with 71 additions and 43 deletions
|
@ -122,7 +122,7 @@ void HTMLImageElement::animate()
|
|||
int HTMLImageElement::preferred_width() const
|
||||
{
|
||||
bool ok = false;
|
||||
int width = attribute("width").to_int(ok);
|
||||
int width = attribute(HTML::AttributeNames::width).to_int(ok);
|
||||
if (ok)
|
||||
return width;
|
||||
|
||||
|
@ -135,7 +135,7 @@ int HTMLImageElement::preferred_width() const
|
|||
int HTMLImageElement::preferred_height() const
|
||||
{
|
||||
bool ok = false;
|
||||
int height = attribute("height").to_int(ok);
|
||||
int height = attribute(HTML::AttributeNames::height).to_int(ok);
|
||||
if (ok)
|
||||
return height;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue