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

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

Issue 662313003: Add isExpanded() API to WebAXObject.h to get aria-expanded attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « Source/core/accessibility/AXNodeObject.h ('k') | Source/core/accessibility/AXObject.h » ('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) 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 if (equalIgnoringCase(getAttribute(aria_disabledAttr), "true")) 700 if (equalIgnoringCase(getAttribute(aria_disabledAttr), "true"))
701 return false; 701 return false;
702 702
703 Node* node = this->node(); 703 Node* node = this->node();
704 if (!node || !node->isElementNode()) 704 if (!node || !node->isElementNode())
705 return true; 705 return true;
706 706
707 return !toElement(node)->isDisabledFormControl(); 707 return !toElement(node)->isDisabledFormControl();
708 } 708 }
709 709
710 bool AXNodeObject::isExpanded() const
711 {
712 if (equalIgnoringCase(getAttribute(aria_expandedAttr), "true"))
713 return true;
714
715 return false;
716 }
717
710 bool AXNodeObject::isIndeterminate() const 718 bool AXNodeObject::isIndeterminate() const
711 { 719 {
712 Node* node = this->node(); 720 Node* node = this->node();
713 if (!isHTMLInputElement(node)) 721 if (!isHTMLInputElement(node))
714 return false; 722 return false;
715 723
716 return toHTMLInputElement(node)->shouldAppearIndeterminate(); 724 return toHTMLInputElement(node)->shouldAppearIndeterminate();
717 } 725 }
718 726
719 bool AXNodeObject::isPressed() const 727 bool AXNodeObject::isPressed() const
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 float range = maxValueForRange() - minValueForRange(); 1758 float range = maxValueForRange() - minValueForRange();
1751 float value = valueForRange(); 1759 float value = valueForRange();
1752 1760
1753 value += range * (percentChange / 100); 1761 value += range * (percentChange / 100);
1754 setValue(String::number(value)); 1762 setValue(String::number(value));
1755 1763
1756 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru e); 1764 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru e);
1757 } 1765 }
1758 1766
1759 } // namespace blink 1767 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/accessibility/AXNodeObject.h ('k') | Source/core/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698