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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 return InputTypeNames::checkbox; | 50 return InputTypeNames::checkbox; |
51 } | 51 } |
52 | 52 |
53 bool CheckboxInputType::valueMissing(const String&) const | 53 bool CheckboxInputType::valueMissing(const String&) const |
54 { | 54 { |
55 return element().isRequired() && !element().checked(); | 55 return element().isRequired() && !element().checked(); |
56 } | 56 } |
57 | 57 |
58 String CheckboxInputType::valueMissingText() const | 58 String CheckboxInputType::valueMissingText() const |
59 { | 59 { |
60 return locale().queryString(blink::WebLocalizedString::ValidationValueMissin
gForCheckbox); | 60 return locale().queryString(WebLocalizedString::ValidationValueMissingForChe
ckbox); |
61 } | 61 } |
62 | 62 |
63 void CheckboxInputType::handleKeyupEvent(KeyboardEvent* event) | 63 void CheckboxInputType::handleKeyupEvent(KeyboardEvent* event) |
64 { | 64 { |
65 const String& key = event->keyIdentifier(); | 65 const String& key = event->keyIdentifier(); |
66 if (key != "U+0020") | 66 if (key != "U+0020") |
67 return; | 67 return; |
68 dispatchSimulatedClickIfActive(event); | 68 dispatchSimulatedClickIfActive(event); |
69 } | 69 } |
70 | 70 |
(...skipping 27 matching lines...) Expand all Loading... |
98 // The work we did in willDispatchClick was default handling. | 98 // The work we did in willDispatchClick was default handling. |
99 event->setDefaultHandled(); | 99 event->setDefaultHandled(); |
100 } | 100 } |
101 | 101 |
102 bool CheckboxInputType::shouldAppearIndeterminate() const | 102 bool CheckboxInputType::shouldAppearIndeterminate() const |
103 { | 103 { |
104 return element().indeterminate(); | 104 return element().indeterminate(); |
105 } | 105 } |
106 | 106 |
107 } // namespace blink | 107 } // namespace blink |
OLD | NEW |