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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 if (!isHTMLOptionElement(*items[i])) | 165 if (!isHTMLOptionElement(*items[i])) |
166 continue; | 166 continue; |
167 if (items[i].get() == this) | 167 if (items[i].get() == this) |
168 return optionIndex; | 168 return optionIndex; |
169 ++optionIndex; | 169 ++optionIndex; |
170 } | 170 } |
171 | 171 |
172 return 0; | 172 return 0; |
173 } | 173 } |
174 | 174 |
| 175 int HTMLOptionElement::listIndex() const |
| 176 { |
| 177 if (HTMLSelectElement* selectElement = ownerSelectElement()) |
| 178 return selectElement->listIndexForOption(*this); |
| 179 return -1; |
| 180 } |
| 181 |
175 void HTMLOptionElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) | 182 void HTMLOptionElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) |
176 { | 183 { |
177 if (name == valueAttr) { | 184 if (name == valueAttr) { |
178 if (HTMLDataListElement* dataList = ownerDataListElement()) | 185 if (HTMLDataListElement* dataList = ownerDataListElement()) |
179 dataList->optionElementChildrenChanged(); | 186 dataList->optionElementChildrenChanged(); |
180 } else if (name == disabledAttr) { | 187 } else if (name == disabledAttr) { |
181 bool oldDisabled = m_disabled; | 188 bool oldDisabled = m_disabled; |
182 m_disabled = !value.isNull(); | 189 m_disabled = !value.isNull(); |
183 if (oldDisabled != m_disabled) { | 190 if (oldDisabled != m_disabled) { |
184 pseudoStateChanged(CSSSelector::PseudoDisabled); | 191 pseudoStateChanged(CSSSelector::PseudoDisabled); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 ASSERT(parent); | 416 ASSERT(parent); |
410 if (isHTMLOptGroupElement(*parent)) { | 417 if (isHTMLOptGroupElement(*parent)) { |
411 RenderStyle* parentStyle = parent->renderStyle() ? parent->renderSty
le() : parent->computedStyle(); | 418 RenderStyle* parentStyle = parent->renderStyle() ? parent->renderSty
le() : parent->computedStyle(); |
412 return !parentStyle || parentStyle->display() == NONE; | 419 return !parentStyle || parentStyle->display() == NONE; |
413 } | 420 } |
414 } | 421 } |
415 return m_style->display() == NONE; | 422 return m_style->display() == NONE; |
416 } | 423 } |
417 | 424 |
418 } // namespace blink | 425 } // namespace blink |
OLD | NEW |