| OLD | NEW |
| 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 Loading... |
| 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].get() == this) |
| 171 return optionIndex; | 171 return optionIndex; |
| 172 ++optionIndex; | 172 ++optionIndex; |
| 173 } | 173 } |
| 174 | 174 |
| 175 return 0; | 175 return 0; |
| 176 } | 176 } |
| 177 | 177 |
| 178 void HTMLOptionElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) | 178 void HTMLOptionElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) |
| 179 { | 179 { |
| 180 if (name == valueAttr) { | 180 if (name == valueAttr) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |