LibWeb: Teach HTMLObjectElement to negotiate natural size with SVGs

We do this by generalizing the code previously used for SVGSVGBox into
something that can be used for NavigableViewportContainer as well.
This commit is contained in:
Andreas Kling 2024-11-26 12:30:11 +01:00 committed by Andreas Kling
parent 2405805ddf
commit 733c6b14ff
Notes: github-actions[bot] 2024-11-26 17:58:55 +00:00
8 changed files with 386 additions and 358 deletions

View file

@ -1931,6 +1931,12 @@ void finalize_a_cross_document_navigation(GC::Ref<Navigable> navigable, HistoryH
// 10. Apply the push/replace history step targetStep to traversable.
traversable->apply_the_push_or_replace_history_step(target_step, history_handling, TraversableNavigable::SynchronousNavigation::No);
// AD-HOC: If we're inside a navigable container, let's trigger a relayout in the container document.
// This allows size negotiation between the containing document and SVG documents to happen.
if (auto container = navigable->container()) {
container->document().set_needs_layout();
}
}
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#url-and-history-update-steps