chromium/content/web_test/renderer/web_ax_object_proxy.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "content/web_test/renderer/web_ax_object_proxy.h"

#include <stddef.h>

#include <algorithm>
#include <map>
#include <utility>

#include "base/strings/stringprintf.h"
#include "gin/handle.h"
#include "third_party/blink/public/platform/scheduler/web_agent_group_scheduler.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/web/blink.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "ui/accessibility/ax_action_data.h"
#include "ui/accessibility/ax_enum_util.h"
#include "ui/accessibility/ax_enums.mojom-shared.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/transform.h"

namespace content {

namespace {

// Map role value to string, matching Safari/Mac platform implementation to
// avoid rebaselining web tests.
std::string RoleToString(ax::mojom::Role role) {}

std::string GetStringValue(const blink::WebAXObject& object) {}

std::string GetRole(const blink::WebAXObject& object) {}

std::string GetLanguage(const blink::WebAXObject& object) {}

std::string GetAttributes(const blink::WebAXObject& object) {}

// New bounds calculation algorithm.  Retrieves the frame-relative bounds
// of an object by calling getRelativeBounds and then applying the offsets
// and transforms recursively on each container of this object.
gfx::RectF BoundsForObject(const blink::WebAXObject& object) {}

gfx::Rect BoundsForCharacter(const blink::WebAXObject& object,
                             int character_index) {}

void GetBoundariesForOneWord(const blink::WebAXObject& object,
                             int character_index,
                             int& word_start,
                             int& word_end) {}

// Collects attributes into a string, delimited by dashes. Used by all methods
// that output lists of attributes: attributesOfLinkedUIElementsCallback,
// AttributesOfChildrenCallback, etc.
class AttributesCollector {};

}  // namespace

gin::WrapperInfo WebAXObjectProxy::kWrapperInfo =;

WebAXObjectProxy::WebAXObjectProxy(const blink::WebAXObject& object,
                                   WebAXObjectProxy::Factory* factory)
    :{}

WebAXObjectProxy::~WebAXObjectProxy() = default;

bool WebAXObjectProxy::UpdateLayout() {}

ui::AXNodeData WebAXObjectProxy::GetAXNodeData() const {}

gin::ObjectTemplateBuilder WebAXObjectProxy::GetObjectTemplateBuilder(
    v8::Isolate* isolate) {}

v8::Local<v8::Object> WebAXObjectProxy::GetChildAtIndex(unsigned index) {}

bool WebAXObjectProxy::IsRoot() const {}

bool WebAXObjectProxy::IsEqualToObject(const blink::WebAXObject& other) {}

void WebAXObjectProxy::NotificationReceived(
    blink::WebLocalFrame* frame,
    const std::string& notification_name,
    const std::vector<ui::AXEventIntent>& event_intents) {}

void WebAXObjectProxy::Reset() {}

std::string WebAXObjectProxy::Role() {}

std::string WebAXObjectProxy::StringValue() {}

std::string WebAXObjectProxy::Language() {}

int WebAXObjectProxy::X() {}

int WebAXObjectProxy::Y() {}

int WebAXObjectProxy::Width() {}

int WebAXObjectProxy::Height() {}

v8::Local<v8::Value> WebAXObjectProxy::InPageLinkTarget(v8::Isolate* isolate) {}

int WebAXObjectProxy::IntValue() {}

int WebAXObjectProxy::MinValue() {}

int WebAXObjectProxy::MaxValue() {}

int WebAXObjectProxy::StepValue() {}

std::string WebAXObjectProxy::ValueDescription() {}

int WebAXObjectProxy::ChildrenCount() {}

bool WebAXObjectProxy::SelectionIsBackward() {}

v8::Local<v8::Value> WebAXObjectProxy::SelectionAnchorObject(
    v8::Isolate* isolate) {}

int WebAXObjectProxy::SelectionAnchorOffset() {}

std::string WebAXObjectProxy::SelectionAnchorAffinity() {}

v8::Local<v8::Value> WebAXObjectProxy::SelectionFocusObject(
    v8::Isolate* isolate) {}

int WebAXObjectProxy::SelectionFocusOffset() {}

std::string WebAXObjectProxy::SelectionFocusAffinity() {}

bool WebAXObjectProxy::IsAtomic() {}

bool WebAXObjectProxy::IsAutofillAvailable() {}

bool WebAXObjectProxy::IsBusy() {}

std::string WebAXObjectProxy::Restriction() {}

bool WebAXObjectProxy::IsRequired() {}

bool WebAXObjectProxy::IsEditableRoot() {}

bool WebAXObjectProxy::IsEditable() {}

bool WebAXObjectProxy::IsRichlyEditable() {}

bool WebAXObjectProxy::IsFocused() {}

bool WebAXObjectProxy::IsFocusable() {}

bool WebAXObjectProxy::IsModal() {}

bool WebAXObjectProxy::IsSelected() {}

bool WebAXObjectProxy::IsSelectable() {}

bool WebAXObjectProxy::IsMultiLine() {}

bool WebAXObjectProxy::IsMultiSelectable() {}

bool WebAXObjectProxy::IsExpanded() {}

std::string WebAXObjectProxy::Checked() {}

bool WebAXObjectProxy::IsCollapsed() {}

bool WebAXObjectProxy::IsVisible() {}

bool WebAXObjectProxy::IsVisited() {}

bool WebAXObjectProxy::IsOffScreen() {}

bool WebAXObjectProxy::IsValid() {}

bool WebAXObjectProxy::IsReadOnly() {}

bool WebAXObjectProxy::IsIgnored() {}

v8::Local<v8::Object> WebAXObjectProxy::ActiveDescendant() {}

unsigned int WebAXObjectProxy::BackgroundColor() {}

unsigned int WebAXObjectProxy::Color() {}

// For input elements of type color.
unsigned int WebAXObjectProxy::ColorValue() {}

std::string WebAXObjectProxy::FontFamily() {}

float WebAXObjectProxy::FontSize() {}

std::string WebAXObjectProxy::Autocomplete() {}

std::string WebAXObjectProxy::Current() {}

std::string WebAXObjectProxy::HasPopup() {}

std::string WebAXObjectProxy::Invalid() {}

std::string WebAXObjectProxy::KeyShortcuts() {}

int32_t WebAXObjectProxy::AriaColumnCount() {}

uint32_t WebAXObjectProxy::AriaColumnIndex() {}

uint32_t WebAXObjectProxy::AriaColumnSpan() {}

int32_t WebAXObjectProxy::AriaRowCount() {}

uint32_t WebAXObjectProxy::AriaRowIndex() {}

uint32_t WebAXObjectProxy::AriaRowSpan() {}

std::string WebAXObjectProxy::Live() {}

std::string WebAXObjectProxy::Orientation() {}

std::string WebAXObjectProxy::Relevant() {}

std::string WebAXObjectProxy::RoleDescription() {}

std::string WebAXObjectProxy::Sort() {}

std::string WebAXObjectProxy::Url() {}

int WebAXObjectProxy::HierarchicalLevel() {}

int WebAXObjectProxy::PosInSet() {}

int WebAXObjectProxy::SetSize() {}

int WebAXObjectProxy::ClickPointX() {}

int WebAXObjectProxy::ClickPointY() {}

int32_t WebAXObjectProxy::RowCount() {}

int32_t WebAXObjectProxy::RowHeadersCount() {}

int32_t WebAXObjectProxy::ColumnCount() {}

int32_t WebAXObjectProxy::ColumnHeadersCount() {}

bool WebAXObjectProxy::IsClickable() {}

v8::Local<v8::Object> WebAXObjectProxy::AriaActiveDescendantElement() {}

v8::Local<v8::Object> WebAXObjectProxy::AriaControlsElementAtIndex(
    unsigned index) {}

v8::Local<v8::Object> WebAXObjectProxy::AriaDetailsElementAtIndex(
    unsigned index) {}

v8::Local<v8::Object> WebAXObjectProxy::AriaErrorMessageElementAtIndex(
    unsigned index) {}

v8::Local<v8::Object> WebAXObjectProxy::AriaFlowToElementAtIndex(
    unsigned index) {}

v8::Local<v8::Object> WebAXObjectProxy::AriaOwnsElementAtIndex(unsigned index) {}

std::string WebAXObjectProxy::AllAttributes() {}

std::string WebAXObjectProxy::AttributesOfChildren() {}

std::string WebAXObjectProxy::BoundsForRange(int start, int end) {}

v8::Local<v8::Object> WebAXObjectProxy::ChildAtIndex(int index) {}

v8::Local<v8::Object> WebAXObjectProxy::ElementAtPoint(int x, int y) {}

v8::Local<v8::Object> WebAXObjectProxy::RowHeaderAtIndex(unsigned index) {}

v8::Local<v8::Object> WebAXObjectProxy::ColumnHeaderAtIndex(unsigned index) {}

std::string WebAXObjectProxy::RowIndexRange() {}

std::string WebAXObjectProxy::ColumnIndexRange() {}

v8::Local<v8::Object> WebAXObjectProxy::CellForColumnAndRow(int column,
                                                            int row) {}

void WebAXObjectProxy::SetSelectedTextRange(int selection_start, int length) {}

bool WebAXObjectProxy::SetSelection(v8::Isolate* isolate,
                                    v8::Local<v8::Value> anchor_object,
                                    int anchor_offset,
                                    v8::Local<v8::Value> focus_object,
                                    int focus_offset) {}

bool WebAXObjectProxy::IsAttributeSettable(const std::string& attribute) {}

bool WebAXObjectProxy::IsPressActionSupported() {}

bool WebAXObjectProxy::HasDefaultAction() {}

v8::Local<v8::Object> WebAXObjectProxy::ParentElement() {}

void WebAXObjectProxy::Increment() {}

void WebAXObjectProxy::Decrement() {}

void WebAXObjectProxy::ShowMenu() {}

void WebAXObjectProxy::Press() {}

bool WebAXObjectProxy::SetValue(const std::string& value) {}

bool WebAXObjectProxy::IsEqual(v8::Isolate* isolate,
                               v8::Local<v8::Object> proxy) {}

void WebAXObjectProxy::SetNotificationListener(
    v8::Isolate* isolate,
    v8::Local<v8::Function> callback) {}

void WebAXObjectProxy::UnsetNotificationListener() {}

void WebAXObjectProxy::TakeFocus() {}

void WebAXObjectProxy::ScrollToMakeVisible() {}

void WebAXObjectProxy::ScrollToMakeVisibleWithSubFocus(int x,
                                                       int y,
                                                       int width,
                                                       int height) {}

void WebAXObjectProxy::ScrollToGlobalPoint(int x, int y) {}

void WebAXObjectProxy::ScrollUp() {}

void WebAXObjectProxy::ScrollDown() {}

int WebAXObjectProxy::ScrollX() {}

int WebAXObjectProxy::ScrollY() {}

std::string WebAXObjectProxy::ToString() {}

float WebAXObjectProxy::BoundsX() {}

float WebAXObjectProxy::BoundsY() {}

float WebAXObjectProxy::BoundsWidth() {}

float WebAXObjectProxy::BoundsHeight() {}

int WebAXObjectProxy::WordStart(int character_index) {}

int WebAXObjectProxy::WordEnd(int character_index) {}

v8::Local<v8::Object> WebAXObjectProxy::NextOnLine() {}

v8::Local<v8::Object> WebAXObjectProxy::PreviousOnLine() {}

std::vector<std::string> WebAXObjectProxy::GetMisspellings() const {}

std::string WebAXObjectProxy::MisspellingAtIndex(int index) {}

std::string WebAXObjectProxy::Name() {}

std::string WebAXObjectProxy::NameFrom() {}

int WebAXObjectProxy::NameElementCount() {}

v8::Local<v8::Object> WebAXObjectProxy::NameElementAtIndex(unsigned index) {}

std::string WebAXObjectProxy::Description() {}

std::string WebAXObjectProxy::DescriptionFrom() {}

std::string WebAXObjectProxy::Placeholder() {}

int WebAXObjectProxy::MisspellingsCount() {}

int WebAXObjectProxy::DescriptionElementCount() {}

v8::Local<v8::Object> WebAXObjectProxy::DescriptionElementAtIndex(
    unsigned index) {}

v8::Local<v8::Object> WebAXObjectProxy::OffsetContainer() {}

float WebAXObjectProxy::BoundsInContainerX() {}

float WebAXObjectProxy::BoundsInContainerY() {}

float WebAXObjectProxy::BoundsInContainerWidth() {}

float WebAXObjectProxy::BoundsInContainerHeight() {}

bool WebAXObjectProxy::HasNonIdentityTransform() {}

RootWebAXObjectProxy::RootWebAXObjectProxy(const blink::WebAXObject& object,
                                           Factory* factory)
    :{}

v8::Local<v8::Object> RootWebAXObjectProxy::GetChildAtIndex(unsigned index) {}

bool RootWebAXObjectProxy::IsRoot() const {}

WebAXObjectProxyList::WebAXObjectProxyList(v8::Isolate* isolate,
                                           blink::WebAXContext& ax_context)
    :{}

WebAXObjectProxyList::~WebAXObjectProxyList() {}

void WebAXObjectProxyList::Remove(unsigned axid) {}

void WebAXObjectProxyList::Clear() {}

v8::Local<v8::Object> WebAXObjectProxyList::GetOrCreate(
    const blink::WebAXObject& object) {}

blink::WebAXContext* WebAXObjectProxyList::GetAXContext() {}

}  // namespace content