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

/*
 * Copyright (C) 2011 Google Inc. All Rights Reserved.
 * Copyright (C) 2012 Apple Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#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 {}

// If the point is not in the viewport, returns false. Otherwise, adjusts the
// point to account for the frame's zoom and scroll.
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) {}

// This method corresponds to the Retarget algorithm specified in
// https://dom.spec.whatwg.org/#retarget
// This retargets |target| against the root of |this|.
// The steps are different with the spec for performance reasons,
// but the results should be the same.
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 {}

}  // namespace blink