mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:17:44 +00:00
LibWeb: Move CallbackType from Bindings/ to WebIDL/
Let's stop putting generic types and AOs from the Web IDL spec into the Bindings namespace and directory in LibWeb, and instead follow our usual naming rules of 'directory = namespace = spec name'. The IDL namespace is already used by LibIDL, so Web::WebIDL seems like a good choice.
This commit is contained in:
parent
dc44effd44
commit
4f73851afc
43 changed files with 168 additions and 165 deletions
25
Userland/Libraries/LibWeb/WebIDL/CallbackType.cpp
Normal file
25
Userland/Libraries/LibWeb/WebIDL/CallbackType.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibWeb/WebIDL/CallbackType.h>
|
||||
|
||||
namespace Web::WebIDL {
|
||||
|
||||
CallbackType::CallbackType(JS::Object& callback, HTML::EnvironmentSettingsObject& callback_context)
|
||||
: callback(callback)
|
||||
, callback_context(callback_context)
|
||||
{
|
||||
}
|
||||
|
||||
StringView CallbackType::class_name() const { return "CallbackType"sv; }
|
||||
void CallbackType::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Cell::visit_edges(visitor);
|
||||
visitor.visit(&callback);
|
||||
}
|
||||
|
||||
}
|
30
Userland/Libraries/LibWeb/WebIDL/CallbackType.h
Normal file
30
Userland/Libraries/LibWeb/WebIDL/CallbackType.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
|
||||
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::WebIDL {
|
||||
|
||||
// https://heycam.github.io/webidl/#idl-callback-interface
|
||||
class CallbackType final : public JS::Cell {
|
||||
public:
|
||||
CallbackType(JS::Object& callback, HTML::EnvironmentSettingsObject& callback_context);
|
||||
|
||||
JS::Object& callback;
|
||||
|
||||
// https://heycam.github.io/webidl/#dfn-callback-context
|
||||
HTML::EnvironmentSettingsObject& callback_context;
|
||||
|
||||
private:
|
||||
virtual StringView class_name() const override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue