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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXSlider.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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 case SliderVerticalPart: 73 case SliderVerticalPart:
74 case MediaVolumeSliderPart: 74 case MediaVolumeSliderPart:
75 return AccessibilityOrientationVertical; 75 return AccessibilityOrientationVertical;
76 76
77 default: 77 default:
78 return AccessibilityOrientationHorizontal; 78 return AccessibilityOrientationHorizontal;
79 } 79 }
80 } 80 }
81 81
82 void AXSlider::addChildren() { 82 void AXSlider::addChildren() {
83 ASSERT(!isDetached()); 83 DCHECK(!isDetached());
84 ASSERT(!m_haveChildren); 84 DCHECK(!m_haveChildren);
85 85
86 m_haveChildren = true; 86 m_haveChildren = true;
87 87
88 AXObjectCacheImpl& cache = axObjectCache(); 88 AXObjectCacheImpl& cache = axObjectCache();
89 89
90 AXSliderThumb* thumb = 90 AXSliderThumb* thumb =
91 static_cast<AXSliderThumb*>(cache.getOrCreate(SliderThumbRole)); 91 static_cast<AXSliderThumb*>(cache.getOrCreate(SliderThumbRole));
92 thumb->setParent(this); 92 thumb->setParent(this);
93 93
94 // Before actually adding the value indicator to the hierarchy, 94 // Before actually adding the value indicator to the hierarchy,
95 // allow the platform to make a final decision about it. 95 // allow the platform to make a final decision about it.
96 if (thumb->accessibilityIsIgnored()) 96 if (thumb->accessibilityIsIgnored())
97 cache.remove(thumb->axObjectID()); 97 cache.remove(thumb->axObjectID());
98 else 98 else
99 m_children.push_back(thumb); 99 m_children.push_back(thumb);
100 } 100 }
101 101
102 AXObject* AXSlider::elementAccessibilityHitTest(const IntPoint& point) const { 102 AXObject* AXSlider::elementAccessibilityHitTest(const IntPoint& point) const {
103 if (m_children.size()) { 103 if (m_children.size()) {
104 ASSERT(m_children.size() == 1); 104 DCHECK(m_children.size() == 1);
tkent 2017/04/09 23:21:23 Use DCHECK_EQ
105 if (m_children[0]->getBoundsInFrameCoordinates().contains(point)) 105 if (m_children[0]->getBoundsInFrameCoordinates().contains(point))
106 return m_children[0].get(); 106 return m_children[0].get();
107 } 107 }
108 108
109 return axObjectCache().getOrCreate(m_layoutObject); 109 return axObjectCache().getOrCreate(m_layoutObject);
110 } 110 }
111 111
112 void AXSlider::setValue(const String& value) { 112 void AXSlider::setValue(const String& value) {
113 HTMLInputElement* input = element(); 113 HTMLInputElement* input = element();
114 114
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 DCHECK(thumbElement); 146 DCHECK(thumbElement);
147 return thumbElement->layoutObject(); 147 return thumbElement->layoutObject();
148 } 148 }
149 149
150 bool AXSliderThumb::computeAccessibilityIsIgnored( 150 bool AXSliderThumb::computeAccessibilityIsIgnored(
151 IgnoredReasons* ignoredReasons) const { 151 IgnoredReasons* ignoredReasons) const {
152 return accessibilityIsIgnoredByDefault(ignoredReasons); 152 return accessibilityIsIgnoredByDefault(ignoredReasons);
153 } 153 }
154 154
155 } // namespace blink 155 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698