OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 2 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // Workaround for bug where trailing \n is included in the result of textCon
tent. | 131 // Workaround for bug where trailing \n is included in the result of textCon
tent. |
132 // The assert macro above may also be simplified to: value == constrainValu
e(value) | 132 // The assert macro above may also be simplified to: value == constrainValu
e(value) |
133 // http://bugs.webkit.org/show_bug.cgi?id=9661 | 133 // http://bugs.webkit.org/show_bug.cgi?id=9661 |
134 if (value == "\n") | 134 if (value == "\n") |
135 data.setValue(""); | 135 data.setValue(""); |
136 else | 136 else |
137 data.setValue(value); | 137 data.setValue(value); |
138 | 138 |
139 element->setFormControlValueMatchesRenderer(true); | 139 element->setFormControlValueMatchesRenderer(true); |
140 | 140 |
141 element->dispatchEvent(Event::create(eventNames().inputEvent, true, false)); | 141 // Input event is fired by the Node::defaultEventHandler for editable contro
ls. |
| 142 if (!inputElement->isTextField()) |
| 143 element->dispatchEvent(Event::create(eventNames().inputEvent, true, fals
e)); |
142 notifyFormStateChanged(element); | 144 notifyFormStateChanged(element); |
143 } | 145 } |
144 | 146 |
145 static String replaceEOLAndLimitLength(const InputElement* inputElement, const S
tring& proposedValue, int maxLength) | 147 static String replaceEOLAndLimitLength(const InputElement* inputElement, const S
tring& proposedValue, int maxLength) |
146 { | 148 { |
147 if (!inputElement->isTextField()) | 149 if (!inputElement->isTextField()) |
148 return proposedValue; | 150 return proposedValue; |
149 | 151 |
150 String string = proposedValue; | 152 String string = proposedValue; |
151 string.replace("\r\n", " "); | 153 string.replace("\r\n", " "); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 | 427 |
426 if (allowedLength < data.maxInputCharsAllowed()) | 428 if (allowedLength < data.maxInputCharsAllowed()) |
427 data.setMaxInputCharsAllowed(allowedLength); | 429 data.setMaxInputCharsAllowed(allowedLength); |
428 | 430 |
429 return inputMask; | 431 return inputMask; |
430 } | 432 } |
431 | 433 |
432 #endif | 434 #endif |
433 | 435 |
434 } | 436 } |
OLD | NEW |