Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, Google 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 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1287 | 1287 |
| 1288 if (IsTextControl() && !IsNativeTextControl()) | 1288 if (IsTextControl() && !IsNativeTextControl()) |
| 1289 return true; | 1289 return true; |
| 1290 | 1290 |
| 1291 // Any node could be contenteditable, so isReadOnly should be relied upon | 1291 // Any node could be contenteditable, so isReadOnly should be relied upon |
| 1292 // for this information for all elements. | 1292 // for this information for all elements. |
| 1293 return !IsReadOnly(); | 1293 return !IsReadOnly(); |
| 1294 } | 1294 } |
| 1295 | 1295 |
| 1296 bool AXNodeObject::CanSetSelectedAttribute() const { | 1296 bool AXNodeObject::CanSetSelectedAttribute() const { |
| 1297 // ARIA list box options can be selected if they are children of an element | 1297 const AccessibilityRole role = AriaRoleAttribute(); |
| 1298 // with an aria-activedescendant attribute. | 1298 // These elements can be selected if not disabled (native or ARIA) |
| 1299 if (AriaRoleAttribute() == kListBoxOptionRole && | 1299 if ((role == kListBoxOptionRole || role == kTreeItemRole || |
| 1300 AncestorExposesActiveDescendant()) | 1300 role == kCellRole || role == kTabRole) && |
| 1301 IsEnabled()) { | |
|
dmazzoni
2017/05/19 19:54:04
Do we need to check if the container is enabled or
| |
| 1301 return true; | 1302 return true; |
| 1303 } | |
| 1302 return AXObjectImpl::CanSetSelectedAttribute(); | 1304 return AXObjectImpl::CanSetSelectedAttribute(); |
| 1303 } | 1305 } |
| 1304 | 1306 |
| 1305 bool AXNodeObject::CanvasHasFallbackContent() const { | 1307 bool AXNodeObject::CanvasHasFallbackContent() const { |
| 1306 Node* node = this->GetNode(); | 1308 Node* node = this->GetNode(); |
| 1307 if (!isHTMLCanvasElement(node)) | 1309 if (!isHTMLCanvasElement(node)) |
| 1308 return false; | 1310 return false; |
| 1309 | 1311 |
| 1310 // If it has any children that are elements, we'll assume it might be fallback | 1312 // If it has any children that are elements, we'll assume it might be fallback |
| 1311 // content. If it has no children or its only children are not elements | 1313 // content. If it has no children or its only children are not elements |
| (...skipping 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3215 return String(); | 3217 return String(); |
| 3216 return ToTextControlElement(node)->StrippedPlaceholder(); | 3218 return ToTextControlElement(node)->StrippedPlaceholder(); |
| 3217 } | 3219 } |
| 3218 | 3220 |
| 3219 DEFINE_TRACE(AXNodeObject) { | 3221 DEFINE_TRACE(AXNodeObject) { |
| 3220 visitor->Trace(node_); | 3222 visitor->Trace(node_); |
| 3221 AXObjectImpl::Trace(visitor); | 3223 AXObjectImpl::Trace(visitor); |
| 3222 } | 3224 } |
| 3223 | 3225 |
| 3224 } // namespace blink | 3226 } // namespace blink |
| OLD | NEW |