chromium/third_party/blink/renderer/modules/exported/web_ax_object.cc

/*
 * Copyright (C) 2009 Google 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:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * 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.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "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 THE COPYRIGHT
 * OWNER 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/public/web/web_ax_object.h"

#include "base/ranges/algorithm.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_node.h"
#include "third_party/blink/public/web/web_view.h"
#include "third_party/blink/renderer/core/css/css_primitive_value_mappings.h"
#include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h"
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/editing/visible_position.h"
#include "third_party/blink/renderer/core/exported/web_view_impl.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/input/keyboard_event_manager.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/page/page_popup.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/modules/accessibility/ax_object.h"
#include "third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h"
#include "third_party/blink/renderer/modules/accessibility/ax_position.h"
#include "third_party/blink/renderer/modules/accessibility/ax_range.h"
#include "third_party/blink/renderer/modules/accessibility/ax_selection.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "ui/accessibility/ax_action_data.h"

namespace blink {

namespace {
mojom::blink::ScrollAlignment::Behavior ToBlinkScrollAlignmentBehavior(
    ax::mojom::ScrollAlignment alignment) {}
}  // namespace

// A utility class which uses the lifetime of this object to signify when
// AXObjCache or AXObjectCacheImpl handles programmatic actions.
class ScopedActionAnnotator {};

#if DCHECK_IS_ON()
static void CheckLayoutClean(const Document* document) {}
#endif

void WebAXObject::Reset() {}

void WebAXObject::Assign(const WebAXObject& other) {}

bool WebAXObject::Equals(const WebAXObject& n) const {}

bool WebAXObject::IsDetached() const {}

int WebAXObject::AxID() const {}

ax::mojom::DefaultActionVerb WebAXObject::Action() const {}

bool WebAXObject::CanSetValueAttribute() const {}

unsigned WebAXObject::ChildCount() const {}

WebAXObject WebAXObject::ChildAt(unsigned index) const {}

WebAXObject WebAXObject::ParentObject() const {}

void WebAXObject::Serialize(ui::AXNodeData* node_data,
                            ui::AXMode accessibility_mode) const {}

void WebAXObject::AddDirtyObjectToSerializationQueue(
    ax::mojom::blink::EventFrom event_from,
    ax::mojom::blink::Action event_from_action,
    std::vector<ui::AXEventIntent> event_intents) const {}

void WebAXObject::OnLoadInlineTextBoxes() const {}

BLINK_EXPORT void WebAXObject::SetImageAsDataNodeId(
    const gfx::Size& max_size) const {}

BLINK_EXPORT int WebAXObject::ImageDataNodeId() const {}

WebString WebAXObject::AutoComplete() const {}

ax::mojom::AriaCurrentState WebAXObject::AriaCurrentState() const {}

ax::mojom::CheckedState WebAXObject::CheckedState() const {}

bool WebAXObject::IsClickable() const {}

bool WebAXObject::IsFocused() const {}

bool WebAXObject::IsModal() const {}

bool WebAXObject::IsOffScreen() const {}

bool WebAXObject::IsVisited() const {}

unsigned WebAXObject::ColorValue() const {}

WebAXObject WebAXObject::AriaActiveDescendant() const {}

bool WebAXObject::IsEditable() const {}

bool WebAXObject::LiveRegionAtomic() const {}

WebString WebAXObject::LiveRegionRelevant() const {}

WebString WebAXObject::LiveRegionStatus() const {}

bool WebAXObject::AriaOwns(WebVector<WebAXObject>& owns_elements) const {}

bool WebAXObject::CanvasHasFallbackContent() const {}

ax::mojom::InvalidState WebAXObject::InvalidState() const {}

int WebAXObject::HeadingLevel() const {}

int WebAXObject::HierarchicalLevel() const {}

// FIXME: This method passes in a point that has page scale applied but assumes
// that (0, 0) is the top left of the visual viewport. In other words, the
// point has the VisualViewport scale applied, but not the VisualViewport
// offset. crbug.com/459591.
WebAXObject WebAXObject::HitTest(const gfx::Point& point) const {}

gfx::Rect WebAXObject::GetBoundsInFrameCoordinates() const {}

WebString WebAXObject::Language() const {}

bool WebAXObject::PerformAction(const ui::AXActionData& action_data) const {}

WebAXObject WebAXObject::InPageLinkTarget() const {}

ax::mojom::Role WebAXObject::Role() const {}

static ax::mojom::TextAffinity ToAXAffinity(TextAffinity affinity) {}

bool WebAXObject::IsLoaded() const {}

void WebAXObject::Selection(bool& is_selection_backward,
                            WebAXObject& anchor_object,
                            int& anchor_offset,
                            ax::mojom::TextAffinity& anchor_affinity,
                            WebAXObject& focus_object,
                            int& focus_offset,
                            ax::mojom::TextAffinity& focus_affinity) const {}

bool WebAXObject::SetSelection(const WebAXObject& anchor_object,
                               int anchor_offset,
                               const WebAXObject& focus_object,
                               int focus_offset) const {}

WebString WebAXObject::GetValueForControl() const {}

ax::mojom::blink::WritingDirection WebAXObject::GetTextDirection() const {}

WebURL WebAXObject::Url() const {}

WebString WebAXObject::GetName(ax::mojom::NameFrom& out_name_from,
                               WebVector<WebAXObject>& out_name_objects) const {}

WebString WebAXObject::GetName() const {}

WebString WebAXObject::Description(
    ax::mojom::NameFrom name_from,
    ax::mojom::DescriptionFrom& out_description_from,
    WebVector<WebAXObject>& out_description_objects) const {}

WebString WebAXObject::Placeholder(ax::mojom::NameFrom name_from) const {}

bool WebAXObject::SupportsRangeValue() const {}

bool WebAXObject::ValueForRange(float* out_value) const {}

bool WebAXObject::MaxValueForRange(float* out_value) const {}

bool WebAXObject::MinValueForRange(float* out_value) const {}

bool WebAXObject::StepValueForRange(float* out_value) const {}

WebNode WebAXObject::GetNode() const {}

WebDocument WebAXObject::GetDocument() const {}

bool WebAXObject::IsIgnored() const {}

bool WebAXObject::IsIncludedInTree() const {}

unsigned WebAXObject::ColumnCount() const {}

unsigned WebAXObject::RowCount() const {}

WebAXObject WebAXObject::CellForColumnAndRow(unsigned column,
                                             unsigned row) const {}

void WebAXObject::RowHeaders(
    WebVector<WebAXObject>& row_header_elements) const {}

void WebAXObject::ColumnHeaders(
    WebVector<WebAXObject>& column_header_elements) const {}

unsigned WebAXObject::CellColumnIndex() const {}

unsigned WebAXObject::CellColumnSpan() const {}

unsigned WebAXObject::CellRowIndex() const {}

unsigned WebAXObject::CellRowSpan() const {}

ax::mojom::SortDirection WebAXObject::SortDirection() const {}

WebAXObject WebAXObject::NextOnLine() const {}

WebAXObject WebAXObject::PreviousOnLine() const {}

void WebAXObject::CharacterOffsets(WebVector<int>& offsets) const {}

void WebAXObject::GetWordBoundaries(WebVector<int>& starts,
                                    WebVector<int>& ends) const {}

gfx::Point WebAXObject::GetScrollOffset() const {}

gfx::Point WebAXObject::MinimumScrollOffset() const {}

gfx::Point WebAXObject::MaximumScrollOffset() const {}

void WebAXObject::SetScrollOffset(const gfx::Point& offset) const {}

void WebAXObject::GetRelativeBounds(WebAXObject& offset_container,
                                    gfx::RectF& bounds_in_container,
                                    gfx::Transform& container_transform,
                                    bool* clips_children) const {}

bool WebAXObject::ScrollToMakeVisible() const {}

bool WebAXObject::ScrollToMakeVisibleWithSubFocus(
    const gfx::Rect& subfocus,
    ax::mojom::ScrollAlignment horizontal_scroll_alignment,
    ax::mojom::ScrollAlignment vertical_scroll_alignment,
    ax::mojom::ScrollBehavior scroll_behavior) const {}

void WebAXObject::HandleAutofillSuggestionAvailabilityChanged(
    blink::WebAXAutofillSuggestionAvailability suggestion_availability) const {}

int WebAXObject::GenerateAXID() {}

void WebAXObject::SetPluginTreeSource(
    ui::AXTreeSource<const ui::AXNode*, ui::AXTreeData*, ui::AXNodeData>*
        source) {}

void WebAXObject::MarkPluginDescendantDirty(ui::AXNodeID node_id) {}

bool WebAXObject::CanCallAOMEventListenersForTesting() const {}

WebString WebAXObject::ToString(bool verbose) const {}

WebAXObject::WebAXObject(AXObject* object) :{}

WebAXObject& WebAXObject::operator=(AXObject* object) {}

bool WebAXObject::operator==(const WebAXObject& other) const {}

bool WebAXObject::operator!=(const WebAXObject& other) const {}

bool WebAXObject::operator<(const WebAXObject& other) const {}

bool WebAXObject::operator<=(const WebAXObject& other) const {}

bool WebAXObject::operator>(const WebAXObject& other) const {}

bool WebAXObject::operator>=(const WebAXObject& other) const {}

operator blink::AXObject *()

// static
WebAXObject WebAXObject::FromWebNode(const WebNode& web_node) {}

// static
WebAXObject WebAXObject::FromWebDocument(const WebDocument& web_document) {}

// static
WebAXObject WebAXObject::FromWebDocumentByID(const WebDocument& web_document,
                                             int ax_id) {}

// static
WebAXObject WebAXObject::FromWebDocumentFirstWithRole(
    const WebDocument& web_document,
    ax::mojom::blink::Role role) {}

// static
WebAXObject WebAXObject::FromWebDocumentFocused(
    const WebDocument& web_document) {}

// static
bool WebAXObject::IsDirty(const WebDocument& web_document) {}

}  // namespace blink