mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-06 17:11:51 +00:00
LibWeb: Explicitly set Document's origin
As part of the effort of removing the default constructor of Origin, since document has the origin set after construction, port Document's origin over to an Optional<Origin>. This exposes that we were never setting the origin of the document during fragment parsing. For now, to maintain previous behaviour, let's explicitly set it to an opaque origin.
This commit is contained in:
parent
de79eb4410
commit
5deb8ba2f8
Notes:
github-actions[bot]
2025-06-17 18:55:25 +00:00
Author: https://github.com/shannonbooth
Commit: 5deb8ba2f8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5094
Reviewed-by: https://github.com/gmta ✅
3 changed files with 7 additions and 2 deletions
|
@ -4570,6 +4570,11 @@ Vector<GC::Root<DOM::Node>> HTMLParser::parse_html_fragment(DOM::Element& contex
|
|||
// This is required for Document::parse_url() to work inside iframe srcdoc documents.
|
||||
temp_document->set_about_base_url(context_element.document().about_base_url());
|
||||
|
||||
// AD-HOC: The origin is not otherwise set for the document, but it may be accessed during parsing
|
||||
// script. For now, let's just use an opaque origin, but it is likely that the spec is
|
||||
// missing setting this origin.
|
||||
temp_document->set_origin(URL::Origin {});
|
||||
|
||||
// 2. If context's node document is in quirks mode, then set document's mode to "quirks".
|
||||
if (context_element.document().in_quirks_mode())
|
||||
temp_document->set_quirks_mode(DOM::QuirksMode::Yes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue