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

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: Rebase 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
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/NodeLayoutStyle.h" 34 #include "core/dom/NodeLayoutStyle.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 (!select->layoutObject() || select->layoutObject()->isListBox()) {
je_julie(Not used) 2015/03/31 03:51:04 ((there is no layoutObject) or (layoutObject is Li
dmazzoni 2015/03/31 06:57:37 I want to fire these notifications under two circu
273 cache->listboxOptionStateChanged(this);
274 cache->listboxSelectedChildrenChanged(select);
275 }
276 }
277 }
269 } 278 }
270 279
271 void HTMLOptionElement::childrenChanged(const ChildrenChange& change) 280 void HTMLOptionElement::childrenChanged(const ChildrenChange& change)
272 { 281 {
273 if (HTMLDataListElement* dataList = ownerDataListElement()) 282 if (HTMLDataListElement* dataList = ownerDataListElement())
274 dataList->optionElementChildrenChanged(); 283 dataList->optionElementChildrenChanged();
275 else if (HTMLSelectElement* select = ownerSelectElement()) 284 else if (HTMLSelectElement* select = ownerSelectElement())
276 select->optionElementChildrenChanged(); 285 select->optionElementChildrenChanged();
277 updateLabel(); 286 updateLabel();
278 HTMLElement::childrenChanged(change); 287 HTMLElement::childrenChanged(change);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 ASSERT(parent); 434 ASSERT(parent);
426 if (isHTMLOptGroupElement(*parent)) { 435 if (isHTMLOptGroupElement(*parent)) {
427 const LayoutStyle* parentStyle = parent->layoutStyle() ? parent->lay outStyle() : parent->computedStyle(); 436 const LayoutStyle* parentStyle = parent->layoutStyle() ? parent->lay outStyle() : parent->computedStyle();
428 return !parentStyle || parentStyle->display() == NONE; 437 return !parentStyle || parentStyle->display() == NONE;
429 } 438 }
430 } 439 }
431 return m_style->display() == NONE; 440 return m_style->display() == NONE;
432 } 441 }
433 442
434 } // namespace blink 443 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698