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