LibWeb: Implement Document/BrowsingContext hookup according to spec

We now implement the browsing context's "set active document" algorithm
from the spec, as well as the "discard" algorithm for browsing contexts
and documents.
This commit is contained in:
Andreas Kling 2022-09-20 21:44:42 +02:00
parent ab8432783e
commit 92deba7197
Notes: sideshowbarker 2024-07-17 06:51:48 +09:00
9 changed files with 189 additions and 70 deletions

View file

@ -235,7 +235,7 @@ void HTMLObjectElement::run_object_representation_handler_steps(Optional<String>
else if (resource_type.has_value() && resource_type->starts_with("image/"sv)) {
// If the object element's nested browsing context is non-null, then it must be discarded and then set to null.
if (m_nested_browsing_context) {
discard_nested_browsing_context();
m_nested_browsing_context->discard();
m_nested_browsing_context = nullptr;
}
@ -276,7 +276,7 @@ void HTMLObjectElement::run_object_representation_fallback_steps()
{
// 6. Fallback: The object element represents the element's children, ignoring any leading param element children. This is the element's fallback content. If the element has an instantiated plugin, then unload it. If the element's nested browsing context is non-null, then it must be discarded and then set to null.
if (m_nested_browsing_context) {
discard_nested_browsing_context();
m_nested_browsing_context->discard();
m_nested_browsing_context = nullptr;
}