chromium/third_party/blink/renderer/core/lcp_critical_path_predictor/element_locator.cc

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/core/lcp_critical_path_predictor/element_locator.h"

#include "base/containers/span.h"
#include "base/logging.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/html/parser/html_token.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"

namespace blink::element_locator {

ElementLocator OfElement(const Element& element) {}

String ToStringForTesting(const ElementLocator& locator) {}

void HTMLStackItem::IncrementChildrenCount(
    const StringImpl* children_tag_name) {}

namespace {

// Set of element tag names that needs to run a "close a p element" step in
// https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inbody
// Do not modify this set outside TokenStreamMatcher::InitSets() to avoid race
// conditions.
HashSet<const StringImpl*>& ClosePElementSet() {}

// The list of tags that their start tag tokens need to be closed immediately,
// with the following spec text:
// <spec>Insert an HTML element for the token. Immediately pop the current node
// off the stack of open elements.</spec>
// Do not modify this set outside TokenStreamMatcher::InitSets() to avoid race
// conditions.
HashSet<const StringImpl*>& ImmediatelyPopTheCurrentNodeTags() {}

// A restricted of tags against which this TokenStreamMatcher will initiate
// a match, when match_against_restricted_set flag is turned on, to reduce
// performance hit.
HashSet<const StringImpl*>& RestrictedTagSubset() {}

}  // namespace

void TokenStreamMatcher::InitSets() {}

TokenStreamMatcher::TokenStreamMatcher(Vector<ElementLocator> locators)
    :{}

TokenStreamMatcher::~TokenStreamMatcher() = default;
namespace {

bool MatchLocator(const ElementLocator& locator,
                  base::span<const HTMLStackItem> stack) {}

}  // namespace

void TokenStreamMatcher::ObserveEndTag(const StringImpl* tag_name) {}

#ifndef NDEBUG

void TokenStreamMatcher::DumpHTMLStack() {}

#endif

bool TokenStreamMatcher::ObserveStartTagAndReportMatch(
    const StringImpl* tag_name,
    const HTMLToken& token) {}

}  // namespace blink::element_locator