1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibWeb: Remove hand-rolled is_foo() helpers in Layout::Node classes

This commit is contained in:
Andreas Kling 2021-01-01 18:55:47 +01:00
parent 3bb0cb2202
commit 07dd73c351
31 changed files with 39 additions and 82 deletions

View file

@ -75,7 +75,7 @@ const Gfx::FloatRect LineBoxFragment::absolute_rect() const
int LineBoxFragment::text_index_at(float x) const
{
if (!layout_node().is_text())
if (!is<TextNode>(layout_node()))
return 0;
auto& layout_text = downcast<TextNode>(layout_node());
auto& font = layout_text.specified_style().font();
@ -108,7 +108,7 @@ Gfx::FloatRect LineBoxFragment::selection_rect(const Gfx::Font& font) const
auto selection = layout_node().root().selection().normalized();
if (!selection.is_valid())
return {};
if (!layout_node().is_text())
if (!is<TextNode>(layout_node()))
return {};
const auto start_index = m_start;