| 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 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1319 // | 1320 // |
| 1320 // ARIA live-region features. | 1321 // ARIA live-region features. |
| 1321 // | 1322 // |
| 1322 | 1323 |
| 1323 const AtomicString& AXLayoutObject::liveRegionStatus() const { | 1324 const AtomicString& AXLayoutObject::liveRegionStatus() const { |
| 1324 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusAssertive, | 1325 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusAssertive, |
| 1325 ("assertive")); | 1326 ("assertive")); |
| 1326 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusPolite, ("polite")); | 1327 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusPolite, ("polite")); |
| 1327 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusOff, ("off")); | 1328 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusOff, ("off")); |
| 1328 | 1329 |
| 1329 const AtomicString& liveRegionStatus = getAttribute(aria_liveAttr); | 1330 const AtomicString& liveRegionStatus = |
| 1331 getAOMPropertyOrARIAAttribute(AOMStringProperty::kLive); |
| 1330 // These roles have implicit live region status. | 1332 // These roles have implicit live region status. |
| 1331 if (liveRegionStatus.isEmpty()) { | 1333 if (liveRegionStatus.isEmpty()) { |
| 1332 switch (roleValue()) { | 1334 switch (roleValue()) { |
| 1333 case AlertDialogRole: | 1335 case AlertDialogRole: |
| 1334 case AlertRole: | 1336 case AlertRole: |
| 1335 return liveRegionStatusAssertive; | 1337 return liveRegionStatusAssertive; |
| 1336 case LogRole: | 1338 case LogRole: |
| 1337 case StatusRole: | 1339 case StatusRole: |
| 1338 return liveRegionStatusPolite; | 1340 return liveRegionStatusPolite; |
| 1339 case TimerRole: | 1341 case TimerRole: |
| 1340 case MarqueeRole: | 1342 case MarqueeRole: |
| 1341 return liveRegionStatusOff; | 1343 return liveRegionStatusOff; |
| 1342 default: | 1344 default: |
| 1343 break; | 1345 break; |
| 1344 } | 1346 } |
| 1345 } | 1347 } |
| 1346 | 1348 |
| 1347 return liveRegionStatus; | 1349 return liveRegionStatus; |
| 1348 } | 1350 } |
| 1349 | 1351 |
| 1350 const AtomicString& AXLayoutObject::liveRegionRelevant() const { | 1352 const AtomicString& AXLayoutObject::liveRegionRelevant() const { |
| 1351 DEFINE_STATIC_LOCAL(const AtomicString, defaultLiveRegionRelevant, | 1353 DEFINE_STATIC_LOCAL(const AtomicString, defaultLiveRegionRelevant, |
| 1352 ("additions text")); | 1354 ("additions text")); |
| 1353 const AtomicString& relevant = getAttribute(aria_relevantAttr); | 1355 const AtomicString& relevant = |
| 1356 getAOMPropertyOrARIAAttribute(AOMStringProperty::kRelevant); |
| 1354 | 1357 |
| 1355 // Default aria-relevant = "additions text". | 1358 // Default aria-relevant = "additions text". |
| 1356 if (relevant.isEmpty()) | 1359 if (relevant.isEmpty()) |
| 1357 return defaultLiveRegionRelevant; | 1360 return defaultLiveRegionRelevant; |
| 1358 | 1361 |
| 1359 return relevant; | 1362 return relevant; |
| 1360 } | 1363 } |
| 1361 | 1364 |
| 1362 bool AXLayoutObject::liveRegionAtomic() const { | 1365 bool AXLayoutObject::liveRegionAtomic() const { |
| 1363 // ARIA roles "alert" and "status" should have an implicit aria-atomic value | 1366 // 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... |
| 2494 | 2497 |
| 2495 bool AXLayoutObject::elementAttributeValue( | 2498 bool AXLayoutObject::elementAttributeValue( |
| 2496 const QualifiedName& attributeName) const { | 2499 const QualifiedName& attributeName) const { |
| 2497 if (!m_layoutObject) | 2500 if (!m_layoutObject) |
| 2498 return false; | 2501 return false; |
| 2499 | 2502 |
| 2500 return equalIgnoringCase(getAttribute(attributeName), "true"); | 2503 return equalIgnoringCase(getAttribute(attributeName), "true"); |
| 2501 } | 2504 } |
| 2502 | 2505 |
| 2503 } // namespace blink | 2506 } // namespace blink |
| OLD | NEW |