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

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

Issue 1012663002: Aria disabled does not apply to descendant elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Just some cleanup Created 5 years, 9 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 | « LayoutTests/accessibility/aria-disabled-expected.txt ('k') | no next file » | 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 // Note: we can't call node()->willRespondToMouseClickEvents() because t hat triggers a style recalc and can delete this. 720 // Note: we can't call node()->willRespondToMouseClickEvents() because t hat triggers a style recalc and can delete this.
721 if (node()->hasEventListeners(EventTypeNames::mouseup) || node()->hasEve ntListeners(EventTypeNames::mousedown) || node()->hasEventListeners(EventTypeNam es::click) || node()->hasEventListeners(EventTypeNames::DOMActivate)) 721 if (node()->hasEventListeners(EventTypeNames::mouseup) || node()->hasEve ntListeners(EventTypeNames::mousedown) || node()->hasEventListeners(EventTypeNam es::click) || node()->hasEventListeners(EventTypeNames::DOMActivate))
722 return true; 722 return true;
723 } 723 }
724 724
725 return AXObject::isClickable(); 725 return AXObject::isClickable();
726 } 726 }
727 727
728 bool AXNodeObject::isEnabled() const 728 bool AXNodeObject::isEnabled() const
729 { 729 {
730 if (equalIgnoringCase(getAttribute(aria_disabledAttr), "true")) 730 for (AXObject* axObject = const_cast<AXNodeObject*>(this); axObject; axObjec t = axObject->parentObject()) {
dmazzoni 2015/03/16 15:45:03 I'm trying to avoid code that iterates over all an
731 return false; 731 const AtomicString& disabled = axObject->getAttribute(aria_disabledAttr) ;
732 if (equalIgnoringCase(disabled, "true"))
733 return false;
734 }
732 735
733 Node* node = this->node(); 736 Node* node = this->node();
734 if (!node || !node->isElementNode()) 737 if (!node || !node->isElementNode())
735 return true; 738 return true;
736 739
737 return !toElement(node)->isDisabledFormControl(); 740 return !toElement(node)->isDisabledFormControl();
738 } 741 }
739 742
740 AccessibilityExpanded AXNodeObject::isExpanded() const 743 AccessibilityExpanded AXNodeObject::isExpanded() const
741 { 744 {
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 float range = maxValueForRange() - minValueForRange(); 1995 float range = maxValueForRange() - minValueForRange();
1993 float value = valueForRange(); 1996 float value = valueForRange();
1994 1997
1995 value += range * (percentChange / 100); 1998 value += range * (percentChange / 100);
1996 setValue(String::number(value)); 1999 setValue(String::number(value));
1997 2000
1998 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true); 2001 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true);
1999 } 2002 }
2000 2003
2001 } // namespace blink 2004 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/accessibility/aria-disabled-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698