1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:17:35 +00:00

LibWeb: Remove more hand-rolled type information :^)

Hoo boy, we've really accumulated a lot of this stuff.
This commit is contained in:
Andreas Kling 2021-01-01 18:12:33 +01:00
parent d2613403e0
commit 3bb0cb2202
15 changed files with 5 additions and 40 deletions

View file

@ -39,7 +39,7 @@ void Event::append_to_path(EventTarget& invocation_target, RefPtr<EventTarget> s
if (is<Node>(invocation_target)) {
auto& invocation_target_node = downcast<Node>(invocation_target);
if (invocation_target_node.root()->is_shadow_root())
if (is<ShadowRoot>(invocation_target_node.root()))
invocation_target_in_shadow_tree = true;
if (is<ShadowRoot>(invocation_target_node)) {
auto& invocation_target_shadow_root = downcast<ShadowRoot>(invocation_target_node);

View file

@ -149,9 +149,6 @@ public:
m_stop_immediate_propagation = true;
}
virtual bool is_ui_event() const { return false; }
virtual bool is_mouse_event() const { return false; }
protected:
explicit Event(const FlyString& type)
: m_type(type)

View file

@ -57,7 +57,7 @@ static EventTarget* retarget(EventTarget* left, [[maybe_unused]] EventTarget* ri
auto* left_node = downcast<Node>(left);
auto* left_root = left_node->root();
if (!left_root->is_shadow_root())
if (!is<ShadowRoot>(left_root))
return left;
// FIXME: If right is a node and lefts root is a shadow-including inclusive ancestor of right, return left.

View file

@ -63,9 +63,6 @@ public:
const Vector<EventListenerRegistration>& listeners() const { return m_listeners; }
virtual bool is_node() const { return false; }
virtual bool is_window() const { return false; }
Function<void(const Event&)> activation_behaviour;
// NOTE: These only exist for checkbox and radio input elements.

View file

@ -77,10 +77,6 @@ public:
bool is_document_fragment() const { return type() == NodeType::DOCUMENT_FRAGMENT_NODE; }
bool is_parent_node() const { return is_element() || is_document() || is_document_fragment(); }
bool is_slottable() const { return is_element() || is_text(); }
virtual bool is_svg_element() const { return false; }
virtual bool is_shadow_root() const { return false; }
virtual bool is_node() const final { return true; }
virtual bool is_editable() const;
@ -103,9 +99,6 @@ public:
String child_text_content() const;
virtual bool is_html_element() const { return false; }
virtual bool is_unknown_html_element() const { return false; }
Node* root();
const Node* root() const
{

View file

@ -42,9 +42,6 @@ public:
bool available_to_element_internals() const { return m_available_to_element_internals; }
void set_available_to_element_internals(bool available_to_element_internals) { m_available_to_element_internals = available_to_element_internals; }
// ^Node
virtual bool is_shadow_root() const override { return true; }
// ^EventTarget
virtual EventTarget* get_parent(const Event&) override;

View file

@ -79,8 +79,6 @@ public:
HighResolutionTime::Performance& performance() { return *m_performance; }
virtual bool is_window() const override { return true; }
const Event* current_event() const { return m_current_event; }
void set_current_event(Event* event) { m_current_event = event; }