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

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

Issue 1604653005: Reset algorithm is incorrect for select element with first option disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/select/select-ask-for-reset.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 if (option->fastHasAttribute(selectedAttr)) { 1243 if (option->fastHasAttribute(selectedAttr)) {
1244 if (selectedOption && !m_multiple) 1244 if (selectedOption && !m_multiple)
1245 selectedOption->setSelectedState(false); 1245 selectedOption->setSelectedState(false);
1246 option->setSelectedState(true); 1246 option->setSelectedState(true);
1247 selectedOption = option; 1247 selectedOption = option;
1248 } else { 1248 } else {
1249 option->setSelectedState(false); 1249 option->setSelectedState(false);
1250 } 1250 }
1251 option->setDirty(false); 1251 option->setDirty(false);
1252 1252
1253 if (!firstOption) 1253 if (!firstOption && !option->isDisabledFormControl())
1254 firstOption = option; 1254 firstOption = option;
1255 } 1255 }
1256 1256
1257 if (!selectedOption && firstOption && !m_multiple && m_size <= 1) { 1257 if (!selectedOption && firstOption && !m_multiple && m_size <= 1) {
1258 firstOption->setSelectedState(true); 1258 firstOption->setSelectedState(true);
1259 selectedOption = firstOption; 1259 selectedOption = firstOption;
1260 } 1260 }
1261 1261
1262 m_lastOnChangeOption = selectedOption; 1262 m_lastOnChangeOption = selectedOption;
1263 setOptionsChangedOnLayoutObject(); 1263 setOptionsChangedOnLayoutObject();
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 m_popupIsVisible = false; 2012 m_popupIsVisible = false;
2013 m_popup = nullptr; 2013 m_popup = nullptr;
2014 } 2014 }
2015 2015
2016 void HTMLSelectElement::resetTypeAheadSessionForTesting() 2016 void HTMLSelectElement::resetTypeAheadSessionForTesting()
2017 { 2017 {
2018 m_typeAhead.resetSession(); 2018 m_typeAhead.resetSession();
2019 } 2019 }
2020 2020
2021 } // namespace blink 2021 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/select/select-ask-for-reset.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698