mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Stub Geolocation API
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This commit is contained in:
parent
f3c1dfb2f1
commit
22bda8e5e2
Notes:
github-actions[bot]
2025-06-21 08:01:30 +00:00
Author: https://github.com/gmta
Commit: 22bda8e5e2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5143
25 changed files with 480 additions and 57 deletions
|
@ -2,6 +2,7 @@
|
|||
* Copyright (c) 2022, Andrew Kaster <akaster@serenityos.org>
|
||||
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
|
||||
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
|
||||
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -12,6 +13,7 @@
|
|||
#include <LibWeb/Bindings/NavigatorPrototype.h>
|
||||
#include <LibWeb/Clipboard/Clipboard.h>
|
||||
#include <LibWeb/CredentialManagement/CredentialsContainer.h>
|
||||
#include <LibWeb/Geolocation/Geolocation.h>
|
||||
#include <LibWeb/HTML/Navigator.h>
|
||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
@ -66,6 +68,7 @@ void Navigator::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_mime_type_array);
|
||||
visitor.visit(m_plugin_array);
|
||||
visitor.visit(m_clipboard);
|
||||
visitor.visit(m_geolocation);
|
||||
visitor.visit(m_user_activation);
|
||||
visitor.visit(m_service_worker_container);
|
||||
visitor.visit(m_media_capabilities);
|
||||
|
@ -93,6 +96,13 @@ GC::Ref<Clipboard::Clipboard> Navigator::clipboard()
|
|||
return *m_clipboard;
|
||||
}
|
||||
|
||||
GC::Ref<Geolocation::Geolocation> Navigator::geolocation()
|
||||
{
|
||||
if (!m_geolocation)
|
||||
m_geolocation = realm().create<Geolocation::Geolocation>(realm());
|
||||
return *m_geolocation;
|
||||
}
|
||||
|
||||
GC::Ref<UserActivation> Navigator::user_activation()
|
||||
{
|
||||
if (!m_user_activation)
|
||||
|
|
|
@ -53,6 +53,7 @@ public:
|
|||
[[nodiscard]] GC::Ref<MimeTypeArray> mime_types();
|
||||
[[nodiscard]] GC::Ref<PluginArray> plugins();
|
||||
[[nodiscard]] GC::Ref<Clipboard::Clipboard> clipboard();
|
||||
[[nodiscard]] GC::Ref<Geolocation::Geolocation> geolocation();
|
||||
[[nodiscard]] GC::Ref<UserActivation> user_activation();
|
||||
[[nodiscard]] GC::Ref<CredentialManagement::CredentialsContainer> credentials();
|
||||
|
||||
|
@ -83,6 +84,9 @@ private:
|
|||
// https://w3c.github.io/clipboard-apis/#dom-navigator-clipboard
|
||||
GC::Ptr<Clipboard::Clipboard> m_clipboard;
|
||||
|
||||
// https://w3c.github.io/geolocation/#navigator_interface
|
||||
GC::Ptr<Geolocation::Geolocation> m_geolocation;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/interaction.html#dom-navigator-useractivation
|
||||
GC::Ptr<UserActivation> m_user_activation;
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#import <Clipboard/Clipboard.idl>
|
||||
#import <CredentialManagement/CredentialsContainer.idl>
|
||||
#import <Geolocation/Geolocation.idl>
|
||||
#import <HTML/MimeTypeArray.idl>
|
||||
#import <HTML/NavigatorBeacon.idl>
|
||||
#import <HTML/NavigatorConcurrentHardware.idl>
|
||||
|
@ -21,6 +22,9 @@ interface Navigator {
|
|||
// https://w3c.github.io/clipboard-apis/#navigator-interface
|
||||
[SecureContext, SameObject] readonly attribute Clipboard clipboard;
|
||||
|
||||
// https://w3c.github.io/geolocation/#navigator_interface
|
||||
[SameObject] readonly attribute Geolocation geolocation;
|
||||
|
||||
// https://w3c.github.io/pointerevents/#extensions-to-the-navigator-interface
|
||||
readonly attribute long maxTouchPoints;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue