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

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

Issue 1589623002: Keep track of accessibility focus across windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 4 years, 10 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 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after
2203 if (!isTabItem() || !m_layoutObject) 2203 if (!isTabItem() || !m_layoutObject)
2204 return false; 2204 return false;
2205 2205
2206 Node* node = m_layoutObject->node(); 2206 Node* node = m_layoutObject->node();
2207 if (!node || !node->isElementNode()) 2207 if (!node || !node->isElementNode())
2208 return false; 2208 return false;
2209 2209
2210 // The ARIA spec says a tab item can also be selected if it is aria-labeled by a tabpanel 2210 // The ARIA spec says a tab item can also be selected if it is aria-labeled by a tabpanel
2211 // that has keyboard focus inside of it, or if a tabpanel in its aria-contro ls list has KB 2211 // that has keyboard focus inside of it, or if a tabpanel in its aria-contro ls list has KB
2212 // focus inside of it. 2212 // focus inside of it.
2213 AXObject* focusedElement = focusedUIElement(); 2213 AXObject* focusedElement = axObjectCache().focusedObject();
2214 if (!focusedElement) 2214 if (!focusedElement)
2215 return false; 2215 return false;
2216 2216
2217 WillBeHeapVector<RawPtrWillBeMember<Element>> elements; 2217 WillBeHeapVector<RawPtrWillBeMember<Element>> elements;
2218 elementsFromAttribute(elements, aria_controlsAttr); 2218 elementsFromAttribute(elements, aria_controlsAttr);
2219 2219
2220 for (const auto& element : elements) { 2220 for (const auto& element : elements) {
2221 AXObject* tabPanel = axObjectCache().getOrCreate(element); 2221 AXObject* tabPanel = axObjectCache().getOrCreate(element);
2222 2222
2223 // A tab item should only control tab panels. 2223 // A tab item should only control tab panels.
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
2534 if (label && label->layoutObject()) { 2534 if (label && label->layoutObject()) {
2535 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct(); 2535 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe ct();
2536 result.unite(labelRect); 2536 result.unite(labelRect);
2537 } 2537 }
2538 } 2538 }
2539 2539
2540 return result; 2540 return result;
2541 } 2541 }
2542 2542
2543 } // namespace blink 2543 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698