summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp4
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp5
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp5
5 files changed, 8 insertions, 10 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
index 1ebfe88206..aa81e2a713 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
@@ -244,7 +244,7 @@ static bool is_form_control(DOM::Element const& element)
JS::NonnullGCPtr<DOM::HTMLCollection> HTMLFormElement::elements() const
{
if (!m_elements) {
- m_elements = DOM::HTMLCollection::create(const_cast<HTMLFormElement&>(*this), [](Element const& element) {
+ m_elements = DOM::HTMLCollection::create(const_cast<HTMLFormElement&>(*this), DOM::HTMLCollection::Scope::Descendants, [](Element const& element) {
return is_form_control(element);
}).release_value_but_fixme_should_propagate_errors();
}
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp
index 013a26ffa0..e3a2a10def 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionsCollection.cpp
@@ -19,7 +19,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<HTMLOptionsCollection>> HTMLOptionsCollecti
}
HTMLOptionsCollection::HTMLOptionsCollection(DOM::ParentNode& root, Function<bool(DOM::Element const&)> filter)
- : DOM::HTMLCollection(root, move(filter))
+ : DOM::HTMLCollection(root, Scope::Descendants, move(filter))
{
}
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp
index 8f8a3281c3..41b20d8cb0 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp
@@ -264,7 +264,7 @@ JS::NonnullGCPtr<DOM::HTMLCollection> HTMLTableElement::t_bodies()
// The tBodies attribute must return an HTMLCollection rooted at the table node,
// whose filter matches only tbody elements that are children of the table element.
if (!m_t_bodies) {
- m_t_bodies = DOM::HTMLCollection::create(*this, [](DOM::Element const& element) {
+ m_t_bodies = DOM::HTMLCollection::create(*this, DOM::HTMLCollection::Scope::Children, [](DOM::Element const& element) {
return element.local_name() == TagNames::tbody;
}).release_value_but_fixme_should_propagate_errors();
}
@@ -307,7 +307,7 @@ JS::NonnullGCPtr<DOM::HTMLCollection> HTMLTableElement::rows()
// How do you sort HTMLCollection?
if (!m_rows) {
- m_rows = DOM::HTMLCollection::create(*this, [table_node](DOM::Element const& element) {
+ m_rows = DOM::HTMLCollection::create(*this, DOM::HTMLCollection::Scope::Descendants, [table_node](DOM::Element const& element) {
// Only match TR elements which are:
// * children of the table element
// * children of the thead, tbody, or tfoot elements that are themselves children of the table element
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp
index efe5044f2c..c09dfc7fa4 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp
@@ -42,9 +42,8 @@ JS::NonnullGCPtr<DOM::HTMLCollection> HTMLTableRowElement::cells() const
// The cells attribute must return an HTMLCollection rooted at this tr element,
// whose filter matches only td and th elements that are children of the tr element.
if (!m_cells) {
- m_cells = DOM::HTMLCollection::create(const_cast<HTMLTableRowElement&>(*this), [this](Element const& element) {
- return element.parent() == this
- && is<HTMLTableCellElement>(element);
+ m_cells = DOM::HTMLCollection::create(const_cast<HTMLTableRowElement&>(*this), DOM::HTMLCollection::Scope::Children, [](Element const& element) {
+ return is<HTMLTableCellElement>(element);
}).release_value_but_fixme_should_propagate_errors();
}
return *m_cells;
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp
index 1a3c00ccfe..4fd9f72758 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp
@@ -41,9 +41,8 @@ JS::NonnullGCPtr<DOM::HTMLCollection> HTMLTableSectionElement::rows() const
// The rows attribute must return an HTMLCollection rooted at this element,
// whose filter matches only tr elements that are children of this element.
if (!m_rows) {
- m_rows = DOM::HTMLCollection::create(const_cast<HTMLTableSectionElement&>(*this), [this](Element const& element) {
- return element.parent() == this
- && is<HTMLTableRowElement>(element);
+ m_rows = DOM::HTMLCollection::create(const_cast<HTMLTableSectionElement&>(*this), DOM::HTMLCollection::Scope::Children, [](Element const& element) {
+ return is<HTMLTableRowElement>(element);
}).release_value_but_fixme_should_propagate_errors();
}
return *m_rows;