LibWeb/DOM: Set Document's origin in JS constructor

We were missing this spec step, which meant that the created
document had no origin, causing a crash when accessed for same-origin
checks.
This commit is contained in:
Shannon Booth 2025-06-18 14:52:11 +12:00 committed by Jelle Raaijmakers
commit fc62a05c98
Notes: github-actions[bot] 2025-06-18 06:50:19 +00:00
3 changed files with 11 additions and 3 deletions

View file

@ -178,7 +178,7 @@ public:
[[nodiscard]] static GC::Ref<Document> create(JS::Realm&, URL::URL const& url = URL::about_blank());
[[nodiscard]] static GC::Ref<Document> create_for_fragment_parsing(JS::Realm&);
static WebIDL::ExceptionOr<GC::Ref<Document>> construct_impl(JS::Realm&);
static GC::Ref<Document> construct_impl(JS::Realm&);
virtual ~Document() override;
// AD-HOC: This number increments whenever a node is added or removed from the document, or an element attribute changes.