mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 02:28:12 +00:00
LibWeb: Implement (most of) the assigned slot/slottable lookup APIs
This implements looking up a slottable's assigned slot, and a slot's list of assigned slottables. For the latter, only unflattened lookups are implemented so far.
This commit is contained in:
parent
b602ee7ddd
commit
683ce8e615
2 changed files with 33 additions and 6 deletions
|
@ -25,8 +25,11 @@ void SlottableMixin::visit_edges(JS::Cell::Visitor& visitor)
|
|||
// https://dom.spec.whatwg.org/#dom-slotable-assignedslot
|
||||
JS::GCPtr<HTML::HTMLSlotElement> SlottableMixin::assigned_slot()
|
||||
{
|
||||
// FIXME: The assignedSlot getter steps are to return the result of find a slot given this and with the open flag set.
|
||||
return nullptr;
|
||||
auto* node = dynamic_cast<DOM::Node*>(this);
|
||||
VERIFY(node);
|
||||
|
||||
// The assignedSlot getter steps are to return the result of find a slot given this and with the open flag set.
|
||||
return find_a_slot(node->as_slottable(), OpenFlag::Set);
|
||||
}
|
||||
|
||||
JS::GCPtr<HTML::HTMLSlotElement> assigned_slot_for_node(JS::NonnullGCPtr<Node> node)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue