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

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

Issue 2129023002: SELECT element: Fix a DCHECK failure after crrev.com/404091 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | 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 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 if (layoutObject()) 1981 if (layoutObject())
1982 layoutObject()->updateFromElement(); 1982 layoutObject()->updateFromElement();
1983 } 1983 }
1984 1984
1985 HTMLOptionElement* HTMLSelectElement::optionToBeShown() const 1985 HTMLOptionElement* HTMLSelectElement::optionToBeShown() const
1986 { 1986 {
1987 if (m_indexToSelectOnCancel >= 0 && static_cast<size_t>(m_indexToSelectOnCan cel) < listItems().size() && isHTMLOptionElement(listItems()[m_indexToSelectOnCa ncel])) 1987 if (m_indexToSelectOnCancel >= 0 && static_cast<size_t>(m_indexToSelectOnCan cel) < listItems().size() && isHTMLOptionElement(listItems()[m_indexToSelectOnCa ncel]))
1988 return toHTMLOptionElement(listItems()[m_indexToSelectOnCancel]); 1988 return toHTMLOptionElement(listItems()[m_indexToSelectOnCancel]);
1989 if (m_suggestedOption) 1989 if (m_suggestedOption)
1990 return m_suggestedOption; 1990 return m_suggestedOption;
1991 // TODO(tkent): We should not call optionToBeShown() in multiple() case.
1992 if (multiple())
1993 return selectedOption();
1991 DCHECK_EQ(selectedOption(), m_lastOnChangeOption); 1994 DCHECK_EQ(selectedOption(), m_lastOnChangeOption);
1992 return m_lastOnChangeOption; 1995 return m_lastOnChangeOption;
1993 } 1996 }
1994 1997
1995 void HTMLSelectElement::valueChanged(unsigned listIndex) 1998 void HTMLSelectElement::valueChanged(unsigned listIndex)
1996 { 1999 {
1997 // Check to ensure a page navigation has not occurred while the popup was 2000 // Check to ensure a page navigation has not occurred while the popup was
1998 // up. 2001 // up.
1999 Document& doc = document(); 2002 Document& doc = document();
2000 if (&doc != doc.frame()->document()) 2003 if (&doc != doc.frame()->document())
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 } 2141 }
2139 2142
2140 void HTMLSelectElement::didMutateSubtree() 2143 void HTMLSelectElement::didMutateSubtree()
2141 { 2144 {
2142 DCHECK(popupIsVisible()); 2145 DCHECK(popupIsVisible());
2143 DCHECK(m_popup); 2146 DCHECK(m_popup);
2144 m_popup->updateFromElement(PopupMenu::ByDOMChange); 2147 m_popup->updateFromElement(PopupMenu::ByDOMChange);
2145 } 2148 }
2146 2149
2147 } // namespace blink 2150 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698