mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
This is enough for Firefox to display the Accessibility tab, containing our accessibility tree which can be inspected. Most information is blank for now. There's quite a bit of duplication between AccessibilityWalkerActor and WalkerActor - it might be worth trying to make a base class once the details are figured out. Frustratingly, the two don't work quite the same: for a lot of messages that would be sent to WalkerActor, the accessibility equivalent is sent to the AccessibilityNodeActor instead. Co-authored-by: Tim Flynn <trflynn89@pm.me>
37 lines
980 B
C++
37 lines
980 B
C++
/*
|
|
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibDevTools/Actor.h>
|
|
|
|
namespace DevTools {
|
|
|
|
class DEVTOOLS_API AccessibilityActor final : public Actor {
|
|
public:
|
|
static constexpr auto base_name = "accessibility"sv;
|
|
|
|
static NonnullRefPtr<AccessibilityActor> create(DevToolsServer&, String name, WeakPtr<TabActor>);
|
|
virtual ~AccessibilityActor() override;
|
|
|
|
static RefPtr<TabActor> tab_for(WeakPtr<AccessibilityActor> const&);
|
|
static RefPtr<AccessibilityWalkerActor> walker_for(WeakPtr<AccessibilityActor> const&);
|
|
|
|
void enable();
|
|
|
|
private:
|
|
AccessibilityActor(DevToolsServer&, String name, WeakPtr<TabActor>);
|
|
|
|
virtual void handle_message(Message const&) override;
|
|
|
|
void received_accessibility_tree(JsonObject& response, JsonObject accessibility_tree);
|
|
|
|
WeakPtr<TabActor> m_tab;
|
|
WeakPtr<AccessibilityWalkerActor> m_walker;
|
|
bool m_enabled { false };
|
|
};
|
|
|
|
}
|