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

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

Issue 319443003: Clear the suggested value while setting value for <select> element. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update test file as per Ilya's review comments. Created 6 years, 6 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 if (toHTMLOptionElement(items[i])->value() == value) 251 if (toHTMLOptionElement(items[i])->value() == value)
252 break; 252 break;
253 optionIndex++; 253 optionIndex++;
254 } 254 }
255 } 255 }
256 if (optionIndex >= static_cast<int>(items.size())) 256 if (optionIndex >= static_cast<int>(items.size()))
257 optionIndex = -1; 257 optionIndex = -1;
258 } 258 }
259 259
260 int previousSelectedIndex = selectedIndex(); 260 int previousSelectedIndex = selectedIndex();
261 setSuggestedIndex(-1);
261 setSelectedIndex(optionIndex); 262 setSelectedIndex(optionIndex);
262 263
263 if (sendEvents && previousSelectedIndex != selectedIndex()) { 264 if (sendEvents && previousSelectedIndex != selectedIndex()) {
264 if (usesMenuList()) 265 if (usesMenuList())
265 dispatchInputAndChangeEventForMenuList(false); 266 dispatchInputAndChangeEventForMenuList(false);
266 else 267 else
267 listBoxOnChange(); 268 listBoxOnChange();
268 } 269 }
269 } 270 }
270 271
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 1659
1659 void HTMLSelectElement::trace(Visitor* visitor) 1660 void HTMLSelectElement::trace(Visitor* visitor)
1660 { 1661 {
1661 #if ENABLE(OILPAN) 1662 #if ENABLE(OILPAN)
1662 visitor->trace(m_listItems); 1663 visitor->trace(m_listItems);
1663 #endif 1664 #endif
1664 HTMLFormControlElementWithState::trace(visitor); 1665 HTMLFormControlElementWithState::trace(visitor);
1665 } 1666 }
1666 1667
1667 } // namespace 1668 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698