summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-01-23 17:24:34 +0100
committerAndreas Kling <kling@serenityos.org>2023-01-24 11:44:03 +0100
commitaa19c4a34028532a5e3f8453e3368fc0888dca23 (patch)
tree0512ed599231c5d4d1afe39d495680c3cda790c7 /Userland/Libraries/LibWeb
parent3dd006f7194c4849887497f3f9ce53f7e0c6a44f (diff)
downloadserenity-aa19c4a34028532a5e3f8453e3368fc0888dca23.zip
LibWeb: Add Layout::Node::is_table() and make is<TableBox>() fast
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/Layout/Node.h1
-rw-r--r--Userland/Libraries/LibWeb/Layout/TableBox.h6
2 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h
index cfaaa97c50..98ee636ad1 100644
--- a/Userland/Libraries/LibWeb/Layout/Node.h
+++ b/Userland/Libraries/LibWeb/Layout/Node.h
@@ -92,6 +92,7 @@ public:
virtual bool is_replaced_box() const { return false; }
virtual bool is_list_item_marker_box() const { return false; }
virtual bool is_table_wrapper() const { return false; }
+ virtual bool is_table() const { return false; }
template<typename T>
bool fast_is() const = delete;
diff --git a/Userland/Libraries/LibWeb/Layout/TableBox.h b/Userland/Libraries/LibWeb/Layout/TableBox.h
index caa33b5ce3..2fc6c12dd1 100644
--- a/Userland/Libraries/LibWeb/Layout/TableBox.h
+++ b/Userland/Libraries/LibWeb/Layout/TableBox.h
@@ -24,6 +24,12 @@ public:
return CSS::Display::from_short(CSS::Display::Short::InlineTable);
return CSS::Display::from_short(CSS::Display::Short::Table);
}
+
+private:
+ virtual bool is_table() const override { return true; }
};
+template<>
+inline bool Node::fast_is<TableBox>() const { return is_table(); }
+
}