Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Side by Side Diff: Source/core/html/HTMLSelectElement.cpp

Issue 486333002: Revert of Adjust autofilled property for <search> input and <select> elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698