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

LibWeb: Introduce the slottable concept for DOM elements and text nodes

A slottable is either a DOM element or a DOM text node. They may be
assigned to slots (HTMLSlotElement) either automatically or manually.
Automatic assignment occurs by matching a slot's `name` attribute to
a slottable's `slot` attribute. Manual assignment occurs by using the
slot's (not yet implemented) `assign` API.

This commit does not perform the above assignments. It just sets up the
slottable concept via IDL and hooks the slottable mixin into the element
and text nodes.
This commit is contained in:
Timothy Flynn 2023-09-05 13:07:35 -04:00 committed by Andreas Kling
parent b85a252753
commit 45b36bd08a
12 changed files with 116 additions and 1 deletions

View file

@ -10,6 +10,7 @@
#include <AK/DeprecatedFlyString.h>
#include <AK/DeprecatedString.h>
#include <LibWeb/DOM/CharacterData.h>
#include <LibWeb/DOM/Slottable.h>
namespace Web::DOM {
@ -19,7 +20,9 @@ public:
virtual void did_edit_text_node(Badge<HTML::BrowsingContext>) = 0;
};
class Text : public CharacterData {
class Text
: public CharacterData
, public SlottableMixin {
WEB_PLATFORM_OBJECT(Text, CharacterData);
public: