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 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2204 if (!isTabItem() || !m_layoutObject) | 2204 if (!isTabItem() || !m_layoutObject) |
2205 return false; | 2205 return false; |
2206 | 2206 |
2207 Node* node = m_layoutObject->node(); | 2207 Node* node = m_layoutObject->node(); |
2208 if (!node || !node->isElementNode()) | 2208 if (!node || !node->isElementNode()) |
2209 return false; | 2209 return false; |
2210 | 2210 |
2211 // The ARIA spec says a tab item can also be selected if it is aria-labeled
by a tabpanel | 2211 // The ARIA spec says a tab item can also be selected if it is aria-labeled
by a tabpanel |
2212 // that has keyboard focus inside of it, or if a tabpanel in its aria-contro
ls list has KB | 2212 // that has keyboard focus inside of it, or if a tabpanel in its aria-contro
ls list has KB |
2213 // focus inside of it. | 2213 // focus inside of it. |
2214 AXObject* focusedElement = focusedUIElement(); | 2214 AXObject* focusedElement = axObjectCache().focusedObject(); |
2215 if (!focusedElement) | 2215 if (!focusedElement) |
2216 return false; | 2216 return false; |
2217 | 2217 |
2218 WillBeHeapVector<RawPtrWillBeMember<Element>> elements; | 2218 WillBeHeapVector<RawPtrWillBeMember<Element>> elements; |
2219 elementsFromAttribute(elements, aria_controlsAttr); | 2219 elementsFromAttribute(elements, aria_controlsAttr); |
2220 | 2220 |
2221 for (const auto& element : elements) { | 2221 for (const auto& element : elements) { |
2222 AXObject* tabPanel = axObjectCache().getOrCreate(element); | 2222 AXObject* tabPanel = axObjectCache().getOrCreate(element); |
2223 | 2223 |
2224 // A tab item should only control tab panels. | 2224 // A tab item should only control tab panels. |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2535 if (label && label->layoutObject()) { | 2535 if (label && label->layoutObject()) { |
2536 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); | 2536 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); |
2537 result.unite(labelRect); | 2537 result.unite(labelRect); |
2538 } | 2538 } |
2539 } | 2539 } |
2540 | 2540 |
2541 return result; | 2541 return result; |
2542 } | 2542 } |
2543 | 2543 |
2544 } // namespace blink | 2544 } // namespace blink |
OLD | NEW |