mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Make HTMLSlotElement::assigned_{elements,nodes} methods const
This commit is contained in:
parent
398bf10b92
commit
23473d64ca
Notes:
sideshowbarker
2024-07-17 17:49:11 +09:00
Author: https://github.com/tcl3
Commit: 23473d64ca
Pull-request: https://github.com/SerenityOS/serenity/pull/24207
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/shannonbooth ✅
2 changed files with 4 additions and 4 deletions
|
@ -38,7 +38,7 @@ void HTMLSlotElement::visit_edges(JS::Cell::Visitor& visitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignednodes
|
// https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignednodes
|
||||||
Vector<JS::Handle<DOM::Node>> HTMLSlotElement::assigned_nodes(AssignedNodesOptions options)
|
Vector<JS::Handle<DOM::Node>> HTMLSlotElement::assigned_nodes(AssignedNodesOptions options) const
|
||||||
{
|
{
|
||||||
// 1. If options["flatten"] is false, then return this's assigned nodes.
|
// 1. If options["flatten"] is false, then return this's assigned nodes.
|
||||||
if (!options.flatten) {
|
if (!options.flatten) {
|
||||||
|
@ -59,7 +59,7 @@ Vector<JS::Handle<DOM::Node>> HTMLSlotElement::assigned_nodes(AssignedNodesOptio
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignedelements
|
// https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignedelements
|
||||||
Vector<JS::Handle<DOM::Element>> HTMLSlotElement::assigned_elements(AssignedNodesOptions options)
|
Vector<JS::Handle<DOM::Element>> HTMLSlotElement::assigned_elements(AssignedNodesOptions options) const
|
||||||
{
|
{
|
||||||
// 1. If options["flatten"] is false, then return this's assigned nodes, filtered to contain only Element nodes.
|
// 1. If options["flatten"] is false, then return this's assigned nodes, filtered to contain only Element nodes.
|
||||||
if (!options.flatten) {
|
if (!options.flatten) {
|
||||||
|
|
|
@ -29,8 +29,8 @@ class HTMLSlotElement final
|
||||||
public:
|
public:
|
||||||
virtual ~HTMLSlotElement() override;
|
virtual ~HTMLSlotElement() override;
|
||||||
|
|
||||||
Vector<JS::Handle<DOM::Node>> assigned_nodes(AssignedNodesOptions options = {});
|
Vector<JS::Handle<DOM::Node>> assigned_nodes(AssignedNodesOptions options = {}) const;
|
||||||
Vector<JS::Handle<DOM::Element>> assigned_elements(AssignedNodesOptions options = {});
|
Vector<JS::Handle<DOM::Element>> assigned_elements(AssignedNodesOptions options = {}) const;
|
||||||
|
|
||||||
using SlottableHandle = Variant<JS::Handle<DOM::Element>, JS::Handle<DOM::Text>>;
|
using SlottableHandle = Variant<JS::Handle<DOM::Element>, JS::Handle<DOM::Text>>;
|
||||||
void assign(Vector<SlottableHandle> nodes);
|
void assign(Vector<SlottableHandle> nodes);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue