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); |
917 } | 919 } |
918 | 920 |
919 void HTMLSelectElement::selectOption(int optionIndex, SelectOptionFlags flags) | 921 void HTMLSelectElement::selectOption(int optionIndex, SelectOptionFlags flags) |
920 { | 922 { |
921 bool shouldDeselect = !m_multiple || (flags & DeselectOtherOptions); | 923 bool shouldDeselect = !m_multiple || (flags & DeselectOtherOptions); |
922 | 924 |
923 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& items = listItems(
); | 925 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& items = listItems(
); |
924 int listIndex = optionToListIndex(optionIndex); | 926 int listIndex = optionToListIndex(optionIndex); |
925 | 927 |
926 HTMLElement* element = 0; | 928 HTMLElement* element = 0; |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1738 int focusedIndex = activeSelectionEndListIndex(); | 1740 int focusedIndex = activeSelectionEndListIndex(); |
1739 if (focusedIndex < 0) | 1741 if (focusedIndex < 0) |
1740 focusedIndex = firstSelectableListIndex(); | 1742 focusedIndex = firstSelectableListIndex(); |
1741 if (focusedIndex < 0) | 1743 if (focusedIndex < 0) |
1742 return nullptr; | 1744 return nullptr; |
1743 HTMLElement* focused = listItems()[focusedIndex]; | 1745 HTMLElement* focused = listItems()[focusedIndex]; |
1744 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr
; | 1746 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr
; |
1745 } | 1747 } |
1746 | 1748 |
1747 } // namespace | 1749 } // namespace |
OLD | NEW |