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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 return m_parent->isEnabled(); 54 return m_parent->isEnabled();
55 } 55 }
56 56
57 bool AXMenuListPopup::computeAccessibilityIsIgnored( 57 bool AXMenuListPopup::computeAccessibilityIsIgnored(
58 IgnoredReasons* ignoredReasons) const { 58 IgnoredReasons* ignoredReasons) const {
59 return accessibilityIsIgnoredByDefault(ignoredReasons); 59 return accessibilityIsIgnoredByDefault(ignoredReasons);
60 } 60 }
61 61
62 AXMenuListOption* AXMenuListPopup::menuListOptionAXObject( 62 AXMenuListOption* AXMenuListPopup::menuListOptionAXObject(
63 HTMLElement* element) const { 63 HTMLElement* element) const {
64 ASSERT(element); 64 DCHECK(element);
65 if (!isHTMLOptionElement(*element)) 65 if (!isHTMLOptionElement(*element))
66 return 0; 66 return 0;
67 67
68 AXObject* object = axObjectCache().getOrCreate(element); 68 AXObject* object = axObjectCache().getOrCreate(element);
69 if (!object || !object->isMenuListOption()) 69 if (!object || !object->isMenuListOption())
70 return 0; 70 return 0;
71 71
72 return toAXMenuListOption(object); 72 return toAXMenuListOption(object);
73 } 73 }
74 74
(...skipping 11 matching lines...) Expand all
86 86
87 bool AXMenuListPopup::press() { 87 bool AXMenuListPopup::press() {
88 if (!m_parent) 88 if (!m_parent)
89 return false; 89 return false;
90 90
91 m_parent->press(); 91 m_parent->press();
92 return true; 92 return true;
93 } 93 }
94 94
95 void AXMenuListPopup::addChildren() { 95 void AXMenuListPopup::addChildren() {
96 ASSERT(!isDetached()); 96 DCHECK(!isDetached());
97 if (!m_parent) 97 if (!m_parent)
98 return; 98 return;
99 99
100 Node* parentNode = m_parent->getNode(); 100 Node* parentNode = m_parent->getNode();
101 if (!isHTMLSelectElement(parentNode)) 101 if (!isHTMLSelectElement(parentNode))
102 return; 102 return;
103 103
104 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode); 104 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode);
105 m_haveChildren = true; 105 m_haveChildren = true;
106 106
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 168
169 AXObject* AXMenuListPopup::activeDescendant() { 169 AXObject* AXMenuListPopup::activeDescendant() {
170 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size())) 170 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size()))
171 return nullptr; 171 return nullptr;
172 172
173 return m_children[m_activeIndex].get(); 173 return m_children[m_activeIndex].get();
174 } 174 }
175 175
176 } // namespace blink 176 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698