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

Side by Side Diff: Source/core/accessibility/AXRenderObject.cpp

Issue 659563006: Add live region root to the cached properties of an AXObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address feedback Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/accessibility/AXRenderObject.h ('k') | Source/core/accessibility/AXScrollView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 return false; 1116 return false;
1117 const AtomicString& ariaOwns = getAttribute(aria_ownsAttr); 1117 const AtomicString& ariaOwns = getAttribute(aria_ownsAttr);
1118 1118
1119 return !ariaOwns.isEmpty(); 1119 return !ariaOwns.isEmpty();
1120 } 1120 }
1121 1121
1122 // 1122 //
1123 // ARIA live-region features. 1123 // ARIA live-region features.
1124 // 1124 //
1125 1125
1126 const AtomicString& AXRenderObject::ariaLiveRegionStatus() const 1126 const AtomicString& AXRenderObject::liveRegionStatus() const
1127 { 1127 {
1128 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusAssertive, ("asserti ve", AtomicString::ConstructFromLiteral)); 1128 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusAssertive, ("asserti ve", AtomicString::ConstructFromLiteral));
1129 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusPolite, ("polite", A tomicString::ConstructFromLiteral)); 1129 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusPolite, ("polite", A tomicString::ConstructFromLiteral));
1130 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusOff, ("off", AtomicS tring::ConstructFromLiteral)); 1130 DEFINE_STATIC_LOCAL(const AtomicString, liveRegionStatusOff, ("off", AtomicS tring::ConstructFromLiteral));
1131 1131
1132 const AtomicString& liveRegionStatus = getAttribute(aria_liveAttr); 1132 const AtomicString& liveRegionStatus = getAttribute(aria_liveAttr);
1133 // These roles have implicit live region status. 1133 // These roles have implicit live region status.
1134 if (liveRegionStatus.isEmpty()) { 1134 if (liveRegionStatus.isEmpty()) {
1135 switch (roleValue()) { 1135 switch (roleValue()) {
1136 case AlertDialogRole: 1136 case AlertDialogRole:
1137 case AlertRole: 1137 case AlertRole:
1138 return liveRegionStatusAssertive; 1138 return liveRegionStatusAssertive;
1139 case LogRole: 1139 case LogRole:
1140 case StatusRole: 1140 case StatusRole:
1141 return liveRegionStatusPolite; 1141 return liveRegionStatusPolite;
1142 case TimerRole: 1142 case TimerRole:
1143 case MarqueeRole: 1143 case MarqueeRole:
1144 return liveRegionStatusOff; 1144 return liveRegionStatusOff;
1145 default: 1145 default:
1146 break; 1146 break;
1147 } 1147 }
1148 } 1148 }
1149 1149
1150 return liveRegionStatus; 1150 return liveRegionStatus;
1151 } 1151 }
1152 1152
1153 const AtomicString& AXRenderObject::ariaLiveRegionRelevant() const 1153 const AtomicString& AXRenderObject::liveRegionRelevant() const
1154 { 1154 {
1155 DEFINE_STATIC_LOCAL(const AtomicString, defaultLiveRegionRelevant, ("additio ns text", AtomicString::ConstructFromLiteral)); 1155 DEFINE_STATIC_LOCAL(const AtomicString, defaultLiveRegionRelevant, ("additio ns text", AtomicString::ConstructFromLiteral));
1156 const AtomicString& relevant = getAttribute(aria_relevantAttr); 1156 const AtomicString& relevant = getAttribute(aria_relevantAttr);
1157 1157
1158 // Default aria-relevant = "additions text". 1158 // Default aria-relevant = "additions text".
1159 if (relevant.isEmpty()) 1159 if (relevant.isEmpty())
1160 return defaultLiveRegionRelevant; 1160 return defaultLiveRegionRelevant;
1161 1161
1162 return relevant; 1162 return relevant;
1163 } 1163 }
1164 1164
1165 bool AXRenderObject::ariaLiveRegionAtomic() const 1165 bool AXRenderObject::liveRegionAtomic() const
1166 { 1166 {
1167 return elementAttributeValue(aria_atomicAttr); 1167 return elementAttributeValue(aria_atomicAttr);
1168 } 1168 }
1169 1169
1170 bool AXRenderObject::ariaLiveRegionBusy() const 1170 bool AXRenderObject::liveRegionBusy() const
1171 { 1171 {
1172 return elementAttributeValue(aria_busyAttr); 1172 return elementAttributeValue(aria_busyAttr);
1173 } 1173 }
1174 1174
1175 // 1175 //
1176 // Accessibility Text. 1176 // Accessibility Text.
1177 // 1177 //
1178 1178
1179 String AXRenderObject::textUnderElement() const 1179 String AXRenderObject::textUnderElement() const
1180 { 1180 {
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2392 if (label && label->renderer()) { 2392 if (label && label->renderer()) {
2393 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2393 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2394 result.unite(labelRect); 2394 result.unite(labelRect);
2395 } 2395 }
2396 } 2396 }
2397 2397
2398 return result; 2398 return result;
2399 } 2399 }
2400 2400
2401 } // namespace blink 2401 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/accessibility/AXRenderObject.h ('k') | Source/core/accessibility/AXScrollView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698