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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 { | 373 { |
374 if (SpinButtonElement* spinButton = spinButtonElement()) | 374 if (SpinButtonElement* spinButton = spinButtonElement()) |
375 spinButton->releaseCapture(); | 375 spinButton->releaseCapture(); |
376 } | 376 } |
377 | 377 |
378 bool TextFieldInputType::supportsReadOnly() const | 378 bool TextFieldInputType::supportsReadOnly() const |
379 { | 379 { |
380 return true; | 380 return true; |
381 } | 381 } |
382 | 382 |
383 bool TextFieldInputType::shouldUseInputMethod() const | |
384 { | |
385 return true; | |
386 } | |
387 | |
388 static bool isASCIILineBreak(UChar c) | 383 static bool isASCIILineBreak(UChar c) |
389 { | 384 { |
390 return c == '\r' || c == '\n'; | 385 return c == '\r' || c == '\n'; |
391 } | 386 } |
392 | 387 |
393 static String limitLength(const String& string, unsigned maxLength) | 388 static String limitLength(const String& string, unsigned maxLength) |
394 { | 389 { |
395 unsigned newLength = std::min(maxLength, string.length()); | 390 unsigned newLength = std::min(maxLength, string.length()); |
396 if (newLength == string.length()) | 391 if (newLength == string.length()) |
397 return string; | 392 return string; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 return shouldSpinButtonRespondToMouseEvents() && element().focused(); | 549 return shouldSpinButtonRespondToMouseEvents() && element().focused(); |
555 } | 550 } |
556 | 551 |
557 void TextFieldInputType::spinButtonDidReleaseMouseCapture(SpinButtonElement::Eve
ntDispatch eventDispatch) | 552 void TextFieldInputType::spinButtonDidReleaseMouseCapture(SpinButtonElement::Eve
ntDispatch eventDispatch) |
558 { | 553 { |
559 if (eventDispatch == SpinButtonElement::EventDispatchAllowed) | 554 if (eventDispatch == SpinButtonElement::EventDispatchAllowed) |
560 element().dispatchFormControlChangeEvent(); | 555 element().dispatchFormControlChangeEvent(); |
561 } | 556 } |
562 | 557 |
563 } // namespace blink | 558 } // namespace blink |
OLD | NEW |