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

Side by Side Diff: WebCore/dom/InputElement.cpp

Issue 5589004: Merge 73319 - 2010-12-03 Dimitri Glazkov <dglazkov@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 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 | « WebCore/ChangeLog ('k') | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « WebCore/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698