From 15944c5b266fe7a77c2b159da1290ac8470ddc62 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sat, 19 Aug 2023 13:41:57 +1200 Subject: [PATCH] LibWeb: Const qualify HTMLCollection::length --- Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp | 2 +- Userland/Libraries/LibWeb/DOM/HTMLCollection.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp index 9eb8d5dd7f..d61fe9da0a 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp +++ b/Userland/Libraries/LibWeb/DOM/HTMLCollection.cpp @@ -60,7 +60,7 @@ JS::MarkedVector HTMLCollection::collect_matching_elements() const } // https://dom.spec.whatwg.org/#dom-htmlcollection-length -size_t HTMLCollection::length() +size_t HTMLCollection::length() const { // The length getter steps are to return the number of nodes represented by the collection. return collect_matching_elements().size(); diff --git a/Userland/Libraries/LibWeb/DOM/HTMLCollection.h b/Userland/Libraries/LibWeb/DOM/HTMLCollection.h index 49faad306f..4d1d332525 100644 --- a/Userland/Libraries/LibWeb/DOM/HTMLCollection.h +++ b/Userland/Libraries/LibWeb/DOM/HTMLCollection.h @@ -38,7 +38,7 @@ public: virtual ~HTMLCollection() override; - size_t length(); + size_t length() const; Element* item(size_t index) const; Element* named_item(DeprecatedFlyString const& name) const;