#include "third_party/blink/renderer/core/html/custom/custom_element_registry.h"
#include <limits>
#include "base/auto_reset.h"
#include "third_party/blink/public/web/web_custom_element.h"
#include "third_party/blink/renderer/bindings/core/v8/script_custom_element_definition_builder.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_element_definition_options.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/html/custom/ce_reactions_scope.h"
#include "third_party/blink/renderer/core/html/custom/custom_element.h"
#include "third_party/blink/renderer/core/html/custom/custom_element_definition.h"
#include "third_party/blink/renderer/core/html/custom/custom_element_definition_builder.h"
#include "third_party/blink/renderer/core/html/custom/custom_element_descriptor.h"
#include "third_party/blink/renderer/core/html/custom/custom_element_reaction_stack.h"
#include "third_party/blink/renderer/core/html/custom/custom_element_upgrade_sorter.h"
#include "third_party/blink/renderer/core/html_element_type_helpers.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
namespace blink {
namespace {
void CollectUpgradeCandidateInNode(Node& root,
HeapVector<Member<Element>>& candidates) { … }
bool ThrowIfInvalidName(const AtomicString& name,
bool allow_embedder_names,
ExceptionState& exception_state) { … }
bool ThrowIfValidName(const AtomicString& name,
ExceptionState& exception_state) { … }
}
CustomElementRegistry* CustomElementRegistry::Create(
ScriptState* script_state) { … }
CustomElementRegistry::CustomElementRegistry(const LocalDOMWindow* owner)
: … { … }
void CustomElementRegistry::Trace(Visitor* visitor) const { … }
CustomElementDefinition* CustomElementRegistry::define(
ScriptState* script_state,
const AtomicString& name,
V8CustomElementConstructor* constructor,
const ElementDefinitionOptions* options,
ExceptionState& exception_state) { … }
CustomElementDefinition* CustomElementRegistry::DefineInternal(
ScriptState* script_state,
const AtomicString& name,
CustomElementDefinitionBuilder& builder,
const ElementDefinitionOptions* options,
ExceptionState& exception_state) { … }
ScriptValue CustomElementRegistry::get(const AtomicString& name) { … }
const AtomicString& CustomElementRegistry::getName(
V8CustomElementConstructor* constructor) { … }
CustomElementDefinition* CustomElementRegistry::DefinitionFor(
const CustomElementDescriptor& desc) const { … }
bool CustomElementRegistry::NameIsDefined(const AtomicString& name) const { … }
CustomElementDefinition* CustomElementRegistry::DefinitionForName(
const AtomicString& name) const { … }
CustomElementDefinition* CustomElementRegistry::DefinitionForConstructor(
V8CustomElementConstructor* constructor) const { … }
CustomElementDefinition* CustomElementRegistry::DefinitionForConstructor(
v8::Local<v8::Object> constructor) const { … }
void CustomElementRegistry::AddCandidate(Element& candidate) { … }
ScriptPromise<V8CustomElementConstructor> CustomElementRegistry::whenDefined(
ScriptState* script_state,
const AtomicString& name,
ExceptionState& exception_state) { … }
void CustomElementRegistry::CollectCandidates(
const CustomElementDescriptor& desc,
HeapVector<Member<Element>>* elements) { … }
void CustomElementRegistry::upgrade(Node* root) { … }
bool CustomElementRegistry::IsGlobalRegistry() const { … }
void CustomElementRegistry::AssociatedWith(Document& document) { … }
}