| 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 bool wasChanged = element().wasChangedSinceLastFormControlChangeEvent(); | 506 bool wasChanged = element().wasChangedSinceLastFormControlChangeEvent(); |
| 507 element().setChangedSinceLastFormControlChangeEvent(true); | 507 element().setChangedSinceLastFormControlChangeEvent(true); |
| 508 | 508 |
| 509 // We don't need to call sanitizeUserInputValue() function here because | 509 // We don't need to call sanitizeUserInputValue() function here because |
| 510 // HTMLInputElement::handleBeforeTextInsertedEvent() has already called | 510 // HTMLInputElement::handleBeforeTextInsertedEvent() has already called |
| 511 // sanitizeUserInputValue(). | 511 // sanitizeUserInputValue(). |
| 512 // sanitizeValue() is needed because IME input doesn't dispatch BeforeTextIn
sertedEvent. | 512 // sanitizeValue() is needed because IME input doesn't dispatch BeforeTextIn
sertedEvent. |
| 513 element().setValueFromRenderer(sanitizeValue(convertFromVisibleValue(element
().innerTextValue()))); | 513 element().setValueFromRenderer(sanitizeValue(convertFromVisibleValue(element
().innerTextValue()))); |
| 514 element().updatePlaceholderVisibility(false); | 514 element().updatePlaceholderVisibility(false); |
| 515 // Recalc for :invalid change. | 515 // Recalc for :invalid change. |
| 516 element().setNeedsStyleRecalc(); | 516 element().setNeedsStyleRecalc(SubtreeStyleChange); |
| 517 | 517 |
| 518 didSetValueByUserEdit(wasChanged ? ValueChangeStateChanged : ValueChangeStat
eNone); | 518 didSetValueByUserEdit(wasChanged ? ValueChangeStateChanged : ValueChangeStat
eNone); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void TextFieldInputType::didSetValueByUserEdit(ValueChangeState state) | 521 void TextFieldInputType::didSetValueByUserEdit(ValueChangeState state) |
| 522 { | 522 { |
| 523 if (!element().focused()) | 523 if (!element().focused()) |
| 524 return; | 524 return; |
| 525 if (Chrome* chrome = this->chrome()) | 525 if (Chrome* chrome = this->chrome()) |
| 526 chrome->client().didChangeValueInTextField(element()); | 526 chrome->client().didChangeValueInTextField(element()); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 { | 565 { |
| 566 return shouldSpinButtonRespondToMouseEvents() && element().focused(); | 566 return shouldSpinButtonRespondToMouseEvents() && element().focused(); |
| 567 } | 567 } |
| 568 | 568 |
| 569 void TextFieldInputType::spinButtonDidReleaseMouseCapture() | 569 void TextFieldInputType::spinButtonDidReleaseMouseCapture() |
| 570 { | 570 { |
| 571 element().dispatchFormControlChangeEvent(); | 571 element().dispatchFormControlChangeEvent(); |
| 572 } | 572 } |
| 573 | 573 |
| 574 } // namespace WebCore | 574 } // namespace WebCore |
| OLD | NEW |