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

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

Issue 275573003: Oilpan: Prepare to move select and option elements to Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved. 8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 int HTMLOptionElement::index() const 155 int HTMLOptionElement::index() const
156 { 156 {
157 // It would be faster to cache the index, but harder to get it right in all cases. 157 // It would be faster to cache the index, but harder to get it right in all cases.
158 158
159 HTMLSelectElement* selectElement = ownerSelectElement(); 159 HTMLSelectElement* selectElement = ownerSelectElement();
160 if (!selectElement) 160 if (!selectElement)
161 return 0; 161 return 0;
162 162
163 int optionIndex = 0; 163 int optionIndex = 0;
164 164
165 const Vector<HTMLElement*>& items = selectElement->listItems(); 165 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& items = selectElem ent->listItems();
166 size_t length = items.size(); 166 size_t length = items.size();
167 for (size_t i = 0; i < length; ++i) { 167 for (size_t i = 0; i < length; ++i) {
168 if (!isHTMLOptionElement(*items[i])) 168 if (!isHTMLOptionElement(*items[i]))
169 continue; 169 continue;
170 if (items[i] == this) 170 if (items[i] == this)
171 return optionIndex; 171 return optionIndex;
172 ++optionIndex; 172 ++optionIndex;
173 } 173 }
174 174
175 return 0; 175 return 0;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 // Check for parent optgroup having display NONE 375 // Check for parent optgroup having display NONE
376 if (parent && isHTMLOptGroupElement(*parent)) { 376 if (parent && isHTMLOptGroupElement(*parent)) {
377 if (toHTMLOptGroupElement(*parent).isDisplayNone()) 377 if (toHTMLOptGroupElement(*parent).isDisplayNone())
378 return true; 378 return true;
379 } 379 }
380 RenderStyle* style = nonRendererStyle(); 380 RenderStyle* style = nonRendererStyle();
381 return style && style->display() == NONE; 381 return style && style->display() == NONE;
382 } 382 }
383 383
384 } // namespace WebCore 384 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698