mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:58:11 +00:00
LibWeb: Rename Element::attribute to Element::deprecated_attribute
This should allow us to add a Element::attribute which returns an Optional<String>. Eventually all callers should be ported to switch from the DeprecatedString version, but in the meantime, this should allow us to port some more IDL interfaces away from DeprecatedString.
This commit is contained in:
parent
da637a527d
commit
0f6782fae6
42 changed files with 141 additions and 141 deletions
|
@ -64,8 +64,8 @@ void HTMLCanvasElement::apply_presentational_hints(CSS::StyleProperties& style)
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/rendering.html#map-to-the-aspect-ratio-property
|
||||
// if element has both attributes w and h, and parsing those attributes' values using the rules for parsing non-negative integers doesn't generate an error for either
|
||||
auto w = parse_non_negative_integer(attribute(HTML::AttributeNames::width));
|
||||
auto h = parse_non_negative_integer(attribute(HTML::AttributeNames::height));
|
||||
auto w = parse_non_negative_integer(deprecated_attribute(HTML::AttributeNames::width));
|
||||
auto h = parse_non_negative_integer(deprecated_attribute(HTML::AttributeNames::height));
|
||||
|
||||
if (w.has_value() && h.has_value())
|
||||
// then the user agent is expected to use the parsed integers as a presentational hint for the 'aspect-ratio' property of the form auto w / h.
|
||||
|
@ -83,7 +83,7 @@ unsigned HTMLCanvasElement::width() const
|
|||
// The rules for parsing non-negative integers must be used to obtain their numeric values.
|
||||
// If an attribute is missing, or if parsing its value returns an error, then the default value must be used instead.
|
||||
// The width attribute defaults to 300
|
||||
return parse_non_negative_integer(attribute(HTML::AttributeNames::width)).value_or(300);
|
||||
return parse_non_negative_integer(deprecated_attribute(HTML::AttributeNames::width)).value_or(300);
|
||||
}
|
||||
|
||||
unsigned HTMLCanvasElement::height() const
|
||||
|
@ -92,7 +92,7 @@ unsigned HTMLCanvasElement::height() const
|
|||
// The rules for parsing non-negative integers must be used to obtain their numeric values.
|
||||
// If an attribute is missing, or if parsing its value returns an error, then the default value must be used instead.
|
||||
// the height attribute defaults to 150
|
||||
return parse_non_negative_integer(attribute(HTML::AttributeNames::height)).value_or(150);
|
||||
return parse_non_negative_integer(deprecated_attribute(HTML::AttributeNames::height)).value_or(150);
|
||||
}
|
||||
|
||||
void HTMLCanvasElement::reset_context_to_default_state()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue