mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 20:42:21 +00:00
LibWeb: Re-implement HTML::Navigator using IDL
Get rid of the bespoke NavigatorObject class and use the modern IDL strategies for creating platform objects to re-implement Navigator and its associcated mixin interfaces. While we're here, implement it in a way that brings WorkerNavigator up to spec :^)
This commit is contained in:
parent
14e1513077
commit
2d5bee256e
Notes:
sideshowbarker
2024-07-17 06:09:30 +09:00
Author: https://github.com/ADKaster
Commit: 2d5bee256e
Pull-request: https://github.com/SerenityOS/serenity/pull/15520
27 changed files with 343 additions and 208 deletions
41
Userland/Libraries/LibWeb/HTML/Navigator.idl
Normal file
41
Userland/Libraries/LibWeb/HTML/Navigator.idl
Normal file
|
@ -0,0 +1,41 @@
|
|||
#import <HTML/NavigatorID.idl>
|
||||
#import <HTML/NavigatorLanguage.idl>
|
||||
#import <HTML/NavigatorOnLine.idl>
|
||||
#import <HTML/NavigatorConcurrentHardware.idl>
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/system-state.html#navigator
|
||||
[Exposed=Window]
|
||||
interface Navigator {
|
||||
// objects implementing this interface also implement the interfaces given below
|
||||
};
|
||||
|
||||
// NOTE: As NavigatorContentUtils, NavigatorCookies, and NavigatorPlugins are not used in WorkerNavigator,
|
||||
// we define them here.
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/system-state.html#navigatorcontentutils
|
||||
interface mixin NavigatorContentUtils {
|
||||
// FIXME: [SecureContext] undefined registerProtocolHandler(DOMString scheme, USVString url);
|
||||
// FIXME: [SecureContext] undefined unregisterProtocolHandler(DOMString scheme, USVString url);
|
||||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/system-state.html#navigatorcookies
|
||||
interface mixin NavigatorCookies {
|
||||
readonly attribute boolean cookieEnabled;
|
||||
};
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/system-state.html#navigatorplugins
|
||||
interface mixin NavigatorPlugins {
|
||||
// FIXME: [SameObject] readonly attribute PluginArray plugins;
|
||||
// FIXME: [SameObject] readonly attribute MimeTypeArray mimeTypes;
|
||||
boolean javaEnabled();
|
||||
readonly attribute boolean pdfViewerEnabled;
|
||||
};
|
||||
|
||||
Navigator includes NavigatorID;
|
||||
Navigator includes NavigatorLanguage;
|
||||
Navigator includes NavigatorOnLine;
|
||||
Navigator includes NavigatorContentUtils;
|
||||
Navigator includes NavigatorCookies;
|
||||
Navigator includes NavigatorPlugins;
|
||||
Navigator includes NavigatorConcurrentHardware;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue