| OLD | NEW |
| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 AXLayoutObject::AXLayoutObject(LayoutObject* layoutObject, AXObjectCacheImpl* ax
ObjectCache) | 170 AXLayoutObject::AXLayoutObject(LayoutObject* layoutObject, AXObjectCacheImpl* ax
ObjectCache) |
| 171 : AXNodeObject(layoutObject->node(), axObjectCache) | 171 : AXNodeObject(layoutObject->node(), axObjectCache) |
| 172 , m_layoutObject(layoutObject) | 172 , m_layoutObject(layoutObject) |
| 173 , m_cachedElementRectDirty(true) | 173 , m_cachedElementRectDirty(true) |
| 174 { | 174 { |
| 175 #if ENABLE(ASSERT) | 175 #if ENABLE(ASSERT) |
| 176 m_layoutObject->setHasAXObject(true); | 176 m_layoutObject->setHasAXObject(true); |
| 177 #endif | 177 #endif |
| 178 } | 178 } |
| 179 | 179 |
| 180 PassRefPtr<AXLayoutObject> AXLayoutObject::create(LayoutObject* layoutObject, AX
ObjectCacheImpl* axObjectCache) | 180 PassRefPtrWillBeRawPtr<AXLayoutObject> AXLayoutObject::create(LayoutObject* layo
utObject, AXObjectCacheImpl* axObjectCache) |
| 181 { | 181 { |
| 182 return adoptRef(new AXLayoutObject(layoutObject, axObjectCache)); | 182 return adoptRefWillBeNoop(new AXLayoutObject(layoutObject, axObjectCache)); |
| 183 } | 183 } |
| 184 | 184 |
| 185 AXLayoutObject::~AXLayoutObject() | 185 AXLayoutObject::~AXLayoutObject() |
| 186 { | 186 { |
| 187 ASSERT(isDetached()); | 187 ASSERT(isDetached()); |
| 188 } | 188 } |
| 189 | 189 |
| 190 LayoutRect AXLayoutObject::elementRect() const | 190 LayoutRect AXLayoutObject::elementRect() const |
| 191 { | 191 { |
| 192 if (!m_explicitElementRect.isEmpty()) | 192 if (!m_explicitElementRect.isEmpty()) |
| (...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1463 { | 1463 { |
| 1464 // If the need to add more children in addition to existing children arises, | 1464 // If the need to add more children in addition to existing children arises, |
| 1465 // childrenChanged should have been called, leaving the object with no child
ren. | 1465 // childrenChanged should have been called, leaving the object with no child
ren. |
| 1466 ASSERT(!m_haveChildren); | 1466 ASSERT(!m_haveChildren); |
| 1467 | 1467 |
| 1468 m_haveChildren = true; | 1468 m_haveChildren = true; |
| 1469 | 1469 |
| 1470 if (!canHaveChildren()) | 1470 if (!canHaveChildren()) |
| 1471 return; | 1471 return; |
| 1472 | 1472 |
| 1473 for (RefPtr<AXObject> obj = firstChild(); obj; obj = obj->nextSibling()) | 1473 for (RefPtrWillBeRawPtr<AXObject> obj = firstChild(); obj; obj = obj->nextSi
bling()) |
| 1474 addChild(obj.get()); | 1474 addChild(obj.get()); |
| 1475 | 1475 |
| 1476 addHiddenChildren(); | 1476 addHiddenChildren(); |
| 1477 addAttachmentChildren(); | 1477 addAttachmentChildren(); |
| 1478 addPopupChildren(); | 1478 addPopupChildren(); |
| 1479 addImageMapChildren(); | 1479 addImageMapChildren(); |
| 1480 addTextFieldChildren(); | 1480 addTextFieldChildren(); |
| 1481 addCanvasChildren(); | 1481 addCanvasChildren(); |
| 1482 addRemoteSVGChildren(); | 1482 addRemoteSVGChildren(); |
| 1483 addInlineTextBoxChildren(false); | 1483 addInlineTextBoxChildren(false); |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2129 if (!map) | 2129 if (!map) |
| 2130 return; | 2130 return; |
| 2131 | 2131 |
| 2132 for (HTMLAreaElement& area : Traversal<HTMLAreaElement>::descendantsOf(*map)
) { | 2132 for (HTMLAreaElement& area : Traversal<HTMLAreaElement>::descendantsOf(*map)
) { |
| 2133 // add an <area> element for this child if it has a link | 2133 // add an <area> element for this child if it has a link |
| 2134 if (area.isLink()) { | 2134 if (area.isLink()) { |
| 2135 AXImageMapLink* areaObject = toAXImageMapLink(axObjectCache()->getOr
Create(ImageMapLinkRole)); | 2135 AXImageMapLink* areaObject = toAXImageMapLink(axObjectCache()->getOr
Create(ImageMapLinkRole)); |
| 2136 areaObject->setHTMLAreaElement(&area); | 2136 areaObject->setHTMLAreaElement(&area); |
| 2137 areaObject->setHTMLMapElement(map); | 2137 areaObject->setHTMLMapElement(map); |
| 2138 areaObject->setParent(this); | 2138 areaObject->setParent(this); |
| 2139 if (!areaObject->accessibilityIsIgnored()) | 2139 if (!areaObject->accessibilityIsIgnored()) { |
| 2140 m_children.append(areaObject); | 2140 m_children.append(areaObject); |
| 2141 else | 2141 } else { |
| 2142 #if ENABLE(OILPAN) |
| 2143 axObjectCache()->remove(areaObject); |
| 2144 #else |
| 2142 axObjectCache()->remove(areaObject->axObjectID()); | 2145 axObjectCache()->remove(areaObject->axObjectID()); |
| 2146 #endif |
| 2147 } |
| 2143 } | 2148 } |
| 2144 } | 2149 } |
| 2145 } | 2150 } |
| 2146 | 2151 |
| 2147 void AXLayoutObject::addCanvasChildren() | 2152 void AXLayoutObject::addCanvasChildren() |
| 2148 { | 2153 { |
| 2149 if (!isHTMLCanvasElement(node())) | 2154 if (!isHTMLCanvasElement(node())) |
| 2150 return; | 2155 return; |
| 2151 | 2156 |
| 2152 // If it's a canvas, it won't have laid out children, but it might have acce
ssible fallback content. | 2157 // 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 Loading... |
| 2276 if (label && label->layoutObject()) { | 2281 if (label && label->layoutObject()) { |
| 2277 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); | 2282 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); |
| 2278 result.unite(labelRect); | 2283 result.unite(labelRect); |
| 2279 } | 2284 } |
| 2280 } | 2285 } |
| 2281 | 2286 |
| 2282 return result; | 2287 return result; |
| 2283 } | 2288 } |
| 2284 | 2289 |
| 2285 } // namespace blink | 2290 } // namespace blink |
| OLD | NEW |