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

Side by Side 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, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * (C) 2007 Eric Seidel (eric@webkit.org) 9 * (C) 2007 Eric Seidel (eric@webkit.org)
10 * 10 *
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 return cache->get()->computedRoleForNode(this); 1180 return cache->get()->computedRoleForNode(this);
1181 } 1181 }
1182 1182
1183 String Element::computedName() { 1183 String Element::computedName() {
1184 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); 1184 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
1185 std::unique_ptr<ScopedAXObjectCache> cache = 1185 std::unique_ptr<ScopedAXObjectCache> cache =
1186 ScopedAXObjectCache::create(document()); 1186 ScopedAXObjectCache::create(document());
1187 return cache->get()->computedNameForNode(this); 1187 return cache->get()->computedNameForNode(this);
1188 } 1188 }
1189 1189
1190 AccessibleNode* Element::existingAccessibleNode() const {
1191 if (!RuntimeEnabledFeatures::accessibilityObjectModelEnabled())
1192 return nullptr;
1193
1194 if (!hasRareData())
1195 return nullptr;
1196
1197 return elementRareData()->accessibleNode();
1198 }
1199
1200 AccessibleNode* Element::accessibleNode() {
1201 if (!RuntimeEnabledFeatures::accessibilityObjectModelEnabled())
1202 return nullptr;
1203
1204 ElementRareData& rareData = ensureElementRareData();
1205 return rareData.ensureAccessibleNode(this);
1206 }
1207
1190 const AtomicString& Element::getAttribute(const AtomicString& localName) const { 1208 const AtomicString& Element::getAttribute(const AtomicString& localName) const {
1191 if (!elementData()) 1209 if (!elementData())
1192 return nullAtom; 1210 return nullAtom;
1193 synchronizeAttribute(localName); 1211 synchronizeAttribute(localName);
1194 if (const Attribute* attribute = elementData()->attributes().find( 1212 if (const Attribute* attribute = elementData()->attributes().find(
1195 localName, shouldIgnoreAttributeCase())) 1213 localName, shouldIgnoreAttributeCase()))
1196 return attribute->value(); 1214 return attribute->value();
1197 return nullAtom; 1215 return nullAtom;
1198 } 1216 }
1199 1217
(...skipping 3052 matching lines...) Expand 10 before | Expand all | Expand 10 after
4252 } 4270 }
4253 4271
4254 DEFINE_TRACE_WRAPPERS(Element) { 4272 DEFINE_TRACE_WRAPPERS(Element) {
4255 if (hasRareData()) { 4273 if (hasRareData()) {
4256 visitor->traceWrappers(elementRareData()); 4274 visitor->traceWrappers(elementRareData());
4257 } 4275 }
4258 ContainerNode::traceWrappers(visitor); 4276 ContainerNode::traceWrappers(visitor);
4259 } 4277 }
4260 4278
4261 } // namespace blink 4279 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698