mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-18 08:20:44 +00:00
Everywhere: Hoist the Services folder to the top-level
This commit is contained in:
parent
a7dc40eff3
commit
22e0eeada2
Notes:
github-actions[bot]
2024-11-10 11:52:06 +00:00
Author: https://github.com/trflynn89
Commit: 22e0eeada2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
68 changed files with 41 additions and 41 deletions
43
Services/WebContent/ConsoleGlobalEnvironmentExtensions.h
Normal file
43
Services/WebContent/ConsoleGlobalEnvironmentExtensions.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
|
||||
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
||||
namespace WebContent {
|
||||
|
||||
class ConsoleGlobalEnvironmentExtensions final : public JS::Object {
|
||||
JS_OBJECT(ConsoleGlobalEnvironmentExtensions, JS::Object);
|
||||
JS_DECLARE_ALLOCATOR(ConsoleGlobalEnvironmentExtensions);
|
||||
|
||||
public:
|
||||
ConsoleGlobalEnvironmentExtensions(JS::Realm&, Web::HTML::Window&);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual ~ConsoleGlobalEnvironmentExtensions() override = default;
|
||||
|
||||
void set_most_recent_result(JS::Value result) { m_most_recent_result = move(result); }
|
||||
|
||||
private:
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
// $0, the DOM node currently selected in the inspector
|
||||
JS_DECLARE_NATIVE_FUNCTION($0_getter);
|
||||
// $_, the value of the most recent expression entered into the console
|
||||
JS_DECLARE_NATIVE_FUNCTION($__getter);
|
||||
// $(selector, element), equivalent to `(element || document).querySelector(selector)`
|
||||
JS_DECLARE_NATIVE_FUNCTION($_function);
|
||||
// $$(selector, element), equivalent to `(element || document).querySelectorAll(selector)`
|
||||
JS_DECLARE_NATIVE_FUNCTION($$_function);
|
||||
|
||||
JS::NonnullGCPtr<Web::HTML::Window> m_window_object;
|
||||
JS::Value m_most_recent_result { JS::js_undefined() };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue