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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 if (equalIgnoringCase(getAttribute(aria_disabledAttr), "true")) | 702 if (equalIgnoringCase(getAttribute(aria_disabledAttr), "true")) |
703 return false; | 703 return false; |
704 | 704 |
705 Node* node = this->node(); | 705 Node* node = this->node(); |
706 if (!node || !node->isElementNode()) | 706 if (!node || !node->isElementNode()) |
707 return true; | 707 return true; |
708 | 708 |
709 return !toElement(node)->isDisabledFormControl(); | 709 return !toElement(node)->isDisabledFormControl(); |
710 } | 710 } |
711 | 711 |
712 bool AXNodeObject::isExpanded() const | 712 AccessibilityExpanded AXNodeObject::isExpanded() const |
713 { | 713 { |
714 if (equalIgnoringCase(getAttribute(aria_expandedAttr), "true")) | 714 const AtomicString& expanded = getAttribute(aria_expandedAttr); |
715 return true; | 715 if (equalIgnoringCase(expanded, "true")) |
| 716 return ExpandedExpanded; |
| 717 if (equalIgnoringCase(expanded, "false")) |
| 718 return ExpandedCollapsed; |
716 | 719 |
717 return false; | 720 return ExpandedUndefined; |
718 } | 721 } |
719 | 722 |
720 bool AXNodeObject::isIndeterminate() const | 723 bool AXNodeObject::isIndeterminate() const |
721 { | 724 { |
722 Node* node = this->node(); | 725 Node* node = this->node(); |
723 if (!isHTMLInputElement(node)) | 726 if (!isHTMLInputElement(node)) |
724 return false; | 727 return false; |
725 | 728 |
726 return toHTMLInputElement(node)->shouldAppearIndeterminate(); | 729 return toHTMLInputElement(node)->shouldAppearIndeterminate(); |
727 } | 730 } |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 } | 1097 } |
1095 | 1098 |
1096 String AXNodeObject::ariaDescribedByAttribute() const | 1099 String AXNodeObject::ariaDescribedByAttribute() const |
1097 { | 1100 { |
1098 WillBeHeapVector<RawPtrWillBeMember<Element> > elements; | 1101 WillBeHeapVector<RawPtrWillBeMember<Element> > elements; |
1099 elementsFromAttribute(elements, aria_describedbyAttr); | 1102 elementsFromAttribute(elements, aria_describedbyAttr); |
1100 | 1103 |
1101 return accessibilityDescriptionForElements(elements); | 1104 return accessibilityDescriptionForElements(elements); |
1102 } | 1105 } |
1103 | 1106 |
1104 | |
1105 String AXNodeObject::ariaLabeledByAttribute() const | 1107 String AXNodeObject::ariaLabeledByAttribute() const |
1106 { | 1108 { |
1107 WillBeHeapVector<RawPtrWillBeMember<Element> > elements; | 1109 WillBeHeapVector<RawPtrWillBeMember<Element> > elements; |
1108 ariaLabeledByElements(elements); | 1110 ariaLabeledByElements(elements); |
1109 | 1111 |
1110 return accessibilityDescriptionForElements(elements); | 1112 return accessibilityDescriptionForElements(elements); |
1111 } | 1113 } |
1112 | 1114 |
1113 AccessibilityRole AXNodeObject::ariaRoleAttribute() const | 1115 AccessibilityRole AXNodeObject::ariaRoleAttribute() const |
1114 { | 1116 { |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1760 float range = maxValueForRange() - minValueForRange(); | 1762 float range = maxValueForRange() - minValueForRange(); |
1761 float value = valueForRange(); | 1763 float value = valueForRange(); |
1762 | 1764 |
1763 value += range * (percentChange / 100); | 1765 value += range * (percentChange / 100); |
1764 setValue(String::number(value)); | 1766 setValue(String::number(value)); |
1765 | 1767 |
1766 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged,
true); | 1768 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged,
true); |
1767 } | 1769 } |
1768 | 1770 |
1769 } // namespace blink | 1771 } // namespace blink |
OLD | NEW |