| 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" |
| 32 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
| 33 #include "core/dom/NodeComputedStyle.h" | 34 #include "core/dom/NodeComputedStyle.h" |
| 34 #include "core/dom/NodeTraversal.h" | 35 #include "core/dom/NodeTraversal.h" |
| 35 #include "core/dom/ScriptLoader.h" | 36 #include "core/dom/ScriptLoader.h" |
| 36 #include "core/dom/Text.h" | 37 #include "core/dom/Text.h" |
| 37 #include "core/dom/shadow/ShadowRoot.h" | 38 #include "core/dom/shadow/ShadowRoot.h" |
| 38 #include "core/html/HTMLDataListElement.h" | 39 #include "core/html/HTMLDataListElement.h" |
| 39 #include "core/html/HTMLOptGroupElement.h" | 40 #include "core/html/HTMLOptGroupElement.h" |
| 40 #include "core/html/HTMLSelectElement.h" | 41 #include "core/html/HTMLSelectElement.h" |
| 41 #include "core/html/parser/HTMLParserIdioms.h" | 42 #include "core/html/parser/HTMLParserIdioms.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 258 } |
| 258 | 259 |
| 259 void HTMLOptionElement::setSelectedState(bool selected) | 260 void HTMLOptionElement::setSelectedState(bool selected) |
| 260 { | 261 { |
| 261 if (m_isSelected == selected) | 262 if (m_isSelected == selected) |
| 262 return; | 263 return; |
| 263 | 264 |
| 264 m_isSelected = selected; | 265 m_isSelected = selected; |
| 265 pseudoStateChanged(CSSSelector::PseudoChecked); | 266 pseudoStateChanged(CSSSelector::PseudoChecked); |
| 266 | 267 |
| 267 if (HTMLSelectElement* select = ownerSelectElement()) | 268 if (HTMLSelectElement* select = ownerSelectElement()) { |
| 268 select->invalidateSelectedItems(); | 269 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 } |
| 269 } | 281 } |
| 270 | 282 |
| 271 void HTMLOptionElement::childrenChanged(const ChildrenChange& change) | 283 void HTMLOptionElement::childrenChanged(const ChildrenChange& change) |
| 272 { | 284 { |
| 273 if (HTMLDataListElement* dataList = ownerDataListElement()) | 285 if (HTMLDataListElement* dataList = ownerDataListElement()) |
| 274 dataList->optionElementChildrenChanged(); | 286 dataList->optionElementChildrenChanged(); |
| 275 else if (HTMLSelectElement* select = ownerSelectElement()) | 287 else if (HTMLSelectElement* select = ownerSelectElement()) |
| 276 select->optionElementChildrenChanged(); | 288 select->optionElementChildrenChanged(); |
| 277 updateLabel(); | 289 updateLabel(); |
| 278 HTMLElement::childrenChanged(change); | 290 HTMLElement::childrenChanged(change); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 ASSERT(parent); | 437 ASSERT(parent); |
| 426 if (isHTMLOptGroupElement(*parent)) { | 438 if (isHTMLOptGroupElement(*parent)) { |
| 427 const ComputedStyle* parentStyle = parent->computedStyle() ? parent-
>computedStyle() : parent->ensureComputedStyle(); | 439 const ComputedStyle* parentStyle = parent->computedStyle() ? parent-
>computedStyle() : parent->ensureComputedStyle(); |
| 428 return !parentStyle || parentStyle->display() == NONE; | 440 return !parentStyle || parentStyle->display() == NONE; |
| 429 } | 441 } |
| 430 } | 442 } |
| 431 return m_style->display() == NONE; | 443 return m_style->display() == NONE; |
| 432 } | 444 } |
| 433 | 445 |
| 434 } // namespace blink | 446 } // namespace blink |
| OLD | NEW |