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

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

Issue 631183002: Fixing mapping conflicts for required html attribute and aria-required (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebasing Created 6 years 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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 HTMLInputElement& input = toHTMLInputElement(*node); 792 HTMLInputElement& input = toHTMLInputElement(*node);
793 if (input.isTextField()) 793 if (input.isTextField())
794 return input.isReadOnly(); 794 return input.isReadOnly();
795 } 795 }
796 796
797 return !node->hasEditableStyle(); 797 return !node->hasEditableStyle();
798 } 798 }
799 799
800 bool AXNodeObject::isRequired() const 800 bool AXNodeObject::isRequired() const
801 { 801 {
802 if (equalIgnoringCase(getAttribute(aria_requiredAttr), "true"))
803 return true;
804
805 Node* n = this->node(); 802 Node* n = this->node();
806 if (n && (n->isElementNode() && toElement(n)->isFormControlElement())) 803 if (n && (n->isElementNode() && toElement(n)->isFormControlElement()))
807 return toHTMLFormControlElement(n)->isRequired(); 804 return toHTMLFormControlElement(n)->isRequired();
808 805
806 if (equalIgnoringCase(getAttribute(aria_requiredAttr), "true"))
807 return true;
808
809 return false; 809 return false;
810 } 810 }
811 811
812 bool AXNodeObject::canSetFocusAttribute() const 812 bool AXNodeObject::canSetFocusAttribute() const
813 { 813 {
814 Node* node = this->node(); 814 Node* node = this->node();
815 if (!node) 815 if (!node)
816 return false; 816 return false;
817 817
818 if (isWebArea()) 818 if (isWebArea())
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 float range = maxValueForRange() - minValueForRange(); 1855 float range = maxValueForRange() - minValueForRange();
1856 float value = valueForRange(); 1856 float value = valueForRange();
1857 1857
1858 value += range * (percentChange / 100); 1858 value += range * (percentChange / 100);
1859 setValue(String::number(value)); 1859 setValue(String::number(value));
1860 1860
1861 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true); 1861 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true);
1862 } 1862 }
1863 1863
1864 } // namespace blink 1864 } // 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