#include "third_party/blink/renderer/core/dom/tree_scope.h"
#include "third_party/blink/renderer/core/animation/document_animations.h"
#include "third_party/blink/renderer/core/css/resolver/scoped_style_resolver.h"
#include "third_party/blink/renderer/core/css/style_change_reason.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/dom/container_node.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/events/event_path.h"
#include "third_party/blink/renderer/core/dom/id_target_observer_registry.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/scroll_marker_group_pseudo_element.h"
#include "third_party/blink/renderer/core/dom/scroll_marker_pseudo_element.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/dom/tree_scope_adopter.h"
#include "third_party/blink/renderer/core/editing/dom_selection.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/picture_in_picture_controller.h"
#include "third_party/blink/renderer/core/fullscreen/fullscreen.h"
#include "third_party/blink/renderer/core/html/html_anchor_element.h"
#include "third_party/blink/renderer/core/html/html_frame_owner_element.h"
#include "third_party/blink/renderer/core/html/html_map_element.h"
#include "third_party/blink/renderer/core/html/html_slot_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/layout/hit_test_location.h"
#include "third_party/blink/renderer/core/layout/hit_test_result.h"
#include "third_party/blink/renderer/core/layout/layout_view.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/paint/paint_layer_scrollable_area.h"
#include "third_party/blink/renderer/core/svg/svg_text_content_element.h"
#include "third_party/blink/renderer/core/svg/svg_tree_scope_resources.h"
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
#include "ui/gfx/geometry/point_conversions.h"
namespace blink {
TreeScope::TreeScope(ContainerNode& root_node,
Document& document,
V8ObservableArrayCSSStyleSheet::SetAlgorithmCallback
adopted_style_sheets_set_callback,
V8ObservableArrayCSSStyleSheet::DeleteAlgorithmCallback
adopted_style_sheets_delete_callback)
: … { … }
TreeScope::TreeScope(Document& document,
V8ObservableArrayCSSStyleSheet::SetAlgorithmCallback
adopted_style_sheets_set_callback,
V8ObservableArrayCSSStyleSheet::DeleteAlgorithmCallback
adopted_style_sheets_delete_callback)
: … { … }
TreeScope::~TreeScope() = default;
bool TreeScope::IsInclusiveAncestorTreeScopeOf(const TreeScope& scope) const { … }
void TreeScope::SetParentTreeScope(TreeScope& new_parent_scope) { … }
ScopedStyleResolver& TreeScope::EnsureScopedStyleResolver() { … }
void TreeScope::ClearScopedStyleResolver() { … }
Element* TreeScope::getElementById(const AtomicString& element_id) const { … }
const HeapVector<Member<Element>>& TreeScope::GetAllElementsById(
const AtomicString& element_id) const { … }
void TreeScope::AddElementById(const AtomicString& element_id,
Element& element) { … }
void TreeScope::RemoveElementById(const AtomicString& element_id,
Element& element) { … }
Node* TreeScope::AncestorInThisScope(Node* node) const { … }
void TreeScope::AddImageMap(HTMLMapElement& image_map) { … }
void TreeScope::RemoveImageMap(HTMLMapElement& image_map) { … }
HTMLMapElement* TreeScope::GetImageMap(const String& url) const { … }
static bool PointInFrameContentIfVisible(Document& document,
gfx::PointF& point_in_frame) { … }
HitTestResult HitTestInDocument(Document* document,
double x,
double y,
const HitTestRequest& request) { … }
Element* TreeScope::ElementFromPoint(double x, double y) const { … }
Element* TreeScope::HitTestPoint(double x,
double y,
const HitTestRequest& request) const { … }
Element* TreeScope::HitTestPointInternal(Node* node,
HitTestPointType type) const { … }
static bool ShouldAcceptNonElementNode(const Node& node) { … }
HeapVector<Member<Element>> TreeScope::ElementsFromHitTestResult(
HitTestResult& result) const { … }
HeapVector<Member<Element>> TreeScope::ElementsFromPoint(double x,
double y) const { … }
SVGTreeScopeResources& TreeScope::EnsureSVGTreeScopedResources() { … }
bool TreeScope::HasAdoptedStyleSheets() const { … }
void TreeScope::StyleSheetWasAdded(CSSStyleSheet* sheet) { … }
void TreeScope::StyleSheetWasRemoved(CSSStyleSheet* sheet) { … }
void TreeScope::OnAdoptedStyleSheetSet(
ScriptState* script_state,
V8ObservableArrayCSSStyleSheet& observable_array,
uint32_t index,
Member<CSSStyleSheet>& sheet,
ExceptionState& exception_state) { … }
void TreeScope::OnAdoptedStyleSheetDelete(
ScriptState* script_state,
V8ObservableArrayCSSStyleSheet& observable_array,
uint32_t index,
ExceptionState& exception_state) { … }
void TreeScope::ClearAdoptedStyleSheets() { … }
void TreeScope::SetAdoptedStyleSheetsForTesting(
HeapVector<Member<CSSStyleSheet>>& adopted_style_sheets) { … }
DOMSelection* TreeScope::GetSelection() const { … }
Element* TreeScope::FindAnchorWithName(const String& name) { … }
Node* TreeScope::FindAnchor(const String& fragment) { … }
void TreeScope::AdoptIfNeeded(Node& node) { … }
Element& TreeScope::Retarget(const Element& target) const { … }
Element* TreeScope::AdjustedFocusedElementInternal(
const Element& target) const { … }
Element* TreeScope::AdjustedFocusedElement() const { … }
Element* TreeScope::AdjustedElement(const Element& target) const { … }
StyleSheetList& TreeScope::StyleSheets() { … }
Element* TreeScope::activeElement() const { … }
HeapVector<Member<Animation>> TreeScope::getAnimations() { … }
Element* TreeScope::pointerLockElement() { … }
Element* TreeScope::fullscreenElement() { … }
Element* TreeScope::pictureInPictureElement() { … }
uint16_t TreeScope::ComparePosition(const TreeScope& other_scope) const { … }
const TreeScope* TreeScope::CommonAncestorTreeScope(
const TreeScope& other) const { … }
TreeScope* TreeScope::CommonAncestorTreeScope(TreeScope& other) { … }
bool TreeScope::IsInclusiveAncestorOf(const TreeScope& scope) const { … }
Element* TreeScope::GetElementByAccessKey(const String& key) const { … }
void TreeScope::Trace(Visitor* visitor) const { … }
}