diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index 0c7230266a..2698c06e32 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -22,6 +22,7 @@ #include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/WindowProxy.h> #include <LibWeb/HighResolutionTime/TimeOrigin.h> +#include <LibWeb/Infra/Strings.h> #include <LibWeb/Layout/BreakNode.h> #include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/TextNode.h> @@ -627,13 +628,13 @@ BrowsingContext::ChosenBrowsingContext BrowsingContext::choose_a_browsing_contex auto sandboxing_flag_set = active_document()->active_sandboxing_flag_set(); // 4. If name is the empty string or an ASCII case-insensitive match for "_self", then set chosen to current. - if (name.is_empty() || name.equals_ignoring_case("_self"sv)) { + if (name.is_empty() || Infra::is_ascii_case_insensitive_match(name, "_self"sv)) { chosen = this; } // 5. Otherwise, if name is an ASCII case-insensitive match for "_parent", set chosen to current's parent browsing // context, if any, and current otherwise. - else if (name.equals_ignoring_case("_parent"sv)) { + else if (Infra::is_ascii_case_insensitive_match(name, "_parent"sv)) { if (auto parent = this->parent()) chosen = parent; else @@ -642,7 +643,7 @@ BrowsingContext::ChosenBrowsingContext BrowsingContext::choose_a_browsing_contex // 6. Otherwise, if name is an ASCII case-insensitive match for "_top", set chosen to current's top-level browsing // context, if any, and current otherwise. - else if (name.equals_ignoring_case("_top"sv)) { + else if (Infra::is_ascii_case_insensitive_match(name, "_top"sv)) { chosen = &top_level_browsing_context(); } @@ -652,7 +653,7 @@ BrowsingContext::ChosenBrowsingContext BrowsingContext::choose_a_browsing_contex // set chosen to that browsing context. If there are multiple matching browsing contexts, the user agent // should set chosen to one in some arbitrary consistent manner, such as the most recently opened, most // recently focused, or more closely related. - else if (!name.equals_ignoring_case("_blank"sv)) { + else if (!Infra::is_ascii_case_insensitive_match(name, "_blank"sv)) { dbgln("FIXME: Find matching browser context for name {}", name); chosen = this; } else { @@ -715,7 +716,7 @@ BrowsingContext::ChosenBrowsingContext BrowsingContext::choose_a_browsing_contex // FIXME: Our BrowsingContexts do not have SandboxingFlagSets yet, only documents do // 6. If name is not an ASCII case-insensitive match for "_blank", then set chosen's name to name. - if (!name.equals_ignoring_case("_blank"sv)) + if (!Infra::is_ascii_case_insensitive_match(name, "_blank"sv)) chosen->set_name(name); } |