mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +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: https://github.com/LadybirdBrowser/ladybird/commit/4b069344e0a 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.
|
||||
// FIXME: Is it safe to assume url_record has a value here?
|
||||
auto no_opener = get_noopener_for_window_open(source_document, tokenized_features, *url_record);
|
||||
// FIXME: Spec bug: https://github.com/whatwg/html/issues/10844
|
||||
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"].
|
||||
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
Reference in a new issue