LibWeb: Early return if document doesn't have navigable in container
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

...navigable shared attribute processing steps.

After e095bf3a5f
https://wpt.live/html/rendering/pixel-length-attributes.html ends up in
this function with null navigable, which leads to crash while executing
steps. Adding early return in case iframe's document doesn't have a
navigable is enough to make the test pass again.

This commit doesn't import the WPT test, because it's already imported
and we have it disabled since it takes too much time on CI.
This commit is contained in:
Aliaksandr Kalenik 2025-09-07 22:45:14 +02:00 committed by Andreas Kling
commit 4a140b740c
Notes: github-actions[bot] 2025-09-08 10:13:31 +00:00

View file

@ -197,6 +197,9 @@ HTML::WindowProxy* NavigableContainer::content_window()
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#shared-attribute-processing-steps-for-iframe-and-frame-elements // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#shared-attribute-processing-steps-for-iframe-and-frame-elements
Optional<URL::URL> NavigableContainer::shared_attribute_processing_steps_for_iframe_and_frame(InitialInsertion initial_insertion) Optional<URL::URL> NavigableContainer::shared_attribute_processing_steps_for_iframe_and_frame(InitialInsertion initial_insertion)
{ {
if (!navigable())
return OptionalNone {};
// AD-HOC: If the element was added and immediately removed, the content navigable will be null. Don't process the // AD-HOC: If the element was added and immediately removed, the content navigable will be null. Don't process the
// src attribute any further. // src attribute any further.
if (!m_content_navigable) if (!m_content_navigable)