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

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

Issue 915343002: Removing unused hasValidImageBuffer and activeSelectionStartListIndex (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 | « Source/core/html/HTMLSelectElement.h ('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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 191 }
192 192
193 bool HTMLSelectElement::usesMenuList() const 193 bool HTMLSelectElement::usesMenuList() const
194 { 194 {
195 if (LayoutTheme::theme().delegatesMenuListRendering()) 195 if (LayoutTheme::theme().delegatesMenuListRendering())
196 return true; 196 return true;
197 197
198 return !m_multiple && m_size <= 1; 198 return !m_multiple && m_size <= 1;
199 } 199 }
200 200
201 int HTMLSelectElement::activeSelectionStartListIndex() const
202 {
203 if (m_activeSelectionAnchorIndex >= 0)
204 return m_activeSelectionAnchorIndex;
205 return optionToListIndex(selectedIndex());
206 }
207
208 int HTMLSelectElement::activeSelectionEndListIndex() const 201 int HTMLSelectElement::activeSelectionEndListIndex() const
209 { 202 {
210 if (m_activeSelectionEndIndex >= 0) 203 if (m_activeSelectionEndIndex >= 0)
211 return m_activeSelectionEndIndex; 204 return m_activeSelectionEndIndex;
212 return lastSelectedListIndex(); 205 return lastSelectedListIndex();
213 } 206 }
214 207
215 void HTMLSelectElement::add(const HTMLOptionElementOrHTMLOptGroupElement& elemen t, const HTMLElementOrLong& before, ExceptionState& exceptionState) 208 void HTMLSelectElement::add(const HTMLOptionElementOrHTMLOptGroupElement& elemen t, const HTMLElementOrLong& before, ExceptionState& exceptionState)
216 { 209 {
217 RefPtrWillBeRawPtr<HTMLElement> elementToInsert; 210 RefPtrWillBeRawPtr<HTMLElement> elementToInsert;
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 int focusedIndex = activeSelectionEndListIndex(); 1768 int focusedIndex = activeSelectionEndListIndex();
1776 if (focusedIndex < 0) 1769 if (focusedIndex < 0)
1777 focusedIndex = firstSelectableListIndex(); 1770 focusedIndex = firstSelectableListIndex();
1778 if (focusedIndex < 0) 1771 if (focusedIndex < 0)
1779 return nullptr; 1772 return nullptr;
1780 HTMLElement* focused = listItems()[focusedIndex]; 1773 HTMLElement* focused = listItems()[focusedIndex];
1781 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr ; 1774 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr ;
1782 } 1775 }
1783 1776
1784 } // namespace 1777 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLSelectElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698