| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014, Google Inc. All rights reserved. | 2 * Copyright (C) 2014, Google 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 150 } |
| 151 | 151 |
| 152 return 0; | 152 return 0; |
| 153 } | 153 } |
| 154 | 154 |
| 155 AXObject* AXObjectCacheImpl::focusedObject() | 155 AXObject* AXObjectCacheImpl::focusedObject() |
| 156 { | 156 { |
| 157 if (!accessibilityEnabled()) | 157 if (!accessibilityEnabled()) |
| 158 return 0; | 158 return 0; |
| 159 | 159 |
| 160 // We don't have to return anything if the focused frame is not local; | 160 Node* focusedNode = m_document->focusedElement(); |
| 161 // the remote frame will have its own AXObjectCacheImpl and the focused | |
| 162 // object will be sorted out by the browser process. | |
| 163 Page* page = m_document->page(); | |
| 164 if (!page->focusController().focusedFrame()) | |
| 165 return 0; | |
| 166 | |
| 167 // Get the focused node in the page. | |
| 168 Document* focusedDocument = page->focusController().focusedFrame()->document
(); | |
| 169 Node* focusedNode = focusedDocument->focusedElement(); | |
| 170 if (!focusedNode) | 161 if (!focusedNode) |
| 171 focusedNode = focusedDocument; | 162 focusedNode = m_document; |
| 172 | 163 |
| 173 // If it's an image map, get the focused link within the image map. | 164 // If it's an image map, get the focused link within the image map. |
| 174 if (isHTMLAreaElement(focusedNode)) | 165 if (isHTMLAreaElement(focusedNode)) |
| 175 return focusedImageMapUIElement(toHTMLAreaElement(focusedNode)); | 166 return focusedImageMapUIElement(toHTMLAreaElement(focusedNode)); |
| 176 | 167 |
| 177 // See if there's a page popup, for example a calendar picker. | 168 // See if there's a page popup, for example a calendar picker. |
| 178 Element* adjustedFocusedElement = focusedDocument->adjustedFocusedElement(); | 169 Element* adjustedFocusedElement = m_document->adjustedFocusedElement(); |
| 179 if (isHTMLInputElement(adjustedFocusedElement)) { | 170 if (isHTMLInputElement(adjustedFocusedElement)) { |
| 180 if (AXObject* axPopup = toHTMLInputElement(adjustedFocusedElement)->popu
pRootAXObject()) { | 171 if (AXObject* axPopup = toHTMLInputElement(adjustedFocusedElement)->popu
pRootAXObject()) { |
| 181 if (Element* focusedElementInPopup = axPopup->document()->focusedEle
ment()) | 172 if (Element* focusedElementInPopup = axPopup->document()->focusedEle
ment()) |
| 182 focusedNode = focusedElementInPopup; | 173 focusedNode = focusedElementInPopup; |
| 183 } | 174 } |
| 184 | 175 |
| 185 } | 176 } |
| 186 | 177 |
| 187 AXObject* obj = getOrCreate(focusedNode); | 178 AXObject* obj = getOrCreate(focusedNode); |
| 188 if (!obj) | 179 if (!obj) |
| (...skipping 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 visitor->trace(m_nodeObjectMapping); | 1289 visitor->trace(m_nodeObjectMapping); |
| 1299 #endif | 1290 #endif |
| 1300 | 1291 |
| 1301 visitor->trace(m_objects); | 1292 visitor->trace(m_objects); |
| 1302 visitor->trace(m_notificationsToPost); | 1293 visitor->trace(m_notificationsToPost); |
| 1303 | 1294 |
| 1304 AXObjectCache::trace(visitor); | 1295 AXObjectCache::trace(visitor); |
| 1305 } | 1296 } |
| 1306 | 1297 |
| 1307 } // namespace blink | 1298 } // namespace blink |
| OLD | NEW |