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 HTMLSelectElement* selectElement = ownerSelectElement(); | |
tkent
2014/12/15 09:26:04
if (HTMLSelectElement* selectElement = ownerSelect
keishi
2014/12/16 03:53:24
Done.
| |
178 if (!selectElement) | |
179 return -1; | |
180 | |
181 return selectElement->listIndexForOption(*this); | |
182 } | |
183 | |
175 void HTMLOptionElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value) | 184 void HTMLOptionElement::parseAttribute(const QualifiedName& name, const AtomicSt ring& value) |
176 { | 185 { |
177 if (name == valueAttr) { | 186 if (name == valueAttr) { |
178 if (HTMLDataListElement* dataList = ownerDataListElement()) | 187 if (HTMLDataListElement* dataList = ownerDataListElement()) |
179 dataList->optionElementChildrenChanged(); | 188 dataList->optionElementChildrenChanged(); |
180 } else if (name == disabledAttr) { | 189 } else if (name == disabledAttr) { |
181 bool oldDisabled = m_disabled; | 190 bool oldDisabled = m_disabled; |
182 m_disabled = !value.isNull(); | 191 m_disabled = !value.isNull(); |
183 if (oldDisabled != m_disabled) { | 192 if (oldDisabled != m_disabled) { |
184 pseudoStateChanged(CSSSelector::PseudoDisabled); | 193 pseudoStateChanged(CSSSelector::PseudoDisabled); |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
409 ASSERT(parent); | 418 ASSERT(parent); |
410 if (isHTMLOptGroupElement(*parent)) { | 419 if (isHTMLOptGroupElement(*parent)) { |
411 RenderStyle* parentStyle = parent->renderStyle() ? parent->renderSty le() : parent->computedStyle(); | 420 RenderStyle* parentStyle = parent->renderStyle() ? parent->renderSty le() : parent->computedStyle(); |
412 return !parentStyle || parentStyle->display() == NONE; | 421 return !parentStyle || parentStyle->display() == NONE; |
413 } | 422 } |
414 } | 423 } |
415 return m_style->display() == NONE; | 424 return m_style->display() == NONE; |
416 } | 425 } |
417 | 426 |
418 } // namespace blink | 427 } // namespace blink |
OLD | NEW |