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

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

Issue 471803003: Adjust autofilled property for <search> input and <select> elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and add NeedsRebaseLine for window test. 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);
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 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
1740 int focusedIndex = activeSelectionEndListIndex(); 1742 int focusedIndex = activeSelectionEndListIndex();
1741 if (focusedIndex < 0) 1743 if (focusedIndex < 0)
1742 focusedIndex = firstSelectableListIndex(); 1744 focusedIndex = firstSelectableListIndex();
1743 if (focusedIndex < 0) 1745 if (focusedIndex < 0)
1744 return nullptr; 1746 return nullptr;
1745 HTMLElement* focused = listItems()[focusedIndex]; 1747 HTMLElement* focused = listItems()[focusedIndex];
1746 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr ; 1748 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr ;
1747 } 1749 }
1748 1750
1749 } // namespace 1751 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698