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

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

Issue 14996003: Disabled select element should not fire onchange event. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added test and moved the checks to RenderListBox Created 7 years, 7 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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 } 633 }
634 634
635 scrollToSelection(); 635 scrollToSelection();
636 setNeedsValidityCheck(); 636 setNeedsValidityCheck();
637 notifyFormStateChanged(); 637 notifyFormStateChanged();
638 } 638 }
639 639
640 void HTMLSelectElement::listBoxOnChange() 640 void HTMLSelectElement::listBoxOnChange()
641 { 641 {
642 ASSERT(!usesMenuList() || m_multiple); 642 ASSERT(!usesMenuList() || m_multiple);
643 if (isDisabledFormControl())
644 return;
645 643
646 const Vector<HTMLElement*>& items = listItems(); 644 const Vector<HTMLElement*>& items = listItems();
647 645
648 // If the cached selection list is empty, or the size has changed, then fire 646 // If the cached selection list is empty, or the size has changed, then fire
649 // dispatchFormControlChangeEvent, and return early. 647 // dispatchFormControlChangeEvent, and return early.
650 if (m_lastOnChangeSelection.isEmpty() || m_lastOnChangeSelection.size() != i tems.size()) { 648 if (m_lastOnChangeSelection.isEmpty() || m_lastOnChangeSelection.size() != i tems.size()) {
651 dispatchFormControlChangeEvent(); 649 dispatchFormControlChangeEvent();
652 return; 650 return;
653 } 651 }
654 652
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 } 1568 }
1571 1569
1572 void HTMLSelectElement::finishParsingChildren() 1570 void HTMLSelectElement::finishParsingChildren()
1573 { 1571 {
1574 HTMLFormControlElementWithState::finishParsingChildren(); 1572 HTMLFormControlElementWithState::finishParsingChildren();
1575 m_isParsingInProgress = false; 1573 m_isParsingInProgress = false;
1576 updateListItemSelectedStates(); 1574 updateListItemSelectedStates();
1577 } 1575 }
1578 1576
1579 } // namespace 1577 } // namespace
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/select/listbox-disabled-no-autoscroll-expected.html ('k') | Source/core/rendering/RenderListBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698