| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 return 0; | 149 return 0; |
| 150 } | 150 } |
| 151 | 151 |
| 152 AXObject* AXObjectCacheImpl::focusedObject() | 152 AXObject* AXObjectCacheImpl::focusedObject() |
| 153 { | 153 { |
| 154 if (!accessibilityEnabled()) | 154 if (!accessibilityEnabled()) |
| 155 return 0; | 155 return 0; |
| 156 | 156 |
| 157 // We don't have to return anything if the focused frame is not local; | 157 Node* focusedNode = m_document->focusedElement(); |
| 158 // the remote frame will have its own AXObjectCacheImpl and the focused | |
| 159 // object will be sorted out by the browser process. | |
| 160 Page* page = m_document->page(); | |
| 161 if (!page->focusController().focusedFrame()) | |
| 162 return 0; | |
| 163 | |
| 164 // Get the focused node in the page. | |
| 165 Document* focusedDocument = page->focusController().focusedFrame()->document
(); | |
| 166 Node* focusedNode = focusedDocument->focusedElement(); | |
| 167 if (!focusedNode) | 158 if (!focusedNode) |
| 168 focusedNode = focusedDocument; | 159 focusedNode = m_document; |
| 169 | 160 |
| 170 // If it's an image map, get the focused link within the image map. | 161 // If it's an image map, get the focused link within the image map. |
| 171 if (isHTMLAreaElement(focusedNode)) | 162 if (isHTMLAreaElement(focusedNode)) |
| 172 return focusedImageMapUIElement(toHTMLAreaElement(focusedNode)); | 163 return focusedImageMapUIElement(toHTMLAreaElement(focusedNode)); |
| 173 | 164 |
| 174 // See if there's a page popup, for example a calendar picker. | 165 // See if there's a page popup, for example a calendar picker. |
| 175 Element* adjustedFocusedElement = focusedDocument->adjustedFocusedElement(); | 166 Element* adjustedFocusedElement = m_document->adjustedFocusedElement(); |
| 176 if (isHTMLInputElement(adjustedFocusedElement)) { | 167 if (isHTMLInputElement(adjustedFocusedElement)) { |
| 177 if (AXObject* axPopup = toHTMLInputElement(adjustedFocusedElement)->popu
pRootAXObject()) { | 168 if (AXObject* axPopup = toHTMLInputElement(adjustedFocusedElement)->popu
pRootAXObject()) { |
| 178 if (Element* focusedElementInPopup = axPopup->document()->focusedEle
ment()) | 169 if (Element* focusedElementInPopup = axPopup->document()->focusedEle
ment()) |
| 179 focusedNode = focusedElementInPopup; | 170 focusedNode = focusedElementInPopup; |
| 180 } | 171 } |
| 181 | 172 |
| 182 } | 173 } |
| 183 | 174 |
| 184 AXObject* obj = getOrCreate(focusedNode); | 175 AXObject* obj = getOrCreate(focusedNode); |
| 185 if (!obj) | 176 if (!obj) |
| (...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1272 visitor->trace(m_nodeObjectMapping); | 1263 visitor->trace(m_nodeObjectMapping); |
| 1273 #endif | 1264 #endif |
| 1274 | 1265 |
| 1275 visitor->trace(m_objects); | 1266 visitor->trace(m_objects); |
| 1276 visitor->trace(m_notificationsToPost); | 1267 visitor->trace(m_notificationsToPost); |
| 1277 | 1268 |
| 1278 AXObjectCache::trace(visitor); | 1269 AXObjectCache::trace(visitor); |
| 1279 } | 1270 } |
| 1280 | 1271 |
| 1281 } // namespace blink | 1272 } // namespace blink |
| OLD | NEW |