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

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

Issue 712983002: Exposing correct state for summary element depending on open attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | 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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 706
707 Node* node = this->node(); 707 Node* node = this->node();
708 if (!node || !node->isElementNode()) 708 if (!node || !node->isElementNode())
709 return true; 709 return true;
710 710
711 return !toElement(node)->isDisabledFormControl(); 711 return !toElement(node)->isDisabledFormControl();
712 } 712 }
713 713
714 AccessibilityExpanded AXNodeObject::isExpanded() const 714 AccessibilityExpanded AXNodeObject::isExpanded() const
715 { 715 {
716 if (node() && isHTMLSummaryElement(*node())) {
717 if (node()->parentNode() && isHTMLDetailsElement(node()->parentNode()))
718 return toElement(node()->parentNode())->hasAttribute(openAttr) ? Exp andedExpanded : ExpandedCollapsed;
719 }
720
716 const AtomicString& expanded = getAttribute(aria_expandedAttr); 721 const AtomicString& expanded = getAttribute(aria_expandedAttr);
717 if (equalIgnoringCase(expanded, "true")) 722 if (equalIgnoringCase(expanded, "true"))
718 return ExpandedExpanded; 723 return ExpandedExpanded;
719 if (equalIgnoringCase(expanded, "false")) 724 if (equalIgnoringCase(expanded, "false"))
720 return ExpandedCollapsed; 725 return ExpandedCollapsed;
721 726
722 return ExpandedUndefined; 727 return ExpandedUndefined;
723 } 728 }
724 729
725 bool AXNodeObject::isIndeterminate() const 730 bool AXNodeObject::isIndeterminate() const
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1774 float range = maxValueForRange() - minValueForRange(); 1779 float range = maxValueForRange() - minValueForRange();
1775 float value = valueForRange(); 1780 float value = valueForRange();
1776 1781
1777 value += range * (percentChange / 100); 1782 value += range * (percentChange / 100);
1778 setValue(String::number(value)); 1783 setValue(String::number(value));
1779 1784
1780 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true); 1785 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true);
1781 } 1786 }
1782 1787
1783 } // namespace blink 1788 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698