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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 | 907 |
908 void HTMLSelectElement::optionRemoved(const HTMLOptionElement& option) | 908 void HTMLSelectElement::optionRemoved(const HTMLOptionElement& option) |
909 { | 909 { |
910 if (m_activeSelectionAnchorIndex < 0 && m_activeSelectionEndIndex < 0) | 910 if (m_activeSelectionAnchorIndex < 0 && m_activeSelectionEndIndex < 0) |
911 return; | 911 return; |
912 int listIndex = optionToListIndex(option.index()); | 912 int listIndex = optionToListIndex(option.index()); |
913 if (listIndex <= m_activeSelectionAnchorIndex) | 913 if (listIndex <= m_activeSelectionAnchorIndex) |
914 m_activeSelectionAnchorIndex--; | 914 m_activeSelectionAnchorIndex--; |
915 if (listIndex <= m_activeSelectionEndIndex) | 915 if (listIndex <= m_activeSelectionEndIndex) |
916 m_activeSelectionEndIndex--; | 916 m_activeSelectionEndIndex--; |
917 if (listIndex == selectedIndex()) | |
918 setAutofilled(false); | |
919 } | 917 } |
920 | 918 |
921 void HTMLSelectElement::selectOption(int optionIndex, SelectOptionFlags flags) | 919 void HTMLSelectElement::selectOption(int optionIndex, SelectOptionFlags flags) |
922 { | 920 { |
923 bool shouldDeselect = !m_multiple || (flags & DeselectOtherOptions); | 921 bool shouldDeselect = !m_multiple || (flags & DeselectOtherOptions); |
924 | 922 |
925 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& items = listItems(
); | 923 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& items = listItems(
); |
926 int listIndex = optionToListIndex(optionIndex); | 924 int listIndex = optionToListIndex(optionIndex); |
927 | 925 |
928 HTMLElement* element = 0; | 926 HTMLElement* element = 0; |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1742 int focusedIndex = activeSelectionEndListIndex(); | 1740 int focusedIndex = activeSelectionEndListIndex(); |
1743 if (focusedIndex < 0) | 1741 if (focusedIndex < 0) |
1744 focusedIndex = firstSelectableListIndex(); | 1742 focusedIndex = firstSelectableListIndex(); |
1745 if (focusedIndex < 0) | 1743 if (focusedIndex < 0) |
1746 return nullptr; | 1744 return nullptr; |
1747 HTMLElement* focused = listItems()[focusedIndex]; | 1745 HTMLElement* focused = listItems()[focusedIndex]; |
1748 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr
; | 1746 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr
; |
1749 } | 1747 } |
1750 | 1748 |
1751 } // namespace | 1749 } // namespace |
OLD | NEW |