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 13 matching lines...) Expand all Loading... |
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #include "modules/accessibility/AXLayoutObject.h" | 29 #include "modules/accessibility/AXLayoutObject.h" |
30 | 30 |
31 #include "bindings/core/v8/ExceptionState.h" | 31 #include "bindings/core/v8/ExceptionState.h" |
32 #include "core/CSSPropertyNames.h" | 32 #include "core/CSSPropertyNames.h" |
33 #include "core/InputTypeNames.h" | 33 #include "core/InputTypeNames.h" |
| 34 #include "core/dom/AccessibleNode.h" |
34 #include "core/dom/ElementTraversal.h" | 35 #include "core/dom/ElementTraversal.h" |
35 #include "core/dom/Range.h" | 36 #include "core/dom/Range.h" |
36 #include "core/dom/shadow/ShadowRoot.h" | 37 #include "core/dom/shadow/ShadowRoot.h" |
37 #include "core/editing/EditingUtilities.h" | 38 #include "core/editing/EditingUtilities.h" |
38 #include "core/editing/FrameSelection.h" | 39 #include "core/editing/FrameSelection.h" |
39 #include "core/editing/RenderedPosition.h" | 40 #include "core/editing/RenderedPosition.h" |
40 #include "core/editing/TextAffinity.h" | 41 #include "core/editing/TextAffinity.h" |
41 #include "core/editing/VisibleUnits.h" | 42 #include "core/editing/VisibleUnits.h" |
42 #include "core/editing/iterators/CharacterIterator.h" | 43 #include "core/editing/iterators/CharacterIterator.h" |
43 #include "core/editing/iterators/TextIterator.h" | 44 #include "core/editing/iterators/TextIterator.h" |
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 // | 1317 // |
1317 // ARIA live-region features. | 1318 // ARIA live-region features. |
1318 // | 1319 // |
1319 | 1320 |
1320 const AtomicString& AXLayoutObject::liveRegionStatus() const { | 1321 const AtomicString& AXLayoutObject::liveRegionStatus() const { |
1321 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusAssertive, | 1322 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusAssertive, |
1322 ("assertive")); | 1323 ("assertive")); |
1323 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusPolite, ("polite")); | 1324 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusPolite, ("polite")); |
1324 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusOff, ("off")); | 1325 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusOff, ("off")); |
1325 | 1326 |
1326 const AtomicString& liveRegionStatus = getAttribute(aria_liveAttr); | 1327 const AtomicString& liveRegionStatus = |
| 1328 getAOMPropertyOrARIAAttribute(AOMStringProperty::kLive); |
1327 // These roles have implicit live region status. | 1329 // These roles have implicit live region status. |
1328 if (liveRegionStatus.isEmpty()) { | 1330 if (liveRegionStatus.isEmpty()) { |
1329 switch (roleValue()) { | 1331 switch (roleValue()) { |
1330 case AlertDialogRole: | 1332 case AlertDialogRole: |
1331 case AlertRole: | 1333 case AlertRole: |
1332 return liveRegionStatusAssertive; | 1334 return liveRegionStatusAssertive; |
1333 case LogRole: | 1335 case LogRole: |
1334 case StatusRole: | 1336 case StatusRole: |
1335 return liveRegionStatusPolite; | 1337 return liveRegionStatusPolite; |
1336 case TimerRole: | 1338 case TimerRole: |
1337 case MarqueeRole: | 1339 case MarqueeRole: |
1338 return liveRegionStatusOff; | 1340 return liveRegionStatusOff; |
1339 default: | 1341 default: |
1340 break; | 1342 break; |
1341 } | 1343 } |
1342 } | 1344 } |
1343 | 1345 |
1344 return liveRegionStatus; | 1346 return liveRegionStatus; |
1345 } | 1347 } |
1346 | 1348 |
1347 const AtomicString& AXLayoutObject::liveRegionRelevant() const { | 1349 const AtomicString& AXLayoutObject::liveRegionRelevant() const { |
1348 DEFINE_STATIC_LOCAL(const AtomicString, defaultLiveRegionRelevant, | 1350 DEFINE_STATIC_LOCAL(const AtomicString, defaultLiveRegionRelevant, |
1349 ("additions text")); | 1351 ("additions text")); |
1350 const AtomicString& relevant = getAttribute(aria_relevantAttr); | 1352 const AtomicString& relevant = |
| 1353 getAOMPropertyOrARIAAttribute(AOMStringProperty::kRelevant); |
1351 | 1354 |
1352 // Default aria-relevant = "additions text". | 1355 // Default aria-relevant = "additions text". |
1353 if (relevant.isEmpty()) | 1356 if (relevant.isEmpty()) |
1354 return defaultLiveRegionRelevant; | 1357 return defaultLiveRegionRelevant; |
1355 | 1358 |
1356 return relevant; | 1359 return relevant; |
1357 } | 1360 } |
1358 | 1361 |
1359 bool AXLayoutObject::liveRegionAtomic() const { | 1362 bool AXLayoutObject::liveRegionAtomic() const { |
1360 // ARIA roles "alert" and "status" should have an implicit aria-atomic value | 1363 // ARIA roles "alert" and "status" should have an implicit aria-atomic value |
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2491 | 2494 |
2492 bool AXLayoutObject::elementAttributeValue( | 2495 bool AXLayoutObject::elementAttributeValue( |
2493 const QualifiedName& attributeName) const { | 2496 const QualifiedName& attributeName) const { |
2494 if (!m_layoutObject) | 2497 if (!m_layoutObject) |
2495 return false; | 2498 return false; |
2496 | 2499 |
2497 return equalIgnoringCase(getAttribute(attributeName), "true"); | 2500 return equalIgnoringCase(getAttribute(attributeName), "true"); |
2498 } | 2501 } |
2499 | 2502 |
2500 } // namespace blink | 2503 } // namespace blink |
OLD | NEW |