mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
LibWeb: Make LocationObject a PlatformObject
This commit is contained in:
parent
2fe97fa8db
commit
0e47754ac8
Notes:
sideshowbarker
2024-07-17 07:24:38 +09:00
Author: https://github.com/awesomekling
Commit: 0e47754ac8
Pull-request: https://github.com/SerenityOS/serenity/pull/14816
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/linusg ✅
2 changed files with 21 additions and 9 deletions
|
@ -23,9 +23,18 @@ namespace Web::Bindings {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/history.html#the-location-interface
|
||||
LocationObject::LocationObject(JS::Realm& realm)
|
||||
: Object(verify_cast<HTML::Window>(realm.global_object()).cached_web_prototype("Location"))
|
||||
, m_default_properties(heap())
|
||||
: PlatformObject(realm)
|
||||
{
|
||||
set_prototype(&verify_cast<HTML::Window>(realm.global_object()).cached_web_prototype("Location"));
|
||||
}
|
||||
|
||||
LocationObject::~LocationObject() = default;
|
||||
|
||||
void LocationObject::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
for (auto& property : m_default_properties)
|
||||
visitor.visit(property);
|
||||
}
|
||||
|
||||
void LocationObject::initialize(JS::Realm& realm)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue