1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:08:12 +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:
Shannon Booth 2023-09-03 14:58:18 +12:00 committed by Tim Flynn
parent da637a527d
commit 0f6782fae6
42 changed files with 141 additions and 141 deletions

View file

@ -60,7 +60,7 @@ void HTMLElement::visit_edges(Cell::Visitor& visitor)
// https://html.spec.whatwg.org/multipage/dom.html#dom-dir
DeprecatedString HTMLElement::dir() const
{
auto dir = attribute(HTML::AttributeNames::dir);
auto dir = deprecated_attribute(HTML::AttributeNames::dir);
#define __ENUMERATE_HTML_ELEMENT_DIR_ATTRIBUTE(keyword) \
if (dir.equals_ignoring_ascii_case(#keyword##sv)) \
return #keyword##sv;
@ -427,7 +427,7 @@ DeprecatedString HTMLElement::get_an_elements_target() const
// 1. If element has a target attribute, then return that attribute's value.
if (has_attribute(AttributeNames::target))
return attribute(AttributeNames::target);
return deprecated_attribute(AttributeNames::target);
// FIXME: 2. If element's node document contains a base element with a
// target attribute, then return the value of the target attribute of the
@ -441,7 +441,7 @@ DeprecatedString HTMLElement::get_an_elements_target() const
TokenizedFeature::NoOpener HTMLElement::get_an_elements_noopener(StringView target) const
{
// To get an element's noopener, given an a, area, or form element element and a string target:
auto rel = attribute(HTML::AttributeNames::rel).to_lowercase();
auto rel = deprecated_attribute(HTML::AttributeNames::rel).to_lowercase();
auto link_types = rel.view().split_view_if(Infra::is_ascii_whitespace);
// 1. If element's link types include the noopener or noreferrer keyword, then return true.