diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-05-15 10:20:33 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-05-15 10:28:57 +0000 |
commit | d17ea114e5ef69ad5d5d7413280a13e6428098aa (patch) | |
tree | 2c01a75df69f30d27b1432467cfe7c1467a498da /chromium/third_party/blink/renderer/modules/accessibility/ax_virtual_object.cc | |
parent | 8c5c43c7b138c9b4b0bf56d946e61d3bbc111bec (diff) | |
download | qtwebengine-chromium-d17ea114e5ef69ad5d5d7413280a13e6428098aa.tar.gz |
BASELINE: Update Chromium to 67.0.3396.47
Change-Id: Idcb1341782e417561a2473eeecc82642dafda5b7
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/accessibility/ax_virtual_object.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/accessibility/ax_virtual_object.cc | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_virtual_object.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_virtual_object.cc new file mode 100644 index 00000000000..c6b0a3f77a0 --- /dev/null +++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_virtual_object.cc @@ -0,0 +1,78 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h" +#include "third_party/blink/renderer/modules/accessibility/ax_virtual_object.h" + +namespace blink { + +AXVirtualObject::AXVirtualObject(AXObjectCacheImpl& axObjectCache, + AccessibleNode* accessible_node) + : AXObject(axObjectCache), accessible_node_(accessible_node) { +} + +AXVirtualObject::~AXVirtualObject() = default; + +void AXVirtualObject::Detach() { + AXObject::Detach(); + + accessible_node_ = nullptr; +} + +bool AXVirtualObject::ComputeAccessibilityIsIgnored( + IgnoredReasons* ignoredReasons) const { + return AccessibilityIsIgnoredByDefault(ignoredReasons); +} + +void AXVirtualObject::AddChildren() { + if (!accessible_node_) + return; + + for (const auto& child : accessible_node_->GetChildren()) + children_.push_back(AXObjectCache().GetOrCreate(child)); +} + +const AtomicString& AXVirtualObject::GetAOMPropertyOrARIAAttribute( + AOMStringProperty property) const { + if (!accessible_node_) + return g_null_atom; + + return accessible_node_->GetProperty(property); +} + +bool AXVirtualObject::HasAOMPropertyOrARIAAttribute(AOMBooleanProperty property, + bool& result) const { + if (!accessible_node_) + return false; + + bool is_null = true; + result = accessible_node_->GetProperty(property, is_null); + return !is_null; +} + +AccessibleNode* AXVirtualObject::GetAccessibleNode() const { + return accessible_node_; +} + +String AXVirtualObject::TextAlternative(bool recursive, + bool in_aria_labelled_by_traversal, + AXObjectSet& visited, + AXNameFrom& name_from, + AXRelatedObjectVector* related_objects, + NameSources* name_sources) const { + if (!accessible_node_) + return String(); + + bool found_text_alternative = false; + return AriaTextAlternative(recursive, in_aria_labelled_by_traversal, visited, + name_from, related_objects, name_sources, + &found_text_alternative); +} + +void AXVirtualObject::Trace(blink::Visitor* visitor) { + visitor->Trace(accessible_node_); + AXObject::Trace(visitor); +} + +} // namespace blink |