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

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

Issue 1039023002: AX nodes that aren't contenteditable should be readonly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@listboxes_too
Patch Set: Add test Created 5 years, 8 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
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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 790
791 if (isHTMLTextAreaElement(*node)) 791 if (isHTMLTextAreaElement(*node))
792 return toHTMLTextAreaElement(*node).isReadOnly(); 792 return toHTMLTextAreaElement(*node).isReadOnly();
793 793
794 if (isHTMLInputElement(*node)) { 794 if (isHTMLInputElement(*node)) {
795 HTMLInputElement& input = toHTMLInputElement(*node); 795 HTMLInputElement& input = toHTMLInputElement(*node);
796 if (input.isTextField()) 796 if (input.isTextField())
797 return input.isReadOnly(); 797 return input.isReadOnly();
798 } 798 }
799 799
800 return !node->hasEditableStyle(); 800 return AXObject::isReadOnly();
801 } 801 }
802 802
803 bool AXNodeObject::isRequired() const 803 bool AXNodeObject::isRequired() const
804 { 804 {
805 Node* n = this->node(); 805 Node* n = this->node();
806 if (n && (n->isElementNode() && toElement(n)->isFormControlElement())) 806 if (n && (n->isElementNode() && toElement(n)->isFormControlElement()))
807 return toHTMLFormControlElement(n)->isRequired(); 807 return toHTMLFormControlElement(n)->isRequired();
808 808
809 if (equalIgnoringCase(getAttribute(aria_requiredAttr), "true")) 809 if (equalIgnoringCase(getAttribute(aria_requiredAttr), "true"))
810 return true; 810 return true;
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 float range = maxValueForRange() - minValueForRange(); 1992 float range = maxValueForRange() - minValueForRange();
1993 float value = valueForRange(); 1993 float value = valueForRange();
1994 1994
1995 value += range * (percentChange / 100); 1995 value += range * (percentChange / 100);
1996 setValue(String::number(value)); 1996 setValue(String::number(value));
1997 1997
1998 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true); 1998 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true);
1999 } 1999 }
2000 2000
2001 } // namespace blink 2001 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/accessibility/readonly-expected.txt ('k') | Source/modules/accessibility/AXObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698