OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2011 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 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1248 | 1248 |
1249 AXObjectImpl* AXObjectImpl::ParentObjectUnignored() const { | 1249 AXObjectImpl* AXObjectImpl::ParentObjectUnignored() const { |
1250 AXObjectImpl* parent; | 1250 AXObjectImpl* parent; |
1251 for (parent = ParentObject(); parent && parent->AccessibilityIsIgnored(); | 1251 for (parent = ParentObject(); parent && parent->AccessibilityIsIgnored(); |
1252 parent = parent->ParentObject()) { | 1252 parent = parent->ParentObject()) { |
1253 } | 1253 } |
1254 | 1254 |
1255 return parent; | 1255 return parent; |
1256 } | 1256 } |
1257 | 1257 |
1258 // Container widgets are those that a user tabs into and arrows around | |
1259 // sub-widgets | |
1260 bool AXObjectImpl::IsContainerWidget() const { | |
1261 switch (RoleValue()) { | |
1262 case kComboBoxRole: | |
1263 case kGridRole: | |
1264 case kListBoxRole: | |
1265 case kMenuBarRole: | |
1266 case kMenuRole: | |
1267 case kRadioGroupRole: | |
1268 case kSpinButtonRole: | |
1269 case kTabListRole: | |
1270 case kToolbarRole: | |
1271 case kTreeGridRole: | |
1272 case kTreeRole: | |
1273 return true; | |
1274 default: | |
1275 return false; | |
1276 } | |
1277 } | |
1278 | |
1279 AXObjectImpl* AXObjectImpl::ContainerWidget() const { | |
dmazzoni
2017/05/19 19:54:04
Should this check for the right type of container?
| |
1280 AXObjectImpl* ancestor = ParentObjectUnignored(); | |
1281 while (ancestor && !ancestor->IsContainerWidget()) | |
1282 ancestor = ancestor->ParentObjectUnignored(); | |
1283 | |
1284 return ancestor; | |
1285 } | |
1286 | |
1258 void AXObjectImpl::UpdateChildrenIfNecessary() { | 1287 void AXObjectImpl::UpdateChildrenIfNecessary() { |
1259 if (!HasChildren()) | 1288 if (!HasChildren()) |
1260 AddChildren(); | 1289 AddChildren(); |
1261 } | 1290 } |
1262 | 1291 |
1263 void AXObjectImpl::ClearChildren() { | 1292 void AXObjectImpl::ClearChildren() { |
1264 // Detach all weak pointers from objects to their parents. | 1293 // Detach all weak pointers from objects to their parents. |
1265 for (const auto& child : children_) | 1294 for (const auto& child : children_) |
1266 child->DetachFromParent(); | 1295 child->DetachFromParent(); |
1267 | 1296 |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2022 } | 2051 } |
2023 | 2052 |
2024 DEFINE_TRACE(AXObjectImpl) { | 2053 DEFINE_TRACE(AXObjectImpl) { |
2025 visitor->Trace(children_); | 2054 visitor->Trace(children_); |
2026 visitor->Trace(parent_); | 2055 visitor->Trace(parent_); |
2027 visitor->Trace(cached_live_region_root_); | 2056 visitor->Trace(cached_live_region_root_); |
2028 visitor->Trace(ax_object_cache_); | 2057 visitor->Trace(ax_object_cache_); |
2029 } | 2058 } |
2030 | 2059 |
2031 } // namespace blink | 2060 } // namespace blink |
OLD | NEW |