summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2021-09-03 19:11:51 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-03 23:20:23 +0200
commitd7b6cc6421c48185f4dfafb24d2b093b86305860 (patch)
tree7e5ace9318b73d4efe095c43605cd514db1cccaa /Userland/Libraries/LibWeb/Layout
parentbad23e3f8cc9c66d818ddb2f7bbe7bddce5c09e2 (diff)
downloadserenity-d7b6cc6421c48185f4dfafb24d2b093b86305860.zip
Everywhere: Prevent risky implicit casts of (Nonnull)RefPtr
Our existing implementation did not check the element type of the other pointer in the constructors and move assignment operators. This meant that some operations that would require explicit casting on raw pointers were done implicitly, such as: - downcasting a base class to a derived class (e.g. `Kernel::Inode` => `Kernel::ProcFSDirectoryInode` in Kernel/ProcFS.cpp), - casting to an unrelated type (e.g. `Promise<bool>` => `Promise<Empty>` in LibIMAP/Client.cpp) This, of course, allows gross violations of the type system, and makes the need to type-check less obvious before downcasting. Luckily, while adding the `static_ptr_cast`s, only two truly incorrect usages were found; in the other instances, our casts just needed to be made explicit.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout')
-rw-r--r--Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
index 74b52e9b41..955416f9a9 100644
--- a/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
+++ b/Userland/Libraries/LibWeb/Layout/TreeBuilder.cpp
@@ -166,7 +166,7 @@ void TreeBuilder::remove_irrelevant_boxes(NodeWithStyle& root)
{
// The following boxes are discarded as if they were display:none:
- NonnullRefPtrVector<Box> to_remove;
+ NonnullRefPtrVector<Node> to_remove;
// Children of a table-column.
for_each_in_tree_with_display<CSS::Display::TableColumn>(root, [&](Box& table_column) {