diff --git a/Libraries/LibWeb/HTML/Window.cpp b/Libraries/LibWeb/HTML/Window.cpp index dd0774ee5e..c57ff134a8 100644 --- a/Libraries/LibWeb/HTML/Window.cpp +++ b/Libraries/LibWeb/HTML/Window.cpp @@ -221,8 +221,8 @@ WebIDL::ExceptionOr 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); diff --git a/Tests/LibWeb/Text/expected/HTML/Window-open-empty-string.txt b/Tests/LibWeb/Text/expected/HTML/Window-open-empty-string.txt new file mode 100644 index 0000000000..50586a4cbf --- /dev/null +++ b/Tests/LibWeb/Text/expected/HTML/Window-open-empty-string.txt @@ -0,0 +1 @@ +PASS! (Didn't crash) diff --git a/Tests/LibWeb/Text/input/HTML/Window-open-empty-string.html b/Tests/LibWeb/Text/input/HTML/Window-open-empty-string.html new file mode 100644 index 0000000000..c10b55a51b --- /dev/null +++ b/Tests/LibWeb/Text/input/HTML/Window-open-empty-string.html @@ -0,0 +1,7 @@ + +