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
Notes: sideshowbarker 2024-07-17 09:41:18 +09:00
5 changed files with 28 additions and 2 deletions

View file

@ -71,9 +71,18 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<TraversableNavigable>> TraversableNavigable
// document: document
document_state->set_document(document);
// initiator origin: null if opener is null; otherwise, document's origin
document_state->set_initiator_origin(opener ? Optional<Origin> {} : document->origin());
// origin: document's origin
document_state->set_origin(document->origin());
// navigable target name: targetName
document_state->set_navigable_target_name(target_name);
// about base URL: document's about base URL
document_state->set_about_base_url(document->about_base_url());
// 5. Let traversable be a new traversable navigable.
auto traversable = vm.heap().allocate_without_realm<TraversableNavigable>(page);