OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 return adoptPtr(new CheckboxInputType(element)); | 44 return adoptPtr(new CheckboxInputType(element)); |
45 } | 45 } |
46 | 46 |
47 const AtomicString& CheckboxInputType::formControlType() const | 47 const AtomicString& CheckboxInputType::formControlType() const |
48 { | 48 { |
49 return InputTypeNames::checkbox(); | 49 return InputTypeNames::checkbox(); |
50 } | 50 } |
51 | 51 |
52 bool CheckboxInputType::valueMissing(const String&) const | 52 bool CheckboxInputType::valueMissing(const String&) const |
53 { | 53 { |
54 return element()->required() && !element()->checked(); | 54 return !element()->checked(); |
55 } | 55 } |
56 | 56 |
57 String CheckboxInputType::valueMissingText() const | 57 String CheckboxInputType::valueMissingText() const |
58 { | 58 { |
59 return validationMessageValueMissingForCheckboxText(); | 59 return validationMessageValueMissingForCheckboxText(); |
60 } | 60 } |
61 | 61 |
62 void CheckboxInputType::handleKeyupEvent(KeyboardEvent* event) | 62 void CheckboxInputType::handleKeyupEvent(KeyboardEvent* event) |
63 { | 63 { |
64 const String& key = event->keyIdentifier(); | 64 const String& key = event->keyIdentifier(); |
(...skipping 30 matching lines...) Expand all Loading... |
95 // The work we did in willDispatchClick was default handling. | 95 // The work we did in willDispatchClick was default handling. |
96 event->setDefaultHandled(); | 96 event->setDefaultHandled(); |
97 } | 97 } |
98 | 98 |
99 bool CheckboxInputType::isCheckbox() const | 99 bool CheckboxInputType::isCheckbox() const |
100 { | 100 { |
101 return true; | 101 return true; |
102 } | 102 } |
103 | 103 |
104 } // namespace WebCore | 104 } // namespace WebCore |
OLD | NEW |