1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 17:05:06 +00:00

LibWeb: Add about base url to the various AOs that construct documents

And some assorted cleanup along the way. The browsing context and
document AOs in particular need re-alignment with the spec.
This commit is contained in:
Andrew Kaster 2023-09-22 17:31:25 -06:00 committed by Andrew Kaster
parent dc0f7c4c54
commit 7e277797ad
5 changed files with 28 additions and 2 deletions

View file

@ -80,12 +80,18 @@ WebIDL::ExceptionOr<void> NavigableContainer::create_new_child_navigable()
target_name = String::from_deprecated_string(value).release_value_but_fixme_should_propagate_errors();
// 6. Let documentState be a new document state, with
// document: document
// navigable target name: targetName
// - document: document
// - initiator origin: document's origin
// - origin: document's origin
// - navigable target name: targetName
// - about base URL: document's about base URL
JS::NonnullGCPtr<DocumentState> document_state = *heap().allocate_without_realm<HTML::DocumentState>();
document_state->set_document(document);
document_state->set_initiator_origin(document->origin());
document_state->set_origin(document->origin());
if (target_name.has_value())
document_state->set_navigable_target_name(*target_name);
document_state->set_about_base_url(document->about_base_url());
// 7. Let navigable be a new navigable.
JS::NonnullGCPtr<Navigable> navigable = *heap().allocate_without_realm<Navigable>();