1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibWeb: Fix typo in query of link element search params

Regressed in 21fe86d235
This commit is contained in:
Shannon Booth 2023-08-15 00:47:27 +12:00 committed by Andreas Kling
parent 934340d845
commit 099a069b86
3 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1 @@
?q=some:query

View file

@ -0,0 +1,7 @@
<a id="link-with-query" rel="search" href="https://serenityos.org/search?q=some:query"</a>
<script src="include.js"></script>
<script>
window.onload = function() {
println(document.getElementById("link-with-query").search);
}
</script>

View file

@ -330,7 +330,7 @@ DeprecatedString HTMLHyperlinkElementUtils::search() const
// 2. Let url be this element's url.
// 3. If url is null, or url's query is either null or the empty string, return the empty string.
if (!m_url.has_value() || m_url->query().has_value() || m_url->query()->is_empty())
if (!m_url.has_value() || !m_url->query().has_value() || m_url->query()->is_empty())
return DeprecatedString::empty();
// 4. Return "?", followed by url's query.