mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 10:09:14 +00:00
LibWeb: Port HTMLHyperlinkElementUtils from DeprecatedString to String
This commit is contained in:
parent
9888db1c27
commit
0a4586d510
Notes:
sideshowbarker
2024-07-17 02:29:45 +09:00
Author: https://github.com/shannonbooth
Commit: 0a4586d510
Pull-request: https://github.com/SerenityOS/serenity/pull/21997
Reviewed-by: https://github.com/AtkinsSJ ✅
8 changed files with 64 additions and 67 deletions
|
@ -424,20 +424,21 @@ Optional<ARIA::Role> HTMLElement::default_role() const
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/semantics.html#get-an-element's-target
|
||||
DeprecatedString HTMLElement::get_an_elements_target() const
|
||||
String HTMLElement::get_an_elements_target() const
|
||||
{
|
||||
// To get an element's target, given an a, area, or form element element, run these steps:
|
||||
|
||||
// 1. If element has a target attribute, then return that attribute's value.
|
||||
if (has_attribute(AttributeNames::target))
|
||||
return deprecated_attribute(AttributeNames::target);
|
||||
auto maybe_target = attribute(AttributeNames::target);
|
||||
if (maybe_target.has_value())
|
||||
return maybe_target.release_value();
|
||||
|
||||
// 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
|
||||
// first such base element.
|
||||
|
||||
// 3. Return the empty string.
|
||||
return DeprecatedString::empty();
|
||||
return String {};
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/links.html#get-an-element's-noopener
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue