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

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
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 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1686 { 1686 {
1687 // If the need to add more children in addition to existing children arises, 1687 // If the need to add more children in addition to existing children arises,
1688 // childrenChanged should have been called, leaving the object with no child ren. 1688 // childrenChanged should have been called, leaving the object with no child ren.
1689 ASSERT(!m_haveChildren); 1689 ASSERT(!m_haveChildren);
1690 1690
1691 m_haveChildren = true; 1691 m_haveChildren = true;
1692 1692
1693 if (!canHaveChildren()) 1693 if (!canHaveChildren())
1694 return; 1694 return;
1695 1695
1696 for (RefPtr<AXObject> obj = firstChild(); obj; obj = obj->nextSibling()) 1696 for (RefPtrWillBeRawPtr<AXObject> obj = firstChild(); obj; obj = obj->nextSi bling())
1697 addChild(obj.get()); 1697 addChild(obj.get());
1698 1698
1699 addHiddenChildren(); 1699 addHiddenChildren();
1700 addAttachmentChildren(); 1700 addAttachmentChildren();
1701 addPopupChildren(); 1701 addPopupChildren();
1702 addImageMapChildren(); 1702 addImageMapChildren();
1703 addTextFieldChildren(); 1703 addTextFieldChildren();
1704 addCanvasChildren(); 1704 addCanvasChildren();
1705 addRemoteSVGChildren(); 1705 addRemoteSVGChildren();
1706 addInlineTextBoxChildren(false); 1706 addInlineTextBoxChildren(false);
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
2341 if (!map) 2341 if (!map)
2342 return; 2342 return;
2343 2343
2344 for (HTMLAreaElement& area : Traversal<HTMLAreaElement>::descendantsOf(*map) ) { 2344 for (HTMLAreaElement& area : Traversal<HTMLAreaElement>::descendantsOf(*map) ) {
2345 // add an <area> element for this child if it has a link 2345 // add an <area> element for this child if it has a link
2346 if (area.isLink()) { 2346 if (area.isLink()) {
2347 AXImageMapLink* areaObject = toAXImageMapLink(axObjectCache()->getOr Create(ImageMapLinkRole)); 2347 AXImageMapLink* areaObject = toAXImageMapLink(axObjectCache()->getOr Create(ImageMapLinkRole));
2348 areaObject->setHTMLAreaElement(&area); 2348 areaObject->setHTMLAreaElement(&area);
2349 areaObject->setHTMLMapElement(map); 2349 areaObject->setHTMLMapElement(map);
2350 areaObject->setParent(this); 2350 areaObject->setParent(this);
2351 if (!areaObject->accessibilityIsIgnored()) 2351 if (!areaObject->accessibilityIsIgnored()) {
2352 m_children.append(areaObject); 2352 m_children.append(areaObject);
2353 else 2353 } else {
2354 #if ENABLE(OILPAN)
2355 axObjectCache()->remove(areaObject);
2356 #else
2354 axObjectCache()->remove(areaObject->axObjectID()); 2357 axObjectCache()->remove(areaObject->axObjectID());
2358 #endif
2359 }
2355 } 2360 }
2356 } 2361 }
2357 } 2362 }
2358 2363
2359 void AXLayoutObject::addCanvasChildren() 2364 void AXLayoutObject::addCanvasChildren()
2360 { 2365 {
2361 if (!isHTMLCanvasElement(node())) 2366 if (!isHTMLCanvasElement(node()))
2362 return; 2367 return;
2363 2368
2364 // If it's a canvas, it won't have laid out children, but it might have acce ssible fallback content. 2369 // If it's a canvas, it won't have laid out children, but it might have acce ssible fallback content.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2488 if (label && label->layoutObject()) { 2493 if (label && label->layoutObject()) {
2489 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2494 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2490 result.unite(labelRect); 2495 result.unite(labelRect);
2491 } 2496 }
2492 } 2497 }
2493 2498
2494 return result; 2499 return result;
2495 } 2500 }
2496 2501
2497 } // namespace blink 2502 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698