Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2791943002: Re-land: Initial skeleton of Accessibility Object Model Phase 1 (Closed)
Patch Set: Fix for crash with test Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 939513be530ab3f38d2d9839257f98d8bec967ae..585beca84fb915bb397971818812de64b35f9488 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1187,6 +1187,24 @@ String Element::computedName() {
return cache->get()->computedNameForNode(this);
}
+AccessibleNode* Element::existingAccessibleNode() const {
+ if (!RuntimeEnabledFeatures::accessibilityObjectModelEnabled())
+ return nullptr;
+
+ if (!hasRareData())
+ return nullptr;
+
+ return elementRareData()->accessibleNode();
+}
+
+AccessibleNode* Element::accessibleNode() {
+ if (!RuntimeEnabledFeatures::accessibilityObjectModelEnabled())
+ return nullptr;
+
+ ElementRareData& rareData = ensureElementRareData();
+ return rareData.ensureAccessibleNode(this);
+}
+
const AtomicString& Element::getAttribute(const AtomicString& localName) const {
if (!elementData())
return nullAtom;

Powered by Google App Engine
This is Rietveld 408576698