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

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

Issue 246883004: Fix checkValidity for form containing menulist select (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 years, 8 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 | « LayoutTests/fast/forms/checkValidity-select-form-expected.txt ('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 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 895
896 if (shouldDeselect) 896 if (shouldDeselect)
897 deselectItemsWithoutValidation(element); 897 deselectItemsWithoutValidation(element);
898 898
899 // For the menu list case, this is what makes the selected element appear. 899 // For the menu list case, this is what makes the selected element appear.
900 if (RenderObject* renderer = this->renderer()) 900 if (RenderObject* renderer = this->renderer())
901 renderer->updateFromElement(); 901 renderer->updateFromElement();
902 902
903 scrollToSelection(); 903 scrollToSelection();
904 904
905 setNeedsValidityCheck();
906
905 if (usesMenuList()) { 907 if (usesMenuList()) {
906 m_isProcessingUserDrivenChange = flags & UserDriven; 908 m_isProcessingUserDrivenChange = flags & UserDriven;
907 if (flags & DispatchInputAndChangeEvent) 909 if (flags & DispatchInputAndChangeEvent)
908 dispatchInputAndChangeEventForMenuList(); 910 dispatchInputAndChangeEventForMenuList();
909 if (RenderObject* renderer = this->renderer()) { 911 if (RenderObject* renderer = this->renderer()) {
910 if (usesMenuList()) 912 if (usesMenuList())
911 toRenderMenuList(renderer)->didSetSelectedIndex(listIndex); 913 toRenderMenuList(renderer)->didSetSelectedIndex(listIndex);
912 else if (renderer->isListBox()) 914 else if (renderer->isListBox())
913 toRenderListBox(renderer)->selectionChanged(); 915 toRenderListBox(renderer)->selectionChanged();
914 } 916 }
915 } 917 }
916 918
917 setNeedsValidityCheck();
918 notifyFormStateChanged(); 919 notifyFormStateChanged();
919 } 920 }
920 921
921 int HTMLSelectElement::optionToListIndex(int optionIndex) const 922 int HTMLSelectElement::optionToListIndex(int optionIndex) const
922 { 923 {
923 const Vector<HTMLElement*>& items = listItems(); 924 const Vector<HTMLElement*>& items = listItems();
924 int listSize = static_cast<int>(items.size()); 925 int listSize = static_cast<int>(items.size());
925 if (optionIndex < 0 || optionIndex >= listSize) 926 if (optionIndex < 0 || optionIndex >= listSize)
926 return -1; 927 return -1;
927 928
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 { 1650 {
1650 return true; 1651 return true;
1651 } 1652 }
1652 1653
1653 void HTMLSelectElement::updateListOnRenderer() 1654 void HTMLSelectElement::updateListOnRenderer()
1654 { 1655 {
1655 setOptionsChangedOnRenderer(); 1656 setOptionsChangedOnRenderer();
1656 } 1657 }
1657 1658
1658 } // namespace 1659 } // namespace
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/checkValidity-select-form-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698