Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(383)

Side by Side Diff: Source/core/html/HTMLOptionElement.cpp

Issue 1034493005: Fire AX notifications on list box options. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@menu_list_more
Patch Set: Update expectations for other test that failed Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/AXObjectCache.h ('k') | Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « Source/core/dom/AXObjectCache.h ('k') | Source/core/html/HTMLSelectElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698