#include "third_party/blink/renderer/core/html/html_collection.h"
#include "third_party/blink/renderer/core/dom/class_collection.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/node_rare_data.h"
#include "third_party/blink/renderer/core/html/collection_type.h"
#include "third_party/blink/renderer/core/html/document_all_name_collection.h"
#include "third_party/blink/renderer/core/html/document_name_collection.h"
#include "third_party/blink/renderer/core/html/forms/html_data_list_options_collection.h"
#include "third_party/blink/renderer/core/html/forms/html_field_set_element.h"
#include "third_party/blink/renderer/core/html/forms/html_form_control_element.h"
#include "third_party/blink/renderer/core/html/forms/html_form_element.h"
#include "third_party/blink/renderer/core/html/forms/html_option_element.h"
#include "third_party/blink/renderer/core/html/forms/html_options_collection.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html/html_object_element.h"
#include "third_party/blink/renderer/core/html/html_tag_collection.h"
#include "third_party/blink/renderer/core/html/window_name_collection.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"
namespace blink {
static bool ShouldTypeOnlyIncludeDirectChildren(CollectionType type) { … }
static NodeListSearchRoot SearchRootFromCollectionType(
const ContainerNode& owner,
CollectionType type) { … }
static NodeListInvalidationType InvalidationTypeExcludingIdAndNameAttributes(
CollectionType type) { … }
HTMLCollection::HTMLCollection(ContainerNode& owner_node,
CollectionType type,
ItemAfterOverrideType item_after_override_type)
: … { … }
HTMLCollection::~HTMLCollection() = default;
void HTMLCollection::InvalidateCache(Document* old_document) const { … }
unsigned HTMLCollection::length() const { … }
Element* HTMLCollection::item(unsigned offset) const { … }
static inline bool IsMatchingHTMLElement(const HTMLCollection& html_collection,
const HTMLElement& element) { … }
inline bool HTMLCollection::ElementMatches(const Element& element) const { … }
namespace {
template <class HTMLCollectionType>
class IsMatch { … };
}
template <class HTMLCollectionType>
static inline IsMatch<HTMLCollectionType> MakeIsMatch(
const HTMLCollectionType& list) { … }
Element* HTMLCollection::VirtualItemAfter(Element*) const { … }
static inline bool NameShouldBeVisibleInDocumentAll(
const HTMLElement& element) { … }
Element* HTMLCollection::TraverseToFirst() const { … }
Element* HTMLCollection::TraverseToLast() const { … }
Element* HTMLCollection::TraverseForwardToOffset(
unsigned offset,
Element& current_element,
unsigned& current_offset) const { … }
Element* HTMLCollection::TraverseBackwardToOffset(
unsigned offset,
Element& current_element,
unsigned& current_offset) const { … }
Element* HTMLCollection::namedItem(const AtomicString& name) const { … }
bool HTMLCollection::NamedPropertyQuery(const AtomicString& name,
ExceptionState&) { … }
void HTMLCollection::SupportedPropertyNames(Vector<String>& names) { … }
void HTMLCollection::NamedPropertyEnumerator(Vector<String>& names,
ExceptionState&) { … }
void HTMLCollection::UpdateIdNameCache() const { … }
void HTMLCollection::NamedItems(const AtomicString& name,
HeapVector<Member<Element>>& result) const { … }
bool HTMLCollection::HasNamedItems(const AtomicString& name) const { … }
HTMLCollection::NamedItemCache::NamedItemCache() = default;
void HTMLCollection::Trace(Visitor* visitor) const { … }
}