| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
| 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 10 * | 10 * |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 } | 829 } |
| 830 if (!firstEnabledOption && !option->isDisabledFormControl()) { | 830 if (!firstEnabledOption && !option->isDisabledFormControl()) { |
| 831 firstEnabledOption = option; | 831 firstEnabledOption = option; |
| 832 if (reason == ResetReasonSelectedOptionRemoved) { | 832 if (reason == ResetReasonSelectedOptionRemoved) { |
| 833 // There must be no selected OPTIONs. | 833 // There must be no selected OPTIONs. |
| 834 break; | 834 break; |
| 835 } | 835 } |
| 836 } | 836 } |
| 837 ++optionIndex; | 837 ++optionIndex; |
| 838 } | 838 } |
| 839 if (!lastSelectedOption && m_size <= 1 && firstEnabledOption && !firstEnable
dOption->selected()) { | 839 if (!lastSelectedOption && m_size <= 1 && (!firstEnabledOption || (firstEnab
ledOption && !firstEnabledOption->selected()))) { |
| 840 selectOption(firstEnabledOption, reason == ResetReasonSelectedOptionRemo
ved ? 0 : DeselectOtherOptions); | 840 selectOption(firstEnabledOption, reason == ResetReasonSelectedOptionRemo
ved ? 0 : DeselectOtherOptions); |
| 841 lastSelectedOption = firstEnabledOption; | 841 lastSelectedOption = firstEnabledOption; |
| 842 didChange = true; | 842 didChange = true; |
| 843 } | 843 } |
| 844 if (didChange) | 844 if (didChange) |
| 845 setNeedsValidityCheck(); | 845 setNeedsValidityCheck(); |
| 846 m_lastOnChangeOption = lastSelectedOption; | 846 m_lastOnChangeOption = lastSelectedOption; |
| 847 } | 847 } |
| 848 | 848 |
| 849 HTMLOptionElement* HTMLSelectElement::selectedOption() const | 849 HTMLOptionElement* HTMLSelectElement::selectedOption() const |
| (...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2024 } | 2024 } |
| 2025 | 2025 |
| 2026 void HTMLSelectElement::didMutateSubtree() | 2026 void HTMLSelectElement::didMutateSubtree() |
| 2027 { | 2027 { |
| 2028 DCHECK(popupIsVisible()); | 2028 DCHECK(popupIsVisible()); |
| 2029 DCHECK(m_popup); | 2029 DCHECK(m_popup); |
| 2030 m_popup->updateFromElement(PopupMenu::ByDOMChange); | 2030 m_popup->updateFromElement(PopupMenu::ByDOMChange); |
| 2031 } | 2031 } |
| 2032 | 2032 |
| 2033 } // namespace blink | 2033 } // namespace blink |
| OLD | NEW |