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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXMenuList.cpp

Issue 2804383002: Replace ASSERT with DCHECK in modules/accessibility (Closed)
Patch Set: Created 3 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) 2010 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2010 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 return true; 60 return true;
61 } 61 }
62 62
63 void AXMenuList::clearChildren() { 63 void AXMenuList::clearChildren() {
64 if (m_children.isEmpty()) 64 if (m_children.isEmpty())
65 return; 65 return;
66 66
67 // There's no reason to clear our AXMenuListPopup child. If we get a 67 // There's no reason to clear our AXMenuListPopup child. If we get a
68 // call to clearChildren, it's because the options might have changed, 68 // call to clearChildren, it's because the options might have changed,
69 // so call it on our popup. 69 // so call it on our popup.
70 ASSERT(m_children.size() == 1); 70 DCHECK(m_children.size() == 1);
tkent 2017/04/09 23:21:23 Use DCHECK_EQ
71 m_children[0]->clearChildren(); 71 m_children[0]->clearChildren();
72 m_childrenDirty = false; 72 m_childrenDirty = false;
73 } 73 }
74 74
75 bool AXMenuList::nameFromContents() const { 75 bool AXMenuList::nameFromContents() const {
76 return false; 76 return false;
77 } 77 }
78 78
79 void AXMenuList::addChildren() { 79 void AXMenuList::addChildren() {
80 ASSERT(!isDetached()); 80 DCHECK(!isDetached());
81 m_haveChildren = true; 81 m_haveChildren = true;
82 82
83 AXObjectCacheImpl& cache = axObjectCache(); 83 AXObjectCacheImpl& cache = axObjectCache();
84 84
85 AXObject* list = cache.getOrCreate(MenuListPopupRole); 85 AXObject* list = cache.getOrCreate(MenuListPopupRole);
86 if (!list) 86 if (!list)
87 return; 87 return;
88 88
89 toAXMockObject(list)->setParent(this); 89 toAXMockObject(list)->setParent(this);
90 if (list->accessibilityIsIgnored()) { 90 if (list->accessibilityIsIgnored()) {
(...skipping 25 matching lines...) Expand all
116 bool AXMenuList::canSetFocusAttribute() const { 116 bool AXMenuList::canSetFocusAttribute() const {
117 if (!getNode()) 117 if (!getNode())
118 return false; 118 return false;
119 119
120 return !toElement(getNode())->isDisabledFormControl(); 120 return !toElement(getNode())->isDisabledFormControl();
121 } 121 }
122 122
123 void AXMenuList::didUpdateActiveOption(int optionIndex) { 123 void AXMenuList::didUpdateActiveOption(int optionIndex) {
124 const auto& childObjects = children(); 124 const auto& childObjects = children();
125 if (!childObjects.isEmpty()) { 125 if (!childObjects.isEmpty()) {
126 ASSERT(childObjects.size() == 1); 126 DCHECK(childObjects.size() == 1);
tkent 2017/04/09 23:21:23 use DCHECK_EQ
127 ASSERT(childObjects[0]->isMenuListPopup()); 127 DCHECK(childObjects[0]->isMenuListPopup());
128 128
129 if (childObjects[0]->isMenuListPopup()) { 129 if (childObjects[0]->isMenuListPopup()) {
130 if (AXMenuListPopup* popup = toAXMenuListPopup(childObjects[0].get())) 130 if (AXMenuListPopup* popup = toAXMenuListPopup(childObjects[0].get()))
131 popup->didUpdateActiveOption(optionIndex); 131 popup->didUpdateActiveOption(optionIndex);
132 } 132 }
133 } 133 }
134 134
135 axObjectCache().postNotification(this, 135 axObjectCache().postNotification(this,
136 AXObjectCacheImpl::AXMenuListValueChanged); 136 AXObjectCacheImpl::AXMenuListValueChanged);
137 } 137 }
(...skipping 12 matching lines...) Expand all
150 150
151 AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get()); 151 AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get());
152 popup->didHide(); 152 popup->didHide();
153 153
154 if (getNode() && getNode()->isFocused()) 154 if (getNode() && getNode()->isFocused())
155 axObjectCache().postNotification( 155 axObjectCache().postNotification(
156 this, AXObjectCacheImpl::AXFocusedUIElementChanged); 156 this, AXObjectCacheImpl::AXFocusedUIElementChanged);
157 } 157 }
158 158
159 } // namespace blink 159 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698