2020-05-18 21:42:40 +02:00
/*
* Copyright ( c ) 2020 , Andreas Kling < kling @ serenityos . org >
2022-03-05 00:15:36 +01:00
* Copyright ( c ) 2022 , Linus Groh < linusg @ serenityos . org >
2020-05-18 21:42:40 +02:00
*
2021-04-22 01:24:48 -07:00
* SPDX - License - Identifier : BSD - 2 - Clause
2020-05-18 21:42:40 +02:00
*/
# pragma once
2022-03-05 00:17:47 +01:00
# include <AK/URL.h>
2021-09-28 23:54:42 +01:00
# include <LibJS/Runtime/Completion.h>
2020-05-18 21:42:40 +02:00
# include <LibJS/Runtime/Object.h>
# include <LibWeb/Forward.h>
namespace Web {
namespace Bindings {
class LocationObject final : public JS : : Object {
2020-06-21 15:14:02 +02:00
JS_OBJECT ( LocationObject , JS : : Object ) ;
2020-05-18 21:42:40 +02:00
public :
2020-06-20 17:28:13 +02:00
explicit LocationObject ( JS : : GlobalObject & ) ;
2020-07-22 17:50:18 +02:00
virtual void initialize ( JS : : GlobalObject & ) override ;
2020-05-18 21:42:40 +02:00
virtual ~ LocationObject ( ) override ;
2021-09-28 23:54:42 +01:00
virtual JS : : ThrowCompletionOr < bool > internal_set_prototype_of ( Object * prototype ) override ;
2021-09-29 00:02:05 +01:00
virtual JS : : ThrowCompletionOr < bool > internal_is_extensible ( ) const override ;
2021-09-29 00:13:41 +01:00
virtual JS : : ThrowCompletionOr < bool > internal_prevent_extensions ( ) override ;
2021-09-12 14:54:17 +01:00
// FIXME: There should also be a custom [[GetPrototypeOf]], [[GetOwnProperty]], [[DefineOwnProperty]], [[Get]], [[Set]], [[Delete]] and [[OwnPropertyKeys]],
// but we don't have the infrastructure in place to implement them yet.
2020-05-18 21:42:40 +02:00
private :
2022-03-05 00:15:36 +01:00
DOM : : Document const * relevant_document ( ) const ;
2022-03-05 00:17:47 +01:00
AK : : URL url ( ) const ;
2022-03-05 00:15:36 +01:00
2021-10-31 08:21:02 -04:00
JS_DECLARE_NATIVE_FUNCTION ( reload ) ;
JS_DECLARE_NATIVE_FUNCTION ( replace ) ;
JS_DECLARE_NATIVE_FUNCTION ( href_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( href_setter ) ;
JS_DECLARE_NATIVE_FUNCTION ( host_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( hostname_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( pathname_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( hash_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( search_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( protocol_getter ) ;
JS_DECLARE_NATIVE_FUNCTION ( port_getter ) ;
2020-05-18 21:42:40 +02:00
} ;
}
}