OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv
ed. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 // Return early because we don't want to trigger other side effects | 395 // Return early because we don't want to trigger other side effects |
396 // when the value isn't changing. | 396 // when the value isn't changing. |
397 // FIXME: Simple early return doesn't match the Firefox ever. | 397 // FIXME: Simple early return doesn't match the Firefox ever. |
398 // Remove these lines. | 398 // Remove these lines. |
399 if (normalizedValue == value()) { | 399 if (normalizedValue == value()) { |
400 if (setValueOption == SetSeletion) { | 400 if (setValueOption == SetSeletion) { |
401 setNeedsValidityCheck(); | 401 setNeedsValidityCheck(); |
402 if (isFinishedParsingChildren()) { | 402 if (isFinishedParsingChildren()) { |
403 // Set the caret to the end of the text value except for initial
ize. | 403 // Set the caret to the end of the text value except for initial
ize. |
404 unsigned endOfString = m_value.length(); | 404 unsigned endOfString = m_value.length(); |
405 setSelectionRange(endOfString, endOfString, SelectionHasNoDirect
ion, NotDispatchSelectEvent); | 405 setSelectionRange(endOfString, endOfString); |
406 } | 406 } |
407 } | 407 } |
408 return; | 408 return; |
409 } | 409 } |
410 | 410 |
411 m_value = normalizedValue; | 411 m_value = normalizedValue; |
412 setInnerEditorValue(m_value); | 412 setInnerEditorValue(m_value); |
413 if (eventBehavior == DispatchNoEvent) | 413 if (eventBehavior == DispatchNoEvent) |
414 setLastChangeWasNotUserEdit(); | 414 setLastChangeWasNotUserEdit(); |
415 updatePlaceholderVisibility(); | 415 updatePlaceholderVisibility(); |
416 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(
StyleChangeReason::ControlValue)); | 416 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(
StyleChangeReason::ControlValue)); |
417 m_suggestedValue = String(); | 417 m_suggestedValue = String(); |
418 setNeedsValidityCheck(); | 418 setNeedsValidityCheck(); |
419 if (isFinishedParsingChildren()) { | 419 if (isFinishedParsingChildren()) { |
420 // Set the caret to the end of the text value except for initialize. | 420 // Set the caret to the end of the text value except for initialize. |
421 unsigned endOfString = m_value.length(); | 421 unsigned endOfString = m_value.length(); |
422 setSelectionRange(endOfString, endOfString, SelectionHasNoDirection, Not
DispatchSelectEvent); | 422 setSelectionRange(endOfString, endOfString); |
423 } | 423 } |
424 | 424 |
425 notifyFormStateChanged(); | 425 notifyFormStateChanged(); |
426 if (eventBehavior == DispatchNoEvent) { | 426 if (eventBehavior == DispatchNoEvent) { |
427 setTextAsOfLastFormControlChangeEvent(normalizedValue); | 427 setTextAsOfLastFormControlChangeEvent(normalizedValue); |
428 } else { | 428 } else { |
429 if (eventBehavior == DispatchInputAndChangeEvent) | 429 if (eventBehavior == DispatchInputAndChangeEvent) |
430 dispatchFormControlInputEvent(); | 430 dispatchFormControlInputEvent(); |
431 dispatchFormControlChangeEvent(); | 431 dispatchFormControlChangeEvent(); |
432 } | 432 } |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 | 673 |
674 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement(const Element& s
ource) | 674 void HTMLTextAreaElement::copyNonAttributePropertiesFromElement(const Element& s
ource) |
675 { | 675 { |
676 const HTMLTextAreaElement& sourceElement = static_cast<const HTMLTextAreaEle
ment&>(source); | 676 const HTMLTextAreaElement& sourceElement = static_cast<const HTMLTextAreaEle
ment&>(source); |
677 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion); | 677 setValueCommon(sourceElement.value(), DispatchNoEvent, SetSeletion); |
678 m_isDirty = sourceElement.m_isDirty; | 678 m_isDirty = sourceElement.m_isDirty; |
679 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source); | 679 HTMLTextFormControlElement::copyNonAttributePropertiesFromElement(source); |
680 } | 680 } |
681 | 681 |
682 } // namespace blink | 682 } // namespace blink |
OLD | NEW |