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, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
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 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 | 890 |
891 setChecked(hasAttribute(checkedAttr)); | 891 setChecked(hasAttribute(checkedAttr)); |
892 m_reflectsCheckedAttribute = true; | 892 m_reflectsCheckedAttribute = true; |
893 } | 893 } |
894 | 894 |
895 bool HTMLInputElement::isTextField() const | 895 bool HTMLInputElement::isTextField() const |
896 { | 896 { |
897 return m_inputType->isTextField(); | 897 return m_inputType->isTextField(); |
898 } | 898 } |
899 | 899 |
| 900 void HTMLInputElement::dispatchChangeEventIfNeeded() |
| 901 { |
| 902 if (inDocument() && m_inputType->shouldSendChangeEventAfterCheckedChanged()) |
| 903 dispatchFormControlChangeEvent(); |
| 904 } |
| 905 |
900 void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
ehavior) | 906 void HTMLInputElement::setChecked(bool nowChecked, TextFieldEventBehavior eventB
ehavior) |
901 { | 907 { |
902 if (checked() == nowChecked) | 908 if (checked() == nowChecked) |
903 return; | 909 return; |
904 | 910 |
905 RefPtrWillBeRawPtr<HTMLInputElement> protector(this); | 911 RefPtrWillBeRawPtr<HTMLInputElement> protector(this); |
906 m_reflectsCheckedAttribute = false; | 912 m_reflectsCheckedAttribute = false; |
907 m_isChecked = nowChecked; | 913 m_isChecked = nowChecked; |
908 | 914 |
909 if (RadioButtonGroupScope* scope = radioButtonGroupScope()) | 915 if (RadioButtonGroupScope* scope = radioButtonGroupScope()) |
(...skipping 13 matching lines...) Expand all Loading... |
923 | 929 |
924 // Only send a change event for items in the document (avoid firing during | 930 // Only send a change event for items in the document (avoid firing during |
925 // parsing) and don't send a change event for a radio button that's getting | 931 // parsing) and don't send a change event for a radio button that's getting |
926 // unchecked to match other browsers. DOM is not a useful standard for this | 932 // unchecked to match other browsers. DOM is not a useful standard for this |
927 // because it says only to fire change events at "lose focus" time, which is | 933 // because it says only to fire change events at "lose focus" time, which is |
928 // definitely wrong in practice for these types of elements. | 934 // definitely wrong in practice for these types of elements. |
929 if (eventBehavior != DispatchNoEvent && inDocument() && m_inputType->shouldS
endChangeEventAfterCheckedChanged()) { | 935 if (eventBehavior != DispatchNoEvent && inDocument() && m_inputType->shouldS
endChangeEventAfterCheckedChanged()) { |
930 setTextAsOfLastFormControlChangeEvent(String()); | 936 setTextAsOfLastFormControlChangeEvent(String()); |
931 if (eventBehavior == DispatchInputAndChangeEvent) | 937 if (eventBehavior == DispatchInputAndChangeEvent) |
932 dispatchFormControlInputEvent(); | 938 dispatchFormControlInputEvent(); |
933 dispatchFormControlChangeEvent(); | |
934 } | 939 } |
935 | 940 |
936 pseudoStateChanged(CSSSelector::PseudoChecked); | 941 pseudoStateChanged(CSSSelector::PseudoChecked); |
937 } | 942 } |
938 | 943 |
939 void HTMLInputElement::setIndeterminate(bool newValue) | 944 void HTMLInputElement::setIndeterminate(bool newValue) |
940 { | 945 { |
941 if (indeterminate() == newValue) | 946 if (indeterminate() == newValue) |
942 return; | 947 return; |
943 | 948 |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1920 void HTMLInputElement::ensurePrimaryContent() | 1925 void HTMLInputElement::ensurePrimaryContent() |
1921 { | 1926 { |
1922 m_inputTypeView->ensurePrimaryContent(); | 1927 m_inputTypeView->ensurePrimaryContent(); |
1923 } | 1928 } |
1924 | 1929 |
1925 bool HTMLInputElement::hasFallbackContent() const | 1930 bool HTMLInputElement::hasFallbackContent() const |
1926 { | 1931 { |
1927 return m_inputTypeView->hasFallbackContent(); | 1932 return m_inputTypeView->hasFallbackContent(); |
1928 } | 1933 } |
1929 } // namespace | 1934 } // namespace |
OLD | NEW |