| 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 11 matching lines...) Expand all Loading... |
| 22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 23 * Boston, MA 02110-1301, USA. | 23 * Boston, MA 02110-1301, USA. |
| 24 * | 24 * |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/html/HTMLOptionElement.h" | 28 #include "core/html/HTMLOptionElement.h" |
| 29 | 29 |
| 30 #include "bindings/core/v8/ExceptionState.h" | 30 #include "bindings/core/v8/ExceptionState.h" |
| 31 #include "core/HTMLNames.h" | 31 #include "core/HTMLNames.h" |
| 32 #include "core/dom/AXObjectCache.h" | |
| 33 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 34 #include "core/dom/NodeComputedStyle.h" | 33 #include "core/dom/NodeComputedStyle.h" |
| 35 #include "core/dom/NodeTraversal.h" | 34 #include "core/dom/NodeTraversal.h" |
| 36 #include "core/dom/ScriptLoader.h" | 35 #include "core/dom/ScriptLoader.h" |
| 37 #include "core/dom/Text.h" | 36 #include "core/dom/Text.h" |
| 38 #include "core/dom/shadow/ShadowRoot.h" | 37 #include "core/dom/shadow/ShadowRoot.h" |
| 39 #include "core/html/HTMLDataListElement.h" | 38 #include "core/html/HTMLDataListElement.h" |
| 40 #include "core/html/HTMLOptGroupElement.h" | 39 #include "core/html/HTMLOptGroupElement.h" |
| 41 #include "core/html/HTMLSelectElement.h" | 40 #include "core/html/HTMLSelectElement.h" |
| 42 #include "core/html/parser/HTMLParserIdioms.h" | 41 #include "core/html/parser/HTMLParserIdioms.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 } | 257 } |
| 259 | 258 |
| 260 void HTMLOptionElement::setSelectedState(bool selected) | 259 void HTMLOptionElement::setSelectedState(bool selected) |
| 261 { | 260 { |
| 262 if (m_isSelected == selected) | 261 if (m_isSelected == selected) |
| 263 return; | 262 return; |
| 264 | 263 |
| 265 m_isSelected = selected; | 264 m_isSelected = selected; |
| 266 pseudoStateChanged(CSSSelector::PseudoChecked); | 265 pseudoStateChanged(CSSSelector::PseudoChecked); |
| 267 | 266 |
| 268 if (HTMLSelectElement* select = ownerSelectElement()) { | 267 if (HTMLSelectElement* select = ownerSelectElement()) |
| 269 select->invalidateSelectedItems(); | 268 select->invalidateSelectedItems(); |
| 270 | |
| 271 if (AXObjectCache* cache = document().existingAXObjectCache()) { | |
| 272 // If there is a layoutObject (most common), fire accessibility noti
fications | |
| 273 // only when it's a listbox (and not a menu list). If there's no lay
outObject, | |
| 274 // fire them anyway just to be safe (to make sure the AX tree is in
sync). | |
| 275 if (!select->layoutObject() || select->layoutObject()->isListBox())
{ | |
| 276 cache->listboxOptionStateChanged(this); | |
| 277 cache->listboxSelectedChildrenChanged(select); | |
| 278 } | |
| 279 } | |
| 280 } | |
| 281 } | 269 } |
| 282 | 270 |
| 283 void HTMLOptionElement::childrenChanged(const ChildrenChange& change) | 271 void HTMLOptionElement::childrenChanged(const ChildrenChange& change) |
| 284 { | 272 { |
| 285 if (HTMLDataListElement* dataList = ownerDataListElement()) | 273 if (HTMLDataListElement* dataList = ownerDataListElement()) |
| 286 dataList->optionElementChildrenChanged(); | 274 dataList->optionElementChildrenChanged(); |
| 287 else if (HTMLSelectElement* select = ownerSelectElement()) | 275 else if (HTMLSelectElement* select = ownerSelectElement()) |
| 288 select->optionElementChildrenChanged(); | 276 select->optionElementChildrenChanged(); |
| 289 updateLabel(); | 277 updateLabel(); |
| 290 HTMLElement::childrenChanged(change); | 278 HTMLElement::childrenChanged(change); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 ASSERT(parent); | 425 ASSERT(parent); |
| 438 if (isHTMLOptGroupElement(*parent)) { | 426 if (isHTMLOptGroupElement(*parent)) { |
| 439 const ComputedStyle* parentStyle = parent->computedStyle() ? parent-
>computedStyle() : parent->ensureComputedStyle(); | 427 const ComputedStyle* parentStyle = parent->computedStyle() ? parent-
>computedStyle() : parent->ensureComputedStyle(); |
| 440 return !parentStyle || parentStyle->display() == NONE; | 428 return !parentStyle || parentStyle->display() == NONE; |
| 441 } | 429 } |
| 442 } | 430 } |
| 443 return m_style->display() == NONE; | 431 return m_style->display() == NONE; |
| 444 } | 432 } |
| 445 | 433 |
| 446 } // namespace blink | 434 } // namespace blink |
| OLD | NEW |