1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

LibWeb: Add non-const version of paintable_box() in DOM::Node

This commit is contained in:
Aliaksandr Kalenik 2023-08-07 00:59:23 +02:00 committed by Andreas Kling
parent 6868ace8f4
commit c985a1b2af
5 changed files with 16 additions and 6 deletions

View file

@ -1454,6 +1454,15 @@ Painting::PaintableBox const* Node::paintable_box() const
return static_cast<Layout::Box const&>(*layout_node()).paintable_box();
}
Painting::PaintableBox* Node::paintable_box()
{
if (!layout_node())
return nullptr;
if (!layout_node()->is_box())
return nullptr;
return static_cast<Layout::Box&>(*layout_node()).paintable_box();
}
// https://dom.spec.whatwg.org/#queue-a-mutation-record
void Node::queue_mutation_record(FlyString const& type, DeprecatedString attribute_name, DeprecatedString attribute_namespace, DeprecatedString old_value, Vector<JS::Handle<Node>> added_nodes, Vector<JS::Handle<Node>> removed_nodes, Node* previous_sibling, Node* next_sibling) const
{