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

Side by Side Diff: Source/modules/accessibility/AXLayoutObject.cpp

Issue 1072273006: Oilpan: Prepare moving AXObject to heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.h ('k') | Source/modules/accessibility/AXList.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 AXLayoutObject::AXLayoutObject(LayoutObject* layoutObject, AXObjectCacheImpl& ax ObjectCache) 174 AXLayoutObject::AXLayoutObject(LayoutObject* layoutObject, AXObjectCacheImpl& ax ObjectCache)
175 : AXNodeObject(layoutObject->node(), axObjectCache) 175 : AXNodeObject(layoutObject->node(), axObjectCache)
176 , m_layoutObject(layoutObject) 176 , m_layoutObject(layoutObject)
177 , m_cachedElementRectDirty(true) 177 , m_cachedElementRectDirty(true)
178 { 178 {
179 #if ENABLE(ASSERT) 179 #if ENABLE(ASSERT)
180 m_layoutObject->setHasAXObject(true); 180 m_layoutObject->setHasAXObject(true);
181 #endif 181 #endif
182 } 182 }
183 183
184 PassRefPtr<AXLayoutObject> AXLayoutObject::create(LayoutObject* layoutObject, AX ObjectCacheImpl& axObjectCache) 184 PassRefPtrWillBeRawPtr<AXLayoutObject> AXLayoutObject::create(LayoutObject* layo utObject, AXObjectCacheImpl& axObjectCache)
185 { 185 {
186 return adoptRef(new AXLayoutObject(layoutObject, axObjectCache)); 186 return adoptRefWillBeNoop(new AXLayoutObject(layoutObject, axObjectCache));
187 } 187 }
188 188
189 AXLayoutObject::~AXLayoutObject() 189 AXLayoutObject::~AXLayoutObject()
190 { 190 {
191 ASSERT(isDetached()); 191 ASSERT(isDetached());
192 } 192 }
193 193
194 LayoutRect AXLayoutObject::elementRect() const 194 LayoutRect AXLayoutObject::elementRect() const
195 { 195 {
196 if (!m_explicitElementRect.isEmpty()) 196 if (!m_explicitElementRect.isEmpty())
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 ASSERT(!m_haveChildren); 1700 ASSERT(!m_haveChildren);
1701 1701
1702 m_haveChildren = true; 1702 m_haveChildren = true;
1703 1703
1704 if (!canHaveChildren()) 1704 if (!canHaveChildren())
1705 return; 1705 return;
1706 1706
1707 Vector<AXObject*> ownedChildren; 1707 Vector<AXObject*> ownedChildren;
1708 computeAriaOwnsChildren(ownedChildren); 1708 computeAriaOwnsChildren(ownedChildren);
1709 1709
1710 for (RefPtr<AXObject> obj = firstChild(); obj; obj = obj->nextSibling()) { 1710 for (RefPtrWillBeRawPtr<AXObject> obj = firstChild(); obj; obj = obj->nextSi bling()) {
1711 if (!axObjectCache().isAriaOwned(obj.get())) 1711 if (!axObjectCache().isAriaOwned(obj.get()))
1712 addChild(obj.get()); 1712 addChild(obj.get());
1713 } 1713 }
1714 1714
1715 addHiddenChildren(); 1715 addHiddenChildren();
1716 addAttachmentChildren(); 1716 addAttachmentChildren();
1717 addPopupChildren(); 1717 addPopupChildren();
1718 addImageMapChildren(); 1718 addImageMapChildren();
1719 addTextFieldChildren(); 1719 addTextFieldChildren();
1720 addCanvasChildren(); 1720 addCanvasChildren();
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2360 if (!map) 2360 if (!map)
2361 return; 2361 return;
2362 2362
2363 for (HTMLAreaElement& area : Traversal<HTMLAreaElement>::descendantsOf(*map) ) { 2363 for (HTMLAreaElement& area : Traversal<HTMLAreaElement>::descendantsOf(*map) ) {
2364 // add an <area> element for this child if it has a link 2364 // add an <area> element for this child if it has a link
2365 if (area.isLink()) { 2365 if (area.isLink()) {
2366 AXImageMapLink* areaObject = toAXImageMapLink(axObjectCache().getOrC reate(ImageMapLinkRole)); 2366 AXImageMapLink* areaObject = toAXImageMapLink(axObjectCache().getOrC reate(ImageMapLinkRole));
2367 areaObject->setHTMLAreaElement(&area); 2367 areaObject->setHTMLAreaElement(&area);
2368 areaObject->setHTMLMapElement(map); 2368 areaObject->setHTMLMapElement(map);
2369 areaObject->setParent(this); 2369 areaObject->setParent(this);
2370 ASSERT(areaObject->axObjectID() != 0);
2370 if (!areaObject->accessibilityIsIgnored()) 2371 if (!areaObject->accessibilityIsIgnored())
2371 m_children.append(areaObject); 2372 m_children.append(areaObject);
2372 else 2373 else
2373 axObjectCache().remove(areaObject->axObjectID()); 2374 axObjectCache().remove(areaObject->axObjectID());
2374 } 2375 }
2375 } 2376 }
2376 } 2377 }
2377 2378
2378 void AXLayoutObject::addCanvasChildren() 2379 void AXLayoutObject::addCanvasChildren()
2379 { 2380 {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
2507 if (label && label->layoutObject()) { 2508 if (label && label->layoutObject()) {
2508 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct(); 2509 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct();
2509 result.unite(labelRect); 2510 result.unite(labelRect);
2510 } 2511 }
2511 } 2512 }
2512 2513
2513 return result; 2514 return result;
2514 } 2515 }
2515 2516
2516 } // namespace blink 2517 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.h ('k') | Source/modules/accessibility/AXList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698