mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
LibWeb/HTML: Fix crash in window open steps on empty URL string
This commit is contained in:
parent
e4fb25bf63
commit
4b069344e0
Notes:
github-actions[bot]
2024-12-11 01:16:57 +00:00
Author: https://github.com/shannonbooth
Commit: 4b069344e0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2871
3 changed files with 10 additions and 2 deletions
|
@ -221,8 +221,8 @@ WebIDL::ExceptionOr<Window::OpenedWindow> Window::window_open_steps_internal(Str
|
||||||
}
|
}
|
||||||
|
|
||||||
// 9. Let noopener be the result of getting noopener for window open with sourceDocument, tokenizedFeatures, and urlRecord.
|
// 9. Let noopener be the result of getting noopener for window open with sourceDocument, tokenizedFeatures, and urlRecord.
|
||||||
// FIXME: Is it safe to assume url_record has a value here?
|
// FIXME: Spec bug: https://github.com/whatwg/html/issues/10844
|
||||||
auto no_opener = get_noopener_for_window_open(source_document, tokenized_features, *url_record);
|
auto no_opener = get_noopener_for_window_open(source_document, tokenized_features, url_record.has_value() ? *url_record : URL::URL("about:blank"));
|
||||||
|
|
||||||
// 10. Remove tokenizedFeatures["noopener"] and tokenizedFeatures["noreferrer"].
|
// 10. Remove tokenizedFeatures["noopener"] and tokenizedFeatures["noreferrer"].
|
||||||
tokenized_features.remove("noopener"sv);
|
tokenized_features.remove("noopener"sv);
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
PASS! (Didn't crash)
|
|
@ -0,0 +1,7 @@
|
||||||
|
<script src="../include.js"></script>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
window.open();
|
||||||
|
println("PASS! (Didn't crash)");
|
||||||
|
})
|
||||||
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue