chromium/third_party/blink/renderer/core/dom/element.cc

/*
 * Copyright (C) 1999 Lars Knoll ([email protected])
 *           (C) 1999 Antti Koivisto ([email protected])
 *           (C) 2001 Peter Kelly ([email protected])
 *           (C) 2001 Dirk Mueller ([email protected])
 *           (C) 2007 David Smith ([email protected])
 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
 * All rights reserved.
 *           (C) 2007 Eric Seidel ([email protected])
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#include "third_party/blink/renderer/core/dom/element.h"

#include <algorithm>
#include <bitset>
#include <limits>
#include <memory>
#include <utility>

#include "base/feature_list.h"
#include "cc/input/snap_selection_strategy.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_metric_builder.h"
#include "third_party/blink/public/common/privacy_budget/identifiability_study_settings.h"
#include "third_party/blink/public/mojom/scroll/scroll_into_view_params.mojom-blink.h"
#include "third_party/blink/public/web/web_autofill_state.h"
#include "third_party/blink/renderer/bindings/core/v8/dictionary.h"
#include "third_party/blink/renderer/bindings/core/v8/frozen_array.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_aria_notification_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_check_visibility_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_pointer_lock_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_scroll_into_view_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_scroll_to_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_shadow_root_init.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_boolean_scrollintoviewoptions.h"
#include "third_party/blink/renderer/core/accessibility/ax_context.h"
#include "third_party/blink/renderer/core/accessibility/ax_object_cache.h"
#include "third_party/blink/renderer/core/animation/css/css_animations.h"
#include "third_party/blink/renderer/core/animation/element_animations.h"
#include "third_party/blink/renderer/core/aom/accessible_node.h"
#include "third_party/blink/renderer/core/aom/computed_accessible_node.h"
#include "third_party/blink/renderer/core/css/container_query_data.h"
#include "third_party/blink/renderer/core/css/container_query_evaluator.h"
#include "third_party/blink/renderer/core/css/css_identifier_value.h"
#include "third_party/blink/renderer/core/css/css_markup.h"
#include "third_party/blink/renderer/core/css/css_numeric_literal_value.h"
#include "third_party/blink/renderer/core/css/css_primitive_value.h"
#include "third_party/blink/renderer/core/css/css_property_value_set.h"
#include "third_party/blink/renderer/core/css/css_selector_watch.h"
#include "third_party/blink/renderer/core/css/css_style_sheet.h"
#include "third_party/blink/renderer/core/css/css_value.h"
#include "third_party/blink/renderer/core/css/cssom/inline_style_property_map.h"
#include "third_party/blink/renderer/core/css/native_paint_image_generator.h"
#include "third_party/blink/renderer/core/css/out_of_flow_data.h"
#include "third_party/blink/renderer/core/css/parser/css_parser.h"
#include "third_party/blink/renderer/core/css/parser/css_selector_parser.h"
#include "third_party/blink/renderer/core/css/post_style_update_scope.h"
#include "third_party/blink/renderer/core/css/property_set_css_style_declaration.h"
#include "third_party/blink/renderer/core/css/resolver/selector_filter_parent_scope.h"
#include "third_party/blink/renderer/core/css/resolver/style_adjuster.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver_stats.h"
#include "third_party/blink/renderer/core/css/selector_query.h"
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#include "third_party/blink/renderer/core/css/style_containment_scope_tree.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/css_value_keywords.h"
#include "third_party/blink/renderer/core/display_lock/display_lock_context.h"
#include "third_party/blink/renderer/core/display_lock/display_lock_document_state.h"
#include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h"
#include "third_party/blink/renderer/core/dom/attr.h"
#include "third_party/blink/renderer/core/dom/container_node.h"
#include "third_party/blink/renderer/core/dom/dataset_dom_string_map.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/document_lifecycle.h"
#include "third_party/blink/renderer/core/dom/document_part_root.h"
#include "third_party/blink/renderer/core/dom/dom_token_list.h"
#include "third_party/blink/renderer/core/dom/element_data_cache.h"
#include "third_party/blink/renderer/core/dom/element_rare_data_vector.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/events/event_dispatch_forbidden_scope.h"
#include "third_party/blink/renderer/core/dom/events/event_dispatch_result.h"
#include "third_party/blink/renderer/core/dom/events/event_dispatcher.h"
#include "third_party/blink/renderer/core/dom/events/event_path.h"
#include "third_party/blink/renderer/core/dom/first_letter_pseudo_element.h"
#include "third_party/blink/renderer/core/dom/flat_tree_traversal.h"
#include "third_party/blink/renderer/core/dom/focus_params.h"
#include "third_party/blink/renderer/core/dom/layout_tree_builder.h"
#include "third_party/blink/renderer/core/dom/mutation_observer_interest_group.h"
#include "third_party/blink/renderer/core/dom/mutation_record.h"
#include "third_party/blink/renderer/core/dom/named_node_map.h"
#include "third_party/blink/renderer/core/dom/node_cloning_data.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/presentation_attribute_style.h"
#include "third_party/blink/renderer/core/dom/pseudo_element.h"
#include "third_party/blink/renderer/core/dom/scriptable_document_parser.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/dom/slot_assignment.h"
#include "third_party/blink/renderer/core/dom/space_split_string.h"
#include "third_party/blink/renderer/core/dom/text.h"
#include "third_party/blink/renderer/core/dom/whitespace_attacher.h"
#include "third_party/blink/renderer/core/editing/commands/undo_stack.h"
#include "third_party/blink/renderer/core/editing/editing_utilities.h"
#include "third_party/blink/renderer/core/editing/editor.h"
#include "third_party/blink/renderer/core/editing/ephemeral_range.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/editing/ime/edit_context.h"
#include "third_party/blink/renderer/core/editing/ime/input_method_controller.h"
#include "third_party/blink/renderer/core/editing/selection_template.h"
#include "third_party/blink/renderer/core/editing/serializers/serialization.h"
#include "third_party/blink/renderer/core/editing/set_selection_options.h"
#include "third_party/blink/renderer/core/editing/visible_selection.h"
#include "third_party/blink/renderer/core/event_type_names.h"
#include "third_party/blink/renderer/core/events/focus_event.h"
#include "third_party/blink/renderer/core/events/interest_event.h"
#include "third_party/blink/renderer/core/events/keyboard_event.h"
#include "third_party/blink/renderer/core/execution_context/agent.h"
#include "third_party/blink/renderer/core/execution_context/security_context.h"
#include "third_party/blink/renderer/core/frame/csp/content_security_policy.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/fullscreen/fullscreen.h"
#include "third_party/blink/renderer/core/geometry/dom_rect.h"
#include "third_party/blink/renderer/core/geometry/dom_rect_list.h"
#include "third_party/blink/renderer/core/html/anchor_element_observer.h"
#include "third_party/blink/renderer/core/html/canvas/html_canvas_element.h"
#include "third_party/blink/renderer/core/html/custom/custom_element.h"
#include "third_party/blink/renderer/core/html/custom/custom_element_registry.h"
#include "third_party/blink/renderer/core/html/forms/html_button_element.h"
#include "third_party/blink/renderer/core/html/forms/html_data_list_element.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_controls_collection.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/forms/html_options_collection.h"
#include "third_party/blink/renderer/core/html/forms/html_select_element.h"
#include "third_party/blink/renderer/core/html/forms/html_select_list_element.h"
#include "third_party/blink/renderer/core/html/html_anchor_element.h"
#include "third_party/blink/renderer/core/html/html_area_element.h"
#include "third_party/blink/renderer/core/html/html_body_element.h"
#include "third_party/blink/renderer/core/html/html_collection.h"
#include "third_party/blink/renderer/core/html/html_dialog_element.h"
#include "third_party/blink/renderer/core/html/html_document.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html/html_frame_element_base.h"
#include "third_party/blink/renderer/core/html/html_frame_owner_element.h"
#include "third_party/blink/renderer/core/html/html_html_element.h"
#include "third_party/blink/renderer/core/html/html_image_element.h"
#include "third_party/blink/renderer/core/html/html_link_element.h"
#include "third_party/blink/renderer/core/html/html_plugin_element.h"
#include "third_party/blink/renderer/core/html/html_quote_element.h"
#include "third_party/blink/renderer/core/html/html_script_element.h"
#include "third_party/blink/renderer/core/html/html_slot_element.h"
#include "third_party/blink/renderer/core/html/html_style_element.h"
#include "third_party/blink/renderer/core/html/html_table_rows_collection.h"
#include "third_party/blink/renderer/core/html/html_template_element.h"
#include "third_party/blink/renderer/core/html/media/html_video_element.h"
#include "third_party/blink/renderer/core/html/nesting_level_incrementer.h"
#include "third_party/blink/renderer/core/html/parser/html_element_stack.h"
#include "third_party/blink/renderer/core/html/parser/html_parser_idioms.h"
#include "third_party/blink/renderer/core/html/shadow/shadow_element_names.h"
#include "third_party/blink/renderer/core/html_element_type_helpers.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/input/event_handler.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/intersection_observer/element_intersection_observer_data.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer_controller.h"
#include "third_party/blink/renderer/core/keywords.h"
#include "third_party/blink/renderer/core/layout/adjust_for_absolute_zoom.h"
#include "third_party/blink/renderer/core/layout/layout_text_combine.h"
#include "third_party/blink/renderer/core/layout/layout_text_fragment.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/loader/render_blocking_resource_manager.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/page/focus_controller.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/page/page_animator.h"
#include "third_party/blink/renderer/core/page/pointer_lock_controller.h"
#include "third_party/blink/renderer/core/page/scrolling/root_scroller_controller.h"
#include "third_party/blink/renderer/core/page/scrolling/sync_scroll_attempt_heuristic.h"
#include "third_party/blink/renderer/core/page/spatial_navigation.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/probe/core_probes.h"
#include "third_party/blink/renderer/core/resize_observer/resize_observation.h"
#include "third_party/blink/renderer/core/resize_observer/resize_observer_size.h"
#include "third_party/blink/renderer/core/scroll/scroll_into_view_util.h"
#include "third_party/blink/renderer/core/scroll/scrollable_area.h"
#include "third_party/blink/renderer/core/scroll/scrollbar_theme.h"
#include "third_party/blink/renderer/core/scroll/smooth_scroll_sequencer.h"
#include "third_party/blink/renderer/core/speculation_rules/document_speculation_rules.h"
#include "third_party/blink/renderer/core/style/computed_style_constants.h"
#include "third_party/blink/renderer/core/svg/svg_a_element.h"
#include "third_party/blink/renderer/core/svg/svg_animated_href.h"
#include "third_party/blink/renderer/core/svg/svg_element.h"
#include "third_party/blink/renderer/core/svg/svg_stop_element.h"
#include "third_party/blink/renderer/core/svg/svg_svg_element.h"
#include "third_party/blink/renderer/core/svg/svg_use_element.h"
#include "third_party/blink/renderer/core/svg_names.h"
#include "third_party/blink/renderer/core/trustedtypes/trusted_types_util.h"
#include "third_party/blink/renderer/core/view_transition/view_transition_pseudo_element_base.h"
#include "third_party/blink/renderer/core/view_transition/view_transition_supplement.h"
#include "third_party/blink/renderer/core/view_transition/view_transition_transition_element.h"
#include "third_party/blink/renderer/core/view_transition/view_transition_utils.h"
#include "third_party/blink/renderer/core/xml_names.h"
#include "third_party/blink/renderer/platform/bindings/dom_data_store.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/v8_dom_activity_logger.h"
#include "third_party/blink/renderer/platform/bindings/v8_dom_wrapper.h"
#include "third_party/blink/renderer/platform/bindings/v8_per_context_data.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/thread_state.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/language.h"
#include "third_party/blink/renderer/platform/region_capture_crop_id.h"
#include "third_party/blink/renderer/platform/restriction_target_id.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/text/bidi_paragraph.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
#include "third_party/blink/renderer/platform/wtf/hash_functions.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/text/text_position.h"
#include "ui/accessibility/ax_mode.h"
#include "ui/gfx/geometry/rect_conversions.h"

namespace blink {

namespace {

class DisplayLockStyleScope {};

bool IsRootEditableElementWithCounting(const Element& element) {}

bool HasLeftwardDirection(const Element& element) {}

bool HasUpwardDirection(const Element& element) {}

// TODO(meredithl): Automatically generate this method once the IDL compiler has
// been refactored. See http://crbug.com/839389 for details.
bool IsElementReflectionAttribute(const QualifiedName& name) {}

HeapLinkedHashSet<WeakMember<Element>>* GetExplicitlySetElementsForAttr(
    const Element* element,
    const QualifiedName& name) {}

// Checks that the given element |candidate| is a descendant of
// |attribute_element|'s  shadow including ancestors.
bool ElementIsDescendantOfShadowIncludingAncestor(
    const Element& attribute_element,
    const Element& candidate) {}

// The first algorithm in
// https://html.spec.whatwg.org/C/#the-autofocus-attribute
void EnqueueAutofocus(Element& element) {}

bool WillUpdateSizeContainerDuringLayout(const LayoutObject& layout_object) {}

bool IsValidShadowHostName(const AtomicString& local_name) {}

}  // namespace

Element::Element(const QualifiedName& tag_name,
                 Document* document,
                 ConstructionType type)
    :{}

Element* Element::GetAnimationTarget() {}

bool Element::HasElementFlag(ElementFlags mask) const {}

void Element::SetElementFlag(ElementFlags mask, bool value) {}

void Element::ClearElementFlag(ElementFlags mask) {}

void Element::ClearTabIndexExplicitlyIfNeeded() {}

void Element::SetTabIndexExplicitly() {}

void Element::setTabIndex(int value) {}

int Element::tabIndex() const {}

int Element::DefaultTabIndex() const {}

bool Element::IsFocusableStyle(UpdateBehavior update_behavior) const {}

Node* Element::Clone(Document& factory,
                     NodeCloningData& data,
                     ContainerNode* append_to,
                     ExceptionState& append_exception_state) const {}

Element& Element::CloneWithChildren(
    NodeCloningData& data,
    Document* nullable_factory,
    ContainerNode* append_to,
    ExceptionState& append_exception_state) const {}

Element& Element::CloneWithoutChildren() const {}

Element& Element::CloneWithoutChildren(NodeCloningData& data,
                                       Document* nullable_factory) const {}

Element& Element::CloneWithoutAttributesAndChildren(Document& factory) const {}

Attr* Element::DetachAttribute(wtf_size_t index) {}

void Element::DetachAttrNodeAtIndex(Attr* attr, wtf_size_t index) {}

void Element::removeAttribute(const QualifiedName& name) {}

void Element::SetBooleanAttribute(const QualifiedName& name, bool value) {}

bool Element::HasExplicitlySetAttrAssociatedElements(
    const QualifiedName& name) {}

void Element::SynchronizeContentAttributeAndElementReference(
    const QualifiedName& name) {}

void Element::SetElementAttribute(const QualifiedName& name, Element* element) {}

Element* Element::GetShadowReferenceTarget(const QualifiedName& name) const {}

Element* Element::GetShadowReferenceTargetOrSelf(const QualifiedName& name) {}

const Element* Element::GetShadowReferenceTargetOrSelf(
    const QualifiedName& name) const {}

Element* Element::getElementByIdIncludingDisconnected(
    const Element& element,
    const AtomicString& id) const {}

Element* Element::GetElementAttribute(const QualifiedName& name) const {}

Element* Element::GetElementAttributeResolvingReferenceTarget(
    const QualifiedName& name) const {}

HeapVector<Member<Element>>* Element::GetAttrAssociatedElements(
    const QualifiedName& name,
    bool resolve_reference_target) {}

FrozenArray<Element>* Element::GetElementArrayAttribute(
    const QualifiedName& name) {}

void Element::SetElementArrayAttribute(
    const QualifiedName& name,
    const HeapVector<Member<Element>>* given_elements) {}

FrozenArray<Element>* Element::ariaControlsElements() {}
void Element::setAriaControlsElements(
    HeapVector<Member<Element>>* given_elements) {}

FrozenArray<Element>* Element::ariaDescribedByElements() {}
void Element::setAriaDescribedByElements(
    HeapVector<Member<Element>>* given_elements) {}

FrozenArray<Element>* Element::ariaDetailsElements() {}
void Element::setAriaDetailsElements(
    HeapVector<Member<Element>>* given_elements) {}

FrozenArray<Element>* Element::ariaErrorMessageElements() {}
void Element::setAriaErrorMessageElements(
    HeapVector<Member<Element>>* given_elements) {}

FrozenArray<Element>* Element::ariaFlowToElements() {}
void Element::setAriaFlowToElements(
    HeapVector<Member<Element>>* given_elements) {}

FrozenArray<Element>* Element::ariaLabelledByElements() {}
void Element::setAriaLabelledByElements(
    HeapVector<Member<Element>>* given_elements) {}

FrozenArray<Element>* Element::ariaOwnsElements() {}
void Element::setAriaOwnsElements(HeapVector<Member<Element>>* given_elements) {}

NamedNodeMap* Element::attributesForBindings() const {}

AttributeNamesView Element::getAttributeNamesForBindings() const {}

Vector<AtomicString> Element::getAttributeNames() const {}

inline ElementRareDataVector* Element::GetElementRareData() const {}

inline ElementRareDataVector& Element::EnsureElementRareData() {}

void Element::RemovePopoverData() {}

PopoverData* Element::EnsurePopoverData() {}
PopoverData* Element::GetPopoverData() const {}

void Element::InterestGained() {}

Element* Element::anchorElement() const {}

// For JavaScript binding, return the anchor element without resolving the
// reference target, to avoid exposing shadow root content to JS.
Element* Element::anchorElementForBinding() const {}

void Element::setAnchorElementForBinding(Element* new_element) {}

inline void Element::SynchronizeAttribute(const QualifiedName& name) const {}

ElementAnimations* Element::GetElementAnimations() const {}

ElementAnimations& Element::EnsureElementAnimations() {}

bool Element::HasAnimations() const {}

bool Element::hasAttribute(const QualifiedName& name) const {}

bool Element::HasAttributeIgnoringNamespace(
    const AtomicString& local_name) const {}

void Element::SynchronizeAllAttributes() const {}

void Element::SynchronizeAllAttributesExceptStyle() const {}

const AtomicString& Element::getAttribute(const QualifiedName& name) const {}

AtomicString Element::LowercaseIfNecessary(AtomicString name) const {}

const AtomicString& Element::nonce() const {}

void Element::setNonce(const AtomicString& nonce) {}

void Element::scrollIntoView(const V8UnionBooleanOrScrollIntoViewOptions* arg) {}

void Element::scrollIntoView(bool align_to_top) {}

void Element::scrollIntoViewWithOptions(const ScrollIntoViewOptions* options) {}

void Element::ScrollIntoViewNoVisualUpdate(
    mojom::blink::ScrollIntoViewParamsPtr params) {}

void Element::scrollIntoViewIfNeeded(bool center_if_needed) {}

int Element::OffsetLeft() {}

int Element::OffsetTop() {}

int Element::OffsetWidth() {}

int Element::OffsetHeight() {}

Element* Element::OffsetParent() {}

int Element::clientLeft() {}

int Element::clientTop() {}

int Element::ClientLeftNoLayout() const {}

int Element::ClientTopNoLayout() const {}

void Element::LastRememberedSizeChanged(ResizeObserverSize* size) {}

bool Element::ShouldUpdateLastRememberedBlockSize() const {}

bool Element::ShouldUpdateLastRememberedInlineSize() const {}

void Element::SetLastRememberedInlineSize(std::optional<LayoutUnit> size) {}

void Element::SetLastRememberedBlockSize(std::optional<LayoutUnit> size) {}

std::optional<LayoutUnit> Element::LastRememberedInlineSize() const {}

std::optional<LayoutUnit> Element::LastRememberedBlockSize() const {}

bool Element::IsViewportScrollElement() {}

void Element::RecordScrollbarSizeForStudy(int measurement,
                                          bool is_width,
                                          bool is_offset) {}

int Element::clientWidth() {}

int Element::clientHeight() {}

double Element::currentCSSZoom() {}

LayoutBox* Element::GetLayoutBoxForScrolling() const {}

double Element::scrollLeft() {}

double Element::scrollTop() {}

void Element::setScrollLeft(double new_left) {}

void Element::setScrollTop(double new_top) {}

int Element::scrollWidth() {}

int Element::scrollHeight() {}

void Element::scrollBy(double x, double y) {}

void Element::scrollBy(const ScrollToOptions* scroll_to_options) {}

void Element::scrollTo(double x, double y) {}

void Element::scrollTo(const ScrollToOptions* scroll_to_options) {}

void Element::ScrollLayoutBoxBy(const ScrollToOptions* scroll_to_options) {}

void Element::ScrollLayoutBoxTo(const ScrollToOptions* scroll_to_options) {}

void Element::ScrollFrameBy(const ScrollToOptions* scroll_to_options) {}

void Element::ScrollFrameTo(const ScrollToOptions* scroll_to_options) {}

gfx::Rect Element::BoundsInWidget() const {}

Vector<gfx::Rect> Element::OutlineRectsInWidget(
    DocumentUpdateReason reason) const {}

gfx::Rect Element::VisibleBoundsInLocalRoot() const {}

void Element::ClientQuads(Vector<gfx::QuadF>& quads) const {}

DOMRectList* Element::getClientRects() {}

gfx::RectF Element::GetBoundingClientRectNoLifecycleUpdateNoAdjustment() const {}

gfx::RectF Element::GetBoundingClientRectNoLifecycleUpdate() const {}

DOMRect* Element::GetBoundingClientRect() {}

DOMRect* Element::GetBoundingClientRectForBinding() {}

const AtomicString& Element::computedRole() {}

const AtomicString& Element::ComputedRoleNoLifecycleUpdate() {}

String Element::computedName() {}

String Element::ComputedNameNoLifecycleUpdate() {}

AccessibleNode* Element::ExistingAccessibleNode() const {}

AccessibleNode* Element::accessibleNode() {}

void Element::ariaNotify(const String& announcement,
                         const AriaNotificationOptions* options) {}

bool Element::toggleAttribute(const AtomicString& qualified_name,
                              ExceptionState& exception_state) {}

bool Element::toggleAttribute(const AtomicString& qualified_name,
                              bool force,
                              ExceptionState& exception_state) {}

const AtomicString& Element::getAttributeNS(
    const AtomicString& namespace_uri,
    const AtomicString& local_name) const {}

const AttrNameToTrustedType& Element::GetCheckedAttributeTypes() const {}

SpecificTrustedType Element::ExpectedTrustedTypeForAttribute(
    const QualifiedName& q_name) const {}

void Element::setAttribute(const QualifiedName& name,
                           const String& string,
                           ExceptionState& exception_state) {}

DISABLE_CFI_PERF
void Element::AttributeChanged(const AttributeModificationParams& params) {}

bool Element::HasLegalLinkAttribute(const QualifiedName&) const {}

void Element::ClassAttributeChanged(const AtomicString& new_class_string) {}

void Element::UpdateClassList(const AtomicString& old_class_string,
                              const AtomicString& new_class_string) {}

// Returns true if the given attribute is an event handler.
// We consider an event handler any attribute that begins with "on".
// It is a simple solution that has the advantage of not requiring any
// code or configuration change if a new event handler is defined.

static inline bool IsEventHandlerAttribute(const Attribute& attribute) {}

bool Element::AttributeValueIsJavaScriptURL(const Attribute& attribute) {}

bool Element::IsJavaScriptURLAttribute(const Attribute& attribute) const {}

bool Element::IsScriptingAttribute(const Attribute& attribute) const {}

void Element::StripScriptingAttributes(
    Vector<Attribute, kAttributePrealloc>& attribute_vector) const {}

void Element::ParserSetAttributes(
    const Vector<Attribute, kAttributePrealloc>& attribute_vector) {}

bool Element::HasEquivalentAttributes(const Element& other) const {}

String Element::nodeName() const {}

AtomicString Element::LocalNameForSelectorMatching() const {}

const AtomicString& Element::LocateNamespacePrefix(
    const AtomicString& namespace_to_locate) const {}

const AtomicString Element::ImageSourceURL() const {}

bool Element::LayoutObjectIsNeeded(const DisplayStyle& style) const {}

bool Element::LayoutObjectIsNeeded(const ComputedStyle& style) const {}

LayoutObject* Element::CreateLayoutObject(const ComputedStyle& style) {}

Node::InsertionNotificationRequest Element::InsertedInto(
    ContainerNode& insertion_point) {}

void Element::RemovedFrom(ContainerNode& insertion_point) {}

void Element::AttachLayoutTree(AttachContext& context) {}

void Element::DetachLayoutTree(bool performing_reattach) {}

void Element::ReattachLayoutTreeChildren(base::PassKey<StyleEngine>) {}

const ComputedStyle* Element::StyleForLayoutObject(
    const StyleRecalcContext& style_recalc_context) {}

void Element::AdjustStyle(base::PassKey<StyleAdjuster>,
                          ComputedStyleBuilder& builder) {}

const ComputedStyle* Element::OriginalStyleForLayoutObject(
    const StyleRecalcContext& style_recalc_context) {}

void Element::RecalcStyleForTraversalRootAncestor() {}

bool Element::SkipStyleRecalcForContainer(
    const ComputedStyle& style,
    const StyleRecalcChange& child_change,
    const StyleRecalcContext& style_recalc_context) {}

void Element::MarkNonSlottedHostChildrenForStyleRecalc() {}

const ComputedStyle* Element::ParentComputedStyle() const {}

// Recalculate the style for this element, and if that element notes
// that children must also be recalculated, call ourself recursively
// on any children (via RecalcDescendantStyles()), and/or update
// pseudo-elements.
void Element::RecalcStyle(const StyleRecalcChange change,
                          const StyleRecalcContext& style_recalc_context) {}

const ComputedStyle* Element::PropagateInheritedProperties() {}

static bool NeedsContainerQueryEvaluator(
    const ContainerQueryEvaluator& evaluator,
    const ComputedStyle& new_style) {}

static const StyleRecalcChange ApplyComputedStyleDiff(
    const StyleRecalcChange change,
    ComputedStyle::Difference diff) {}

static bool LayoutViewCanHaveChildren(Element& element) {}

void Element::NotifyAXOfAttachedSubtree() {}

// This function performs two important tasks:
//
//  1. It computes the correct style for the element itself.
//  2. It figures out to what degree we need to propagate changes
//     to child elements (and returns that).
//
// #1 can happen in one out of two ways. The normal way is that ask the
// style resolver to compute the style from scratch (modulo some caching).
// The other one is an optimization for “independent inherited properties”;
// if this recalc is because the parent has changed only properties marked
// as “independent” (i.e., they do not affect other properties; “visibility”
// is an example of such a property), we can reuse our existing style and just
// re-propagate those properties.
//
// #2 happens by diffing the old and new styles. In the extreme example,
// if the two are identical, we don't need to invalidate child elements
// at all. But if they are different, they will usually be different to
// differing degrees; e.g. as noted above, if only independent properties
// changed, we can inform children of that for less work down the tree.
// Our own diff gets combined with the input StyleRecalcChange to produce a
// child recalc policy that's roughly the strictest of the two.
StyleRecalcChange Element::RecalcOwnStyle(
    const StyleRecalcChange change,
    const StyleRecalcContext& style_recalc_context) {}

void Element::ProcessContainIntrinsicSizeChanges() {}

void Element::RebuildLayoutTree(WhitespaceAttacher& whitespace_attacher) {}

void Element::RebuildShadowRootLayoutTree(
    WhitespaceAttacher& whitespace_attacher) {}

void Element::RebuildPseudoElementLayoutTree(
    PseudoId pseudo_id,
    WhitespaceAttacher& whitespace_attacher) {}

void Element::RebuildFirstLetterLayoutTree() {}

void Element::RebuildMarkerLayoutTree(WhitespaceAttacher& whitespace_attacher) {}

void Element::HandleSubtreeModifications() {}

void Element::UpdateCallbackSelectors(const ComputedStyle* old_style,
                                      const ComputedStyle* new_style) {}

void Element::NotifyIfMatchedDocumentRulesSelectorsChanged(
    const ComputedStyle* old_style,
    const ComputedStyle* new_style) {}

TextDirection Element::ParentDirectionality() const {}

void Element::RecomputeDirectionFromParent() {}

void Element::UpdateDirectionalityAndDescendant(TextDirection direction) {}

// Because the self-or-ancestor has dir=auto state could come from either a
// node tree ancestor, a slot, or an input, we have a method to
// recalculate it (just for this element) based on all three sources.
bool Element::RecalcSelfOrAncestorHasDirAuto() {}

void Element::UpdateDescendantHasDirAutoAttribute(bool has_dir_auto) {}

std::optional<TextDirection> Element::ResolveAutoDirectionality() const {}

void Element::AdjustDirectionalityIfNeededAfterChildrenChanged(
    const ChildrenChange& change) {}

bool Element::ShouldAdjustDirectionalityForInsert(
    const ChildrenChange& change) const {}

bool Element::DoesChildTextNodesDirectionMatchThis(const Node& node) const {}

void Element::UpdateAncestorWithDirAuto(UpdateAncestorTraversal traversal) {}

ShadowRoot& Element::CreateAndAttachShadowRoot(ShadowRootMode type,
                                               SlotAssignmentMode mode) {}

ShadowRoot* Element::GetShadowRoot() const {}

EditContext* Element::editContext() const {}

void Element::setEditContext(EditContext* edit_context,
                             ExceptionState& exception_state) {}

struct Element::AffectedByPseudoStateChange {};

void Element::PseudoStateChanged(CSSSelector::PseudoType pseudo) {}

void Element::PseudoStateChangedForTesting(CSSSelector::PseudoType pseudo) {}

void Element::PseudoStateChanged(
    CSSSelector::PseudoType pseudo,
    AffectedByPseudoStateChange&& affected_by_pseudo) {}

void Element::SetTargetedSnapAreaIdsForSnapContainers() {}

void Element::ClearTargetedSnapAreaIdsForSnapContainers() {}

Element::HighlightRecalc Element::CalculateHighlightRecalc(
    const ComputedStyle* old_style,
    const ComputedStyle& new_style,
    const ComputedStyle* parent_style) const {}

bool Element::ShouldRecalcHighlightPseudoStyle(
    HighlightRecalc highlight_recalc,
    const ComputedStyle* highlight_parent,
    const ComputedStyle& originating_style,
    const Element* originating_container) const {}

void Element::RecalcCustomHighlightPseudoStyle(
    const StyleRecalcContext& style_recalc_context,
    HighlightRecalc highlight_recalc,
    ComputedStyleBuilder& builder,
    const StyleHighlightData* parent_highlights,
    const ComputedStyle& originating_style) {}

const ComputedStyle* Element::RecalcHighlightStyles(
    const StyleRecalcContext& style_recalc_context,
    const ComputedStyle* old_style,
    const ComputedStyle& new_style,
    const ComputedStyle* parent_style) {}

void Element::SetAnimationStyleChange(bool animation_style_change) {}

void Element::SetNeedsAnimationStyleRecalc() {}

void Element::SetNeedsCompositingUpdate() {}

void Element::SetRegionCaptureCropId(
    std::unique_ptr<RegionCaptureCropId> crop_id) {}

const RegionCaptureCropId* Element::GetRegionCaptureCropId() const {}

void Element::SetRestrictionTargetId(std::unique_ptr<RestrictionTargetId> id) {}

const RestrictionTargetId* Element::GetRestrictionTargetId() const {}

void Element::SetIsEligibleForElementCapture(bool value) {}

void Element::SetCustomElementDefinition(CustomElementDefinition* definition) {}

CustomElementDefinition* Element::GetCustomElementDefinition() const {}

void Element::SetIsValue(const AtomicString& is_value) {}

const AtomicString& Element::IsValue() const {}

void Element::SetDidAttachInternals() {}

bool Element::DidAttachInternals() const {}

ElementInternals& Element::EnsureElementInternals() {}

const ElementInternals* Element::GetElementInternals() const {}

bool Element::CanAttachShadowRoot() const {}

const char* Element::ErrorMessageForAttachShadow(
    String mode,
    bool for_declarative,
    ShadowRootMode& mode_out) const {}

ShadowRoot* Element::attachShadow(const ShadowRootInit* shadow_root_init_dict,
                                  ExceptionState& exception_state) {}

bool Element::AttachDeclarativeShadowRoot(
    HTMLTemplateElement& template_element,
    String mode_string,
    FocusDelegation focus_delegation,
    SlotAssignmentMode slot_assignment,
    bool serializable,
    bool clonable,
    const AtomicString& reference_target) {}

ShadowRoot& Element::CreateUserAgentShadowRoot(SlotAssignmentMode mode) {}

ShadowRoot& Element::AttachShadowRootInternal(
    ShadowRootMode type,
    FocusDelegation focus_delegation,
    SlotAssignmentMode slot_assignment_mode,
    CustomElementRegistry* registry,
    bool serializable,
    bool clonable,
    const AtomicString& reference_target) {}

ShadowRoot* Element::OpenShadowRoot() const {}

ShadowRoot* Element::ClosedShadowRoot() const {}

ShadowRoot* Element::AuthorShadowRoot() const {}

ShadowRoot* Element::UserAgentShadowRoot() const {}

ShadowRoot& Element::EnsureUserAgentShadowRoot(SlotAssignmentMode mode) {}

bool Element::ChildTypeAllowed(NodeType type) const {}

namespace {

bool HasSiblingsForNonEmpty(const Node* sibling,
                            Node* (*next_func)(const Node&)) {}

}  // namespace

void Element::CheckForEmptyStyleChange(const Node* node_before_change,
                                       const Node* node_after_change) {}

void Element::ChildrenChanged(const ChildrenChange& change) {}

void Element::FinishParsingChildren() {}

AttrNodeList* Element::GetAttrNodeList() {}

void Element::RemoveAttrNodeList() {}

Attr* Element::setAttributeNodeNS(Attr* attr, ExceptionState& exception_state) {}

Attr* Element::removeAttributeNode(Attr* attr,
                                   ExceptionState& exception_state) {}

void Element::LangAttributeChanged() {}

void Element::ParseAttribute(const AttributeModificationParams& params) {}

// static
std::optional<QualifiedName> Element::ParseAttributeName(
    const AtomicString& namespace_uri,
    const AtomicString& qualified_name,
    ExceptionState& exception_state) {}

void Element::setAttributeNS(const AtomicString& namespace_uri,
                             const AtomicString& qualified_name,
                             String value,
                             ExceptionState& exception_state) {}

void Element::setAttributeNS(const AtomicString& namespace_uri,
                             const AtomicString& qualified_name,
                             const V8TrustedType* trusted_string,
                             ExceptionState& exception_state) {}

void Element::RemoveAttributeInternal(wtf_size_t index,
                                      AttributeModificationReason reason) {}

void Element::AppendAttributeInternal(const QualifiedName& name,
                                      const AtomicString& value,
                                      AttributeModificationReason reason) {}

void Element::removeAttributeNS(const AtomicString& namespace_uri,
                                const AtomicString& local_name) {}

Attr* Element::getAttributeNode(const AtomicString& local_name) {}

Attr* Element::getAttributeNodeNS(const AtomicString& namespace_uri,
                                  const AtomicString& local_name) {}

bool Element::hasAttribute(const AtomicString& local_name) const {}

bool Element::hasAttributeNS(const AtomicString& namespace_uri,
                             const AtomicString& local_name) const {}

bool Element::IsShadowHostWithDelegatesFocus() const {}

// https://html.spec.whatwg.org/C/#get-the-focusable-area
Element* Element::GetFocusableArea(bool in_descendant_traversal) const {}

Element* Element::GetFocusDelegate(bool in_descendant_traversal) const {}

void Element::focusForBindings(const FocusOptions* options) {}

void Element::Focus() {}

void Element::Focus(const FocusOptions* options) {}

void Element::Focus(const FocusParams& params) {}

void Element::SetFocused(bool received, mojom::blink::FocusType focus_type) {}

void Element::SetDragged(bool new_value) {}

void Element::UpdateSelectionOnFocus(
    SelectionBehaviorOnFocus selection_behavior) {}

void Element::UpdateSelectionOnFocus(
    SelectionBehaviorOnFocus selection_behavior,
    const FocusOptions* options) {}

void Element::blur() {}

bool Element::SupportsSpatialNavigationFocus() const {}

bool Element::CanBeKeyboardFocusableScroller(
    UpdateBehavior update_behavior) const {}

// This can be slow, because it can require a tree walk. It might be
// a good idea to cache this bit on the element to avoid having to
// recompute it. That would require marking that bit dirty whenever
// a node in the subtree was mutated, or when styles for the subtree
// were recomputed.
bool Element::IsKeyboardFocusableScroller(
    UpdateBehavior update_behavior) const {}

bool Element::IsKeyboardFocusable(UpdateBehavior update_behavior) const {}

bool Element::IsMouseFocusable(UpdateBehavior update_behavior) const {}

bool Element::IsFocusable(UpdateBehavior update_behavior) const {}

FocusableState Element::IsFocusableState(UpdateBehavior update_behavior) const {}

FocusableState Element::SupportsFocus(UpdateBehavior update_behavior) const {}

bool Element::IsAutofocusable() const {}

// This is used by FrameSelection to denote when the active-state of the page
// has changed independent of the focused element changing.
void Element::FocusStateChanged() {}

void Element::FocusVisibleStateChanged() {}

void Element::ActiveViewTransitionStateChanged() {}

void Element::ActiveViewTransitionTypeStateChanged() {}

void Element::FocusWithinStateChanged() {}

void Element::SetHasFocusWithinUpToAncestor(bool flag,
                                            Element* ancestor,
                                            bool need_snap_container_search) {}

bool Element::IsClickableControl(Node* node) {}

bool Element::ActivateDisplayLockIfNeeded(DisplayLockActivationReason reason) {}

bool Element::HasUndoStack() const {}

void Element::SetHasUndoStack(bool value) {}

void Element::SetPseudoElementStylesChangeCounters(bool value) {}

void Element::SetScrollbarPseudoElementStylesDependOnFontMetrics(bool value) {}

bool Element::HasBeenExplicitlyScrolled() const {}

void Element::SetHasBeenExplicitlyScrolled() {}

bool Element::AffectedBySubjectHas() const {}

void Element::SetAffectedBySubjectHas() {}

bool Element::AffectedByNonSubjectHas() const {}

void Element::SetAffectedByNonSubjectHas() {}

bool Element::AncestorsOrAncestorSiblingsAffectedByHas() const {}

void Element::SetAncestorsOrAncestorSiblingsAffectedByHas() {}

unsigned Element::GetSiblingsAffectedByHasFlags() const {}

bool Element::HasSiblingsAffectedByHasFlags(unsigned flags) const {}

void Element::SetSiblingsAffectedByHasFlags(unsigned flags) {}

bool Element::AffectedByPseudoInHas() const {}

void Element::SetAffectedByPseudoInHas() {}

bool Element::AncestorsOrSiblingsAffectedByHoverInHas() const {}

void Element::SetAncestorsOrSiblingsAffectedByHoverInHas() {}

bool Element::AncestorsOrSiblingsAffectedByActiveInHas() const {}

void Element::SetAncestorsOrSiblingsAffectedByActiveInHas() {}

bool Element::AncestorsOrSiblingsAffectedByFocusInHas() const {}

void Element::SetAncestorsOrSiblingsAffectedByFocusInHas() {}

bool Element::AncestorsOrSiblingsAffectedByFocusVisibleInHas() const {}

void Element::SetAncestorsOrSiblingsAffectedByFocusVisibleInHas() {}

bool Element::AffectedByLogicalCombinationsInHas() const {}

void Element::SetAffectedByLogicalCombinationsInHas() {}

bool Element::AffectedByMultipleHas() const {}

void Element::SetAffectedByMultipleHas() {}

bool Element::IsFocusedElementInDocument() const {}

Element* Element::AdjustedFocusedElementInTreeScope() const {}

bool Element::DispatchFocusEvent(Element* old_focused_element,
                                 mojom::blink::FocusType type,
                                 InputDeviceCapabilities* source_capabilities) {}

void Element::DispatchBlurEvent(Element* new_focused_element,
                                mojom::blink::FocusType type,
                                InputDeviceCapabilities* source_capabilities) {}

void Element::DispatchFocusInEvent(
    const AtomicString& event_type,
    Element* old_focused_element,
    mojom::blink::FocusType,
    InputDeviceCapabilities* source_capabilities) {}

void Element::DispatchFocusOutEvent(
    const AtomicString& event_type,
    Element* new_focused_element,
    InputDeviceCapabilities* source_capabilities) {}

String Element::innerHTML() const {}

String Element::outerHTML() const {}

void Element::SetInnerHTMLInternal(
    const String& html,
    ParseDeclarativeShadowRoots parse_declarative_shadows,
    ForceHtml force_html,
    ExceptionState& exception_state) {}

void Element::setInnerHTML(const String& html,
                           ExceptionState& exception_state) {}

void Element::setOuterHTML(const String& html,
                           ExceptionState& exception_state) {}

// Step 4 of http://domparsing.spec.whatwg.org/#insertadjacenthtml()
Node* Element::InsertAdjacent(const String& where,
                              Node* new_child,
                              ExceptionState& exception_state) {}

void Element::HideNonce() {}

ElementIntersectionObserverData* Element::IntersectionObserverData() const {}

ElementIntersectionObserverData& Element::EnsureIntersectionObserverData() {}

HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>*
Element::ResizeObserverData() const {}

HeapHashMap<Member<ResizeObserver>, Member<ResizeObservation>>&
Element::EnsureResizeObserverData() {}

DisplayLockContext* Element::GetDisplayLockContextFromRareData() const {}

DisplayLockContext& Element::EnsureDisplayLockContext() {}

ContainerQueryData* Element::GetContainerQueryData() const {}

ContainerQueryEvaluator* Element::GetContainerQueryEvaluator() const {}

ContainerQueryEvaluator& Element::EnsureContainerQueryEvaluator() {}

StyleScopeData& Element::EnsureStyleScopeData() {}

StyleScopeData* Element::GetStyleScopeData() const {}

OutOfFlowData& Element::EnsureOutOfFlowData() {}

OutOfFlowData* Element::GetOutOfFlowData() const {}

bool Element::SkippedContainerStyleRecalc() const {}

// Step 1 of http://domparsing.spec.whatwg.org/#insertadjacenthtml()
static Node* ContextNodeForInsertion(const String& where,
                                     Element* element,
                                     ExceptionState& exception_state) {}

Element* Element::insertAdjacentElement(const String& where,
                                        Element* new_child,
                                        ExceptionState& exception_state) {}

void Element::insertAdjacentText(const String& where,
                                 const String& text,
                                 ExceptionState& exception_state) {}

void Element::insertAdjacentHTML(const String& where,
                                 const String& markup,
                                 ExceptionState& exception_state) {}

void Element::setPointerCapture(PointerId pointer_id,
                                ExceptionState& exception_state) {}

void Element::releasePointerCapture(PointerId pointer_id,
                                    ExceptionState& exception_state) {}

bool Element::hasPointerCapture(PointerId pointer_id) const {}

String Element::outerText() {}

String Element::TextFromChildren() {}

const AtomicString& Element::ShadowPseudoId() const {}

void Element::SetShadowPseudoId(const AtomicString& id) {}

bool Element::IsInDescendantTreeOf(const Element* shadow_host) const {}

namespace {

bool NeedsEnsureComputedStyle(Element& element) {}

HeapVector<Member<Element>> CollectAncestorsToEnsure(Element& element) {}

}  // namespace

const ComputedStyle* Element::EnsureComputedStyle(
    PseudoId pseudo_element_specifier,
    const AtomicString& pseudo_argument) {}

const ComputedStyle* Element::EnsureOwnComputedStyle(
    const StyleRecalcContext& style_recalc_context,
    PseudoId pseudo_element_specifier,
    const AtomicString& pseudo_argument) {}

bool Element::HasDisplayContentsStyle() const {}

bool Element::ShouldStoreComputedStyle(const ComputedStyle& style) const {}

AtomicString Element::ComputeInheritedLanguage() const {}

Locale& Element::GetLocale() const {}

void Element::CancelSelectionAfterLayout() {}

bool Element::ShouldUpdateBackdropPseudoElement(
    const StyleRecalcChange change) {}

void Element::UpdateBackdropPseudoElement(
    const StyleRecalcChange change,
    const StyleRecalcContext& style_recalc_context) {}

void Element::ApplyPendingBackdropPseudoElementUpdate() {}

void Element::UpdateFirstLetterPseudoElement(StyleUpdatePhase phase) {}

void Element::UpdateFirstLetterPseudoElement(
    StyleUpdatePhase phase,
    const StyleRecalcContext& style_recalc_context) {}

void Element::ClearPseudoElement(PseudoId pseudo_id,
                                 const AtomicString& view_transition_name) {}

PseudoElement* Element::UpdatePseudoElement(
    PseudoId pseudo_id,
    const StyleRecalcChange change,
    const StyleRecalcContext& style_recalc_context,
    const AtomicString& view_transition_name) {}

PseudoElement* Element::CreatePseudoElementIfNeeded(
    PseudoId pseudo_id,
    const StyleRecalcContext& style_recalc_context,
    const AtomicString& view_transition_name) {}

void Element::AttachPseudoElement(PseudoId pseudo_id, AttachContext& context) {}

void Element::DetachPseudoElement(PseudoId pseudo_id,
                                  bool performing_reattach) {}

PseudoElement* Element::GetPseudoElement(
    PseudoId pseudo_id,
    const AtomicString& view_transition_name) const {}

PseudoElement* Element::GetNestedPseudoElement(
    PseudoId pseudo_id,
    const AtomicString& view_transition_name) const {}

LayoutObject* Element::PseudoElementLayoutObject(PseudoId pseudo_id) const {}

bool Element::PseudoElementStylesAffectCounters() const {}

bool Element::PseudoElementStylesDependOnFontMetrics() const {}

bool Element::PseudoElementStylesDependOnAttr() const {}

template <typename Functor>
bool Element::PseudoElementStylesDependOnFunc(Functor& func) const {}

const ComputedStyle* Element::CachedStyleForPseudoElement(
    PseudoId pseudo_id,
    const AtomicString& pseudo_argument) {}

const ComputedStyle* Element::UncachedStyleForPseudoElement(
    const StyleRequest& request) {}

const ComputedStyle* Element::StyleForPseudoElement(
    const StyleRecalcContext& style_recalc_context,
    const StyleRequest& request) {}

const ComputedStyle* Element::StyleForHighlightPseudoElement(
    const StyleRecalcContext& style_recalc_context,
    const ComputedStyle* highlight_parent,
    const ComputedStyle& originating_style,
    const PseudoId pseudo_id,
    const AtomicString& pseudo_argument) {}

const ComputedStyle* Element::StyleForSearchTextPseudoElement(
    const StyleRecalcContext& style_recalc_context,
    const ComputedStyle* highlight_parent,
    const ComputedStyle& originating_style,
    StyleRequest::SearchTextRequest search_text_request) {}

bool Element::CanGeneratePseudoElement(PseudoId pseudo_id) const {}

bool Element::MayTriggerVirtualKeyboard() const {}

bool Element::matches(const AtomicString& selectors,
                      ExceptionState& exception_state) {}

bool Element::matches(const AtomicString& selectors) {}

Element* Element::closest(const AtomicString& selectors,
                          ExceptionState& exception_state) {}

Element* Element::closest(const AtomicString& selectors) {}

DOMTokenList& Element::classList() {}

DOMStringMap& Element::dataset() {}

KURL Element::HrefURL() const {}

String Element::GetURLAttribute(const QualifiedName& name) const {}

KURL Element::GetURLAttributeAsKURL(const QualifiedName& name) const {}

KURL Element::GetNonEmptyURLAttribute(const QualifiedName& name) const {}

int Element::GetIntegralAttribute(const QualifiedName& attribute_name) const {}

int Element::GetIntegralAttribute(const QualifiedName& attribute_name,
                                  int default_value) const {}

unsigned int Element::GetUnsignedIntegralAttribute(
    const QualifiedName& attribute_name) const {}

void Element::SetIntegralAttribute(const QualifiedName& attribute_name,
                                   int value) {}

void Element::SetUnsignedIntegralAttribute(const QualifiedName& attribute_name,
                                           unsigned value,
                                           unsigned default_value) {}

double Element::GetFloatingPointAttribute(const QualifiedName& attribute_name,
                                          double fallback_value) const {}

void Element::SetFloatingPointAttribute(const QualifiedName& attribute_name,
                                        double value) {}

void Element::SetContainsFullScreenElement(bool flag) {}

// Unlike Node::parentOrShadowHostElement, this can cross frame boundaries.
static Element* NextAncestorElement(Element* element) {}

void Element::SetContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(
    bool flag) {}

void Element::SetContainsPersistentVideo(bool value) {}

void Element::SetIsInTopLayer(bool in_top_layer) {}

ScriptValue Element::requestPointerLock(ScriptState* script_state,
                                        const PointerLockOptions* options,
                                        ExceptionState& exception_state) {}

SpellcheckAttributeState Element::GetSpellcheckAttributeState() const {}

bool Element::IsSpellCheckingEnabled() const {}

#if DCHECK_IS_ON()
bool Element::FastAttributeLookupAllowed(const QualifiedName& name) const {}
#endif

#if DUMP_NODE_STATISTICS
bool Element::HasNamedNodeMap() const {
  if (const ElementRareDataVector* data = GetElementRareData()) {
    return data->AttributeMap();
  }
  return false;
}
#endif

inline void Element::UpdateName(const AtomicString& old_name,
                                const AtomicString& new_name) {}

inline void Element::UpdateId(const AtomicString& old_id,
                              const AtomicString& new_id) {}

inline void Element::UpdateId(TreeScope& scope,
                              const AtomicString& old_id,
                              const AtomicString& new_id) {}

inline void Element::UpdateFocusgroup(const AtomicString& input) {}

void Element::UpdateFocusgroupInShadowRootIfNeeded() {}

void Element::WillModifyAttribute(const QualifiedName& name,
                                  const AtomicString& old_value,
                                  const AtomicString& new_value) {}

DISABLE_CFI_PERF
void Element::DidAddAttribute(const QualifiedName& name,
                              const AtomicString& value) {}

void Element::DidModifyAttribute(const QualifiedName& name,
                                 const AtomicString& old_value,
                                 const AtomicString& new_value,
                                 AttributeModificationReason reason) {}

void Element::DidRemoveAttribute(const QualifiedName& name,
                                 const AtomicString& old_value) {}

static bool NeedsURLResolutionForInlineStyle(const Element& element,
                                             const Document& old_document,
                                             const Document& new_document) {}

static void ReResolveURLsInInlineStyle(const Document& document,
                                       MutableCSSPropertyValueSet& style) {}

void Element::DidMoveToNewDocument(Document& old_document) {}

void Element::UpdateNamedItemRegistration(NamedItemType type,
                                          const AtomicString& old_name,
                                          const AtomicString& new_name) {}

void Element::UpdateIdNamedItemRegistration(NamedItemType type,
                                            const AtomicString& old_id,
                                            const AtomicString& new_id) {}

ScrollOffset Element::SavedLayerScrollOffset() const {}

void Element::SetSavedLayerScrollOffset(const ScrollOffset& size) {}

Attr* Element::AttrIfExists(const QualifiedName& name) {}

Attr* Element::EnsureAttr(const QualifiedName& name) {}

void Element::DetachAttrNodeFromElementWithValue(Attr* attr_node,
                                                 const AtomicString& value) {}

void Element::DetachAllAttrNodesFromElement() {}

void Element::WillRecalcStyle(const StyleRecalcChange) {}

void Element::DidRecalcStyle(const StyleRecalcChange) {}

const ComputedStyle* Element::CustomStyleForLayoutObject(
    const StyleRecalcContext& style_recalc_context) {}

void Element::AdjustStyle(ComputedStyleBuilder&) {}

void Element::CloneAttributesFrom(const Element& other) {}

void Element::CreateUniqueElementData() {}

void Element::SynchronizeStyleAttributeInternal() const {}

CSSStyleDeclaration* Element::style() {}

StylePropertyMap* Element::attributeStyleMap() {}

StylePropertyMapReadOnly* Element::ComputedStyleMap() {}

MutableCSSPropertyValueSet& Element::EnsureMutableInlineStyle() {}

void Element::ClearMutableInlineStyleIfEmpty() {}

void Element::NotifyInlineStyleMutation() {}

inline void Element::SetInlineStyleFromString(
    const AtomicString& new_style_string) {}

bool Element::IsStyleAttributeChangeAllowed(const AtomicString& style_string) {}

void Element::StyleAttributeChanged(
    const AtomicString& new_style_string,
    AttributeModificationReason modification_reason) {}

void Element::InlineStyleChanged() {}

void Element::SetInlineStyleProperty(CSSPropertyID property_id,
                                     CSSValueID identifier,
                                     bool important) {}

void Element::SetInlineStyleProperty(CSSPropertyID property_id,
                                     double value,
                                     CSSPrimitiveValue::UnitType unit,
                                     bool important) {}

void Element::SetInlineStyleProperty(CSSPropertyID property_id,
                                     const CSSValue& value,
                                     bool important) {}

bool Element::SetInlineStyleProperty(CSSPropertyID property_id,
                                     const String& value,
                                     bool important) {}

void Element::SetInlineStyleProperty(const CSSPropertyName& name,
                                     const CSSValue& value,
                                     bool important) {}

bool Element::RemoveInlineStyleProperty(CSSPropertyID property_id) {}

bool Element::RemoveInlineStyleProperty(const AtomicString& property_name) {}

void Element::RemoveAllInlineStyleProperties() {}

void Element::UpdatePresentationAttributeStyle() {}

CSSPropertyValueSet* Element::CreatePresentationAttributeStyle() {}

void Element::AddPropertyToPresentationAttributeStyle(
    MutableCSSPropertyValueSet* style,
    CSSPropertyID property_id,
    CSSValueID identifier) {}

void Element::AddPropertyToPresentationAttributeStyle(
    MutableCSSPropertyValueSet* style,
    CSSPropertyID property_id,
    double value,
    CSSPrimitiveValue::UnitType unit) {}

void Element::AddPropertyToPresentationAttributeStyle(
    MutableCSSPropertyValueSet* style,
    CSSPropertyID property_id,
    const String& value) {}

void Element::AddPropertyToPresentationAttributeStyle(
    MutableCSSPropertyValueSet* style,
    CSSPropertyID property_id,
    const CSSValue& value) {}

void Element::MapLanguageAttributeToLocale(const AtomicString& value,
                                           MutableCSSPropertyValueSet* style) {}

void Element::LogAddElementIfIsolatedWorldAndInDocument(
    const char element[],
    const QualifiedName& attr1) {}

void Element::LogAddElementIfIsolatedWorldAndInDocument(
    const char element[],
    const QualifiedName& attr1,
    const QualifiedName& attr2) {}

void Element::LogAddElementIfIsolatedWorldAndInDocument(
    const char element[],
    const QualifiedName& attr1,
    const QualifiedName& attr2,
    const QualifiedName& attr3) {}

void Element::LogUpdateAttributeIfIsolatedWorldAndInDocument(
    const char element[],
    const AttributeModificationParams& params) {}

void Element::Trace(Visitor* visitor) const {}

bool Element::HasPart() const {}

DOMTokenList* Element::GetPart() const {}

DOMTokenList& Element::part() {}

bool Element::HasPartNamesMap() const {}

const NamesMap* Element::PartNamesMap() const {}

bool Element::ChildStyleRecalcBlockedByDisplayLock() const {}

void Element::SetHovered(bool hovered) {}

void Element::SetActive(bool active) {}

void Element::InvalidateStyleAttribute(
    bool only_changed_independent_properties) {}

void Element::RecalcTransitionPseudoTreeStyle(
    const Vector<AtomicString>& view_transition_names) {}

void Element::RebuildTransitionPseudoLayoutTree(
    const Vector<AtomicString>& view_transition_names) {}

bool Element::IsInertRoot() const {}

FocusgroupFlags Element::GetFocusgroupFlags() const {}

bool Element::checkVisibility(CheckVisibilityOptions* options) const {}

WTF::AtomicStringTable::WeakResult Element::WeakLowercaseIfNecessary(
    const AtomicString& name) const {}

// Note, SynchronizeAttributeHinted is safe to call between a WeakFind() and
// a check on the AttributeCollection for the element even though it may
// modify the AttributeCollection to insert a "style" attribute. The reason
// is because html_names::kStyleAttr.LocalName() is an AtomicString
// representing "style". This means the AtomicStringTable will always have
// an entry for "style" and a `hint` that corresponds to
// html_names::kStyleAttr.LocalName() will never refer to a deleted object
// thus it is safe to insert html_names::kStyleAttr.LocalName() into the
// AttributeCollection collection after the WeakFind() when `hint` is
// referring to "style". A subsequent lookup will match itself correctly
// without worry for UaF or false positives.
void Element::SynchronizeAttributeHinted(
    const AtomicString& local_name,
    WTF::AtomicStringTable::WeakResult hint) const {}

const AtomicString& Element::GetAttributeHinted(
    const AtomicString& name,
    WTF::AtomicStringTable::WeakResult hint) const {}

std::pair<wtf_size_t, const QualifiedName> Element::LookupAttributeQNameHinted(
    AtomicString name,
    WTF::AtomicStringTable::WeakResult hint) const {}

ALWAYS_INLINE wtf_size_t
Element::ValidateAttributeIndex(wtf_size_t index,
                                const QualifiedName& qname) const {}

void Element::setAttribute(const QualifiedName& name,
                           const AtomicString& value) {}

void Element::setAttribute(const QualifiedName& name,
                           const AtomicString& value,
                           ExceptionState& exception_state) {}

void Element::SetSynchronizedLazyAttribute(const QualifiedName& name,
                                           const AtomicString& value) {}

void Element::SetAttributeHinted(AtomicString local_name,
                                 WTF::AtomicStringTable::WeakResult hint,
                                 String value,
                                 ExceptionState& exception_state) {}

void Element::SetAttributeHinted(AtomicString local_name,
                                 WTF::AtomicStringTable::WeakResult hint,
                                 const V8TrustedType* trusted_string,
                                 ExceptionState& exception_state) {}

wtf_size_t Element::FindAttributeIndex(const QualifiedName& name) const {}

ALWAYS_INLINE void Element::SetAttributeInternal(
    wtf_size_t index,
    const QualifiedName& name,
    const AtomicString& new_value,
    AttributeModificationReason reason) {}

Attr* Element::setAttributeNode(Attr* attr_node,
                                ExceptionState& exception_state) {}

void Element::RemoveAttributeHinted(const AtomicString& name,
                                    WTF::AtomicStringTable::WeakResult hint) {}

bool Element::IsDocumentElement() const {}

bool Element::IsReplacedElementRespectingCSSOverflow() const {}

AnchorPositionScrollData& Element::EnsureAnchorPositionScrollData() {}

void Element::RemoveAnchorPositionScrollData() {}

AnchorPositionScrollData* Element::GetAnchorPositionScrollData() const {}

void Element::IncrementImplicitlyAnchoredElementCount() {}
void Element::DecrementImplicitlyAnchoredElementCount() {}
bool Element::HasImplicitlyAnchoredElement() const {}

AnchorElementObserver* Element::GetAnchorElementObserver() const {}

AnchorElementObserver& Element::EnsureAnchorElementObserver() {}

Element* Element::ImplicitAnchorElement() const {}

void Element::setHTMLUnsafe(const String& html,
                            ExceptionState& exception_state) {}

}  // namespace blink