Commit 6648272c authored by pilgrim's avatar pilgrim Committed by Commit bot

Replace ASSERT with DCHECK in modules/accessibility

BUG=707651

Review-Url: https://codereview.chromium.org/2804383002
Cr-Commit-Position: refs/heads/master@{#463037}
parent 60a7c584
...@@ -75,8 +75,8 @@ bool AXARIAGrid::addTableRowChild(AXObject* child, ...@@ -75,8 +75,8 @@ bool AXARIAGrid::addTableRowChild(AXObject* child,
} }
void AXARIAGrid::addChildren() { void AXARIAGrid::addChildren() {
ASSERT(!isDetached()); DCHECK(!isDetached());
ASSERT(!m_haveChildren); DCHECK(!m_haveChildren);
if (!isAXTable()) { if (!isAXTable()) {
AXLayoutObject::addChildren(); AXLayoutObject::addChildren();
......
...@@ -58,7 +58,7 @@ HTMLMapElement* AXImageMapLink::mapElement() const { ...@@ -58,7 +58,7 @@ HTMLMapElement* AXImageMapLink::mapElement() const {
} }
AXObject* AXImageMapLink::computeParent() const { AXObject* AXImageMapLink::computeParent() const {
ASSERT(!isDetached()); DCHECK(!isDetached());
if (m_parent) if (m_parent)
return m_parent; return m_parent;
......
...@@ -100,7 +100,7 @@ void AXInlineTextBox::textCharacterOffsets(Vector<int>& offsets) const { ...@@ -100,7 +100,7 @@ void AXInlineTextBox::textCharacterOffsets(Vector<int>& offsets) const {
unsigned len = m_inlineTextBox->len(); unsigned len = m_inlineTextBox->len();
Vector<float> widths; Vector<float> widths;
m_inlineTextBox->characterWidths(widths); m_inlineTextBox->characterWidths(widths);
ASSERT(widths.size() == len); DCHECK(widths.size() == len);
offsets.resize(len); offsets.resize(len);
float widthSoFar = 0; float widthSoFar = 0;
...@@ -132,7 +132,7 @@ String AXInlineTextBox::name(AXNameFrom& nameFrom, ...@@ -132,7 +132,7 @@ String AXInlineTextBox::name(AXNameFrom& nameFrom,
} }
AXObject* AXInlineTextBox::computeParent() const { AXObject* AXInlineTextBox::computeParent() const {
ASSERT(!isDetached()); DCHECK(!isDetached());
if (!m_inlineTextBox || !m_axObjectCache) if (!m_inlineTextBox || !m_axObjectCache)
return 0; return 0;
......
...@@ -168,7 +168,7 @@ static inline LayoutObject* endOfContinuations(LayoutObject* layoutObject) { ...@@ -168,7 +168,7 @@ static inline LayoutObject* endOfContinuations(LayoutObject* layoutObject) {
prev = cur; prev = cur;
if (cur->isLayoutInline()) { if (cur->isLayoutInline()) {
cur = toLayoutInline(cur)->inlineElementContinuation(); cur = toLayoutInline(cur)->inlineElementContinuation();
ASSERT(cur || !toLayoutInline(prev)->continuation()); DCHECK(cur || !toLayoutInline(prev)->continuation());
} else { } else {
cur = toLayoutBlockFlow(cur)->inlineElementContinuation(); cur = toLayoutBlockFlow(cur)->inlineElementContinuation();
} }
...@@ -183,7 +183,7 @@ static inline bool lastChildHasContinuation(LayoutObject* layoutObject) { ...@@ -183,7 +183,7 @@ static inline bool lastChildHasContinuation(LayoutObject* layoutObject) {
} }
static LayoutBoxModelObject* nextContinuation(LayoutObject* layoutObject) { static LayoutBoxModelObject* nextContinuation(LayoutObject* layoutObject) {
ASSERT(layoutObject); DCHECK(layoutObject);
if (layoutObject->isLayoutInline() && !layoutObject->isAtomicInlineLevel()) if (layoutObject->isLayoutInline() && !layoutObject->isAtomicInlineLevel())
return toLayoutInline(layoutObject)->continuation(); return toLayoutInline(layoutObject)->continuation();
if (layoutObject->isLayoutBlockFlow()) if (layoutObject->isLayoutBlockFlow())
...@@ -206,7 +206,7 @@ AXLayoutObject* AXLayoutObject::create(LayoutObject* layoutObject, ...@@ -206,7 +206,7 @@ AXLayoutObject* AXLayoutObject::create(LayoutObject* layoutObject,
} }
AXLayoutObject::~AXLayoutObject() { AXLayoutObject::~AXLayoutObject() {
ASSERT(isDetached()); DCHECK(isDetached());
} }
LayoutBoxModelObject* AXLayoutObject::getLayoutBoxModelObject() const { LayoutBoxModelObject* AXLayoutObject::getLayoutBoxModelObject() const {
...@@ -395,7 +395,7 @@ bool AXLayoutObject::isLoaded() const { ...@@ -395,7 +395,7 @@ bool AXLayoutObject::isLoaded() const {
} }
bool AXLayoutObject::isOffScreen() const { bool AXLayoutObject::isOffScreen() const {
ASSERT(m_layoutObject); DCHECK(m_layoutObject);
IntRect contentRect = IntRect contentRect =
pixelSnappedIntRect(m_layoutObject->absoluteVisualRect()); pixelSnappedIntRect(m_layoutObject->absoluteVisualRect());
FrameView* view = m_layoutObject->frame()->view(); FrameView* view = m_layoutObject->frame()->view();
...@@ -405,7 +405,7 @@ bool AXLayoutObject::isOffScreen() const { ...@@ -405,7 +405,7 @@ bool AXLayoutObject::isOffScreen() const {
} }
bool AXLayoutObject::isReadOnly() const { bool AXLayoutObject::isReadOnly() const {
ASSERT(m_layoutObject); DCHECK(m_layoutObject);
if (isWebArea()) { if (isWebArea()) {
Document& document = m_layoutObject->document(); Document& document = m_layoutObject->document();
...@@ -506,7 +506,7 @@ AXObjectInclusion AXLayoutObject::defaultObjectInclusion( ...@@ -506,7 +506,7 @@ AXObjectInclusion AXLayoutObject::defaultObjectInclusion(
bool AXLayoutObject::computeAccessibilityIsIgnored( bool AXLayoutObject::computeAccessibilityIsIgnored(
IgnoredReasons* ignoredReasons) const { IgnoredReasons* ignoredReasons) const {
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
ASSERT(m_initialized); DCHECK(m_initialized);
#endif #endif
if (!m_layoutObject) if (!m_layoutObject)
...@@ -1449,7 +1449,7 @@ AXObject* AXLayoutObject::elementAccessibilityHitTest( ...@@ -1449,7 +1449,7 @@ AXObject* AXLayoutObject::elementAccessibilityHitTest(
// //
AXObject* AXLayoutObject::computeParent() const { AXObject* AXLayoutObject::computeParent() const {
ASSERT(!isDetached()); DCHECK(!isDetached());
if (!m_layoutObject) if (!m_layoutObject)
return 0; return 0;
...@@ -1579,11 +1579,11 @@ AXObject* AXLayoutObject::rawNextSibling() const { ...@@ -1579,11 +1579,11 @@ AXObject* AXLayoutObject::rawNextSibling() const {
} }
void AXLayoutObject::addChildren() { void AXLayoutObject::addChildren() {
ASSERT(!isDetached()); DCHECK(!isDetached());
// If the need to add more children in addition to existing children arises, // If the need to add more children in addition to existing children arises,
// childrenChanged should have been called, leaving the object with no // childrenChanged should have been called, leaving the object with no
// children. // children.
ASSERT(!m_haveChildren); DCHECK(!m_haveChildren);
m_haveChildren = true; m_haveChildren = true;
...@@ -1743,7 +1743,7 @@ AXObject::AXRange AXLayoutObject::selection() const { ...@@ -1743,7 +1743,7 @@ AXObject::AXRange AXLayoutObject::selection() const {
TextAffinity endAffinity = visibleEnd.affinity(); TextAffinity endAffinity = visibleEnd.affinity();
Node* anchorNode = start.anchorNode(); Node* anchorNode = start.anchorNode();
ASSERT(anchorNode); DCHECK(anchorNode);
AXLayoutObject* anchorObject = nullptr; AXLayoutObject* anchorObject = nullptr;
// Find the closest node that has a corresponding AXObject. // Find the closest node that has a corresponding AXObject.
...@@ -1761,7 +1761,7 @@ AXObject::AXRange AXLayoutObject::selection() const { ...@@ -1761,7 +1761,7 @@ AXObject::AXRange AXLayoutObject::selection() const {
} }
Node* focusNode = end.anchorNode(); Node* focusNode = end.anchorNode();
ASSERT(focusNode); DCHECK(focusNode);
AXLayoutObject* focusObject = nullptr; AXLayoutObject* focusObject = nullptr;
while (focusNode) { while (focusNode) {
...@@ -1779,9 +1779,9 @@ AXObject::AXRange AXLayoutObject::selection() const { ...@@ -1779,9 +1779,9 @@ AXObject::AXRange AXLayoutObject::selection() const {
return AXRange(); return AXRange();
int anchorOffset = anchorObject->indexForVisiblePosition(visibleStart); int anchorOffset = anchorObject->indexForVisiblePosition(visibleStart);
ASSERT(anchorOffset >= 0); DCHECK(anchorOffset >= 0);
int focusOffset = focusObject->indexForVisiblePosition(visibleEnd); int focusOffset = focusObject->indexForVisiblePosition(visibleEnd);
ASSERT(focusOffset >= 0); DCHECK(focusOffset >= 0);
return AXRange(anchorObject, anchorOffset, startAffinity, focusObject, return AXRange(anchorObject, anchorOffset, startAffinity, focusObject,
focusOffset, endAffinity); focusOffset, endAffinity);
} }
...@@ -1817,9 +1817,9 @@ AXObject::AXRange AXLayoutObject::selectionUnderObject() const { ...@@ -1817,9 +1817,9 @@ AXObject::AXRange AXLayoutObject::selectionUnderObject() const {
} }
int start = indexForVisiblePosition(selection.visibleStart()); int start = indexForVisiblePosition(selection.visibleStart());
ASSERT(start >= 0); DCHECK(start >= 0);
int end = indexForVisiblePosition(selection.visibleEnd()); int end = indexForVisiblePosition(selection.visibleEnd());
ASSERT(end >= 0); DCHECK(end >= 0);
return AXRange(start, end); return AXRange(start, end);
} }
...@@ -1849,7 +1849,7 @@ AXObject::AXRange AXLayoutObject::textControlSelection() const { ...@@ -1849,7 +1849,7 @@ AXObject::AXRange AXLayoutObject::textControlSelection() const {
layout->frame()->selection().computeVisibleSelectionInDOMTreeDeprecated(); layout->frame()->selection().computeVisibleSelectionInDOMTreeDeprecated();
TextControlElement* textControl = TextControlElement* textControl =
toLayoutTextControl(layout)->textControlElement(); toLayoutTextControl(layout)->textControlElement();
ASSERT(textControl); DCHECK(textControl);
int start = textControl->selectionStart(); int start = textControl->selectionStart();
int end = textControl->selectionEnd(); int end = textControl->selectionEnd();
...@@ -2459,7 +2459,7 @@ void AXLayoutObject::addImageMapChildren() { ...@@ -2459,7 +2459,7 @@ void AXLayoutObject::addImageMapChildren() {
if (obj) { if (obj) {
AXImageMapLink* areaObject = toAXImageMapLink(obj); AXImageMapLink* areaObject = toAXImageMapLink(obj);
areaObject->setParent(this); areaObject->setParent(this);
ASSERT(areaObject->axObjectID() != 0); DCHECK(areaObject->axObjectID() != 0);
if (!areaObject->accessibilityIsIgnored()) if (!areaObject->accessibilityIsIgnored())
m_children.push_back(areaObject); m_children.push_back(areaObject);
else else
...@@ -2475,7 +2475,7 @@ void AXLayoutObject::addCanvasChildren() { ...@@ -2475,7 +2475,7 @@ void AXLayoutObject::addCanvasChildren() {
// If it's a canvas, it won't have laid out children, but it might have // If it's a canvas, it won't have laid out children, but it might have
// accessible fallback content. Clear m_haveChildren because // accessible fallback content. Clear m_haveChildren because
// AXNodeObject::addChildren will expect it to be false. // AXNodeObject::addChildren will expect it to be false.
ASSERT(!m_children.size()); DCHECK(!m_children.size());
m_haveChildren = false; m_haveChildren = false;
AXNodeObject::addChildren(); AXNodeObject::addChildren();
} }
......
...@@ -138,7 +138,7 @@ String AXListBoxOption::textAlternative(bool recursive, ...@@ -138,7 +138,7 @@ String AXListBoxOption::textAlternative(bool recursive,
// If nameSources is non-null, relatedObjects is used in filling it in, so it // If nameSources is non-null, relatedObjects is used in filling it in, so it
// must be non-null as well. // must be non-null as well.
if (nameSources) if (nameSources)
ASSERT(relatedObjects); DCHECK(relatedObjects);
if (!getNode()) if (!getNode())
return String(); return String();
......
...@@ -48,7 +48,7 @@ AccessibilityMediaControl::AccessibilityMediaControl( ...@@ -48,7 +48,7 @@ AccessibilityMediaControl::AccessibilityMediaControl(
AXObject* AccessibilityMediaControl::create(LayoutObject* layoutObject, AXObject* AccessibilityMediaControl::create(LayoutObject* layoutObject,
AXObjectCacheImpl& axObjectCache) { AXObjectCacheImpl& axObjectCache) {
ASSERT(layoutObject->node()); DCHECK(layoutObject->node());
switch (mediaControlElementType(layoutObject->node())) { switch (mediaControlElementType(layoutObject->node())) {
case MediaSlider: case MediaSlider:
......
...@@ -67,7 +67,7 @@ void AXMenuList::clearChildren() { ...@@ -67,7 +67,7 @@ void AXMenuList::clearChildren() {
// There's no reason to clear our AXMenuListPopup child. If we get a // There's no reason to clear our AXMenuListPopup child. If we get a
// call to clearChildren, it's because the options might have changed, // call to clearChildren, it's because the options might have changed,
// so call it on our popup. // so call it on our popup.
ASSERT(m_children.size() == 1); DCHECK(m_children.size() == 1);
m_children[0]->clearChildren(); m_children[0]->clearChildren();
m_childrenDirty = false; m_childrenDirty = false;
} }
...@@ -77,7 +77,7 @@ bool AXMenuList::nameFromContents() const { ...@@ -77,7 +77,7 @@ bool AXMenuList::nameFromContents() const {
} }
void AXMenuList::addChildren() { void AXMenuList::addChildren() {
ASSERT(!isDetached()); DCHECK(!isDetached());
m_haveChildren = true; m_haveChildren = true;
AXObjectCacheImpl& cache = axObjectCache(); AXObjectCacheImpl& cache = axObjectCache();
...@@ -123,8 +123,8 @@ bool AXMenuList::canSetFocusAttribute() const { ...@@ -123,8 +123,8 @@ bool AXMenuList::canSetFocusAttribute() const {
void AXMenuList::didUpdateActiveOption(int optionIndex) { void AXMenuList::didUpdateActiveOption(int optionIndex) {
const auto& childObjects = children(); const auto& childObjects = children();
if (!childObjects.isEmpty()) { if (!childObjects.isEmpty()) {
ASSERT(childObjects.size() == 1); DCHECK(childObjects.size() == 1);
ASSERT(childObjects[0]->isMenuListPopup()); DCHECK(childObjects[0]->isMenuListPopup());
if (childObjects[0]->isMenuListPopup()) { if (childObjects[0]->isMenuListPopup()) {
if (AXMenuListPopup* popup = toAXMenuListPopup(childObjects[0].get())) if (AXMenuListPopup* popup = toAXMenuListPopup(childObjects[0].get()))
......
...@@ -39,7 +39,7 @@ AXMenuListOption::AXMenuListOption(HTMLOptionElement* element, ...@@ -39,7 +39,7 @@ AXMenuListOption::AXMenuListOption(HTMLOptionElement* element,
: AXMockObject(axObjectCache), m_element(element) {} : AXMockObject(axObjectCache), m_element(element) {}
AXMenuListOption::~AXMenuListOption() { AXMenuListOption::~AXMenuListOption() {
ASSERT(!m_element); DCHECK(!m_element);
} }
void AXMenuListOption::detach() { void AXMenuListOption::detach() {
...@@ -117,12 +117,12 @@ void AXMenuListOption::getRelativeBounds( ...@@ -117,12 +117,12 @@ void AXMenuListOption::getRelativeBounds(
AXObject* parent = parentObject(); AXObject* parent = parentObject();
if (!parent) if (!parent)
return; return;
ASSERT(parent->isMenuListPopup()); DCHECK(parent->isMenuListPopup());
AXObject* grandparent = parent->parentObject(); AXObject* grandparent = parent->parentObject();
if (!grandparent) if (!grandparent)
return; return;
ASSERT(grandparent->isMenuList()); DCHECK(grandparent->isMenuList());
grandparent->getRelativeBounds(outContainer, outBoundsInContainer, grandparent->getRelativeBounds(outContainer, outBoundsInContainer,
outContainerTransform); outContainerTransform);
} }
...@@ -136,7 +136,7 @@ String AXMenuListOption::textAlternative(bool recursive, ...@@ -136,7 +136,7 @@ String AXMenuListOption::textAlternative(bool recursive,
// If nameSources is non-null, relatedObjects is used in filling it in, so it // If nameSources is non-null, relatedObjects is used in filling it in, so it
// must be non-null as well. // must be non-null as well.
if (nameSources) if (nameSources)
ASSERT(relatedObjects); DCHECK(relatedObjects);
if (!getNode()) if (!getNode())
return String(); return String();
......
...@@ -61,7 +61,7 @@ bool AXMenuListPopup::computeAccessibilityIsIgnored( ...@@ -61,7 +61,7 @@ bool AXMenuListPopup::computeAccessibilityIsIgnored(
AXMenuListOption* AXMenuListPopup::menuListOptionAXObject( AXMenuListOption* AXMenuListPopup::menuListOptionAXObject(
HTMLElement* element) const { HTMLElement* element) const {
ASSERT(element); DCHECK(element);
if (!isHTMLOptionElement(*element)) if (!isHTMLOptionElement(*element))
return 0; return 0;
...@@ -93,7 +93,7 @@ bool AXMenuListPopup::press() { ...@@ -93,7 +93,7 @@ bool AXMenuListPopup::press() {
} }
void AXMenuListPopup::addChildren() { void AXMenuListPopup::addChildren() {
ASSERT(!isDetached()); DCHECK(!isDetached());
if (!m_parent) if (!m_parent)
return; return;
......
...@@ -227,7 +227,7 @@ AXNodeObject* AXNodeObject::create(Node* node, ...@@ -227,7 +227,7 @@ AXNodeObject* AXNodeObject::create(Node* node,
} }
AXNodeObject::~AXNodeObject() { AXNodeObject::~AXNodeObject() {
ASSERT(!m_node); DCHECK(!m_node);
} }
void AXNodeObject::alterSliderValue(bool increase) { void AXNodeObject::alterSliderValue(bool increase) {
...@@ -268,7 +268,7 @@ bool AXNodeObject::computeAccessibilityIsIgnored( ...@@ -268,7 +268,7 @@ bool AXNodeObject::computeAccessibilityIsIgnored(
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
// Double-check that an AXObject is never accessed before // Double-check that an AXObject is never accessed before
// it's been initialized. // it's been initialized.
ASSERT(m_initialized); DCHECK(m_initialized);
#endif #endif
// If this element is within a parent that cannot have children, it should not // If this element is within a parent that cannot have children, it should not
...@@ -904,7 +904,7 @@ AccessibilityRole AXNodeObject::remapAriaRoleDueToParent( ...@@ -904,7 +904,7 @@ AccessibilityRole AXNodeObject::remapAriaRoleDueToParent(
void AXNodeObject::init() { void AXNodeObject::init() {
#if DCHECK_IS_ON() #if DCHECK_IS_ON()
ASSERT(!m_initialized); DCHECK(!m_initialized);
m_initialized = true; m_initialized = true;
#endif #endif
m_role = determineAccessibilityRole(); m_role = determineAccessibilityRole();
...@@ -1876,7 +1876,7 @@ String AXNodeObject::textAlternative(bool recursive, ...@@ -1876,7 +1876,7 @@ String AXNodeObject::textAlternative(bool recursive,
// If nameSources is non-null, relatedObjects is used in filling it in, so it // If nameSources is non-null, relatedObjects is used in filling it in, so it
// must be non-null as well. // must be non-null as well.
if (nameSources) if (nameSources)
ASSERT(relatedObjects); DCHECK(relatedObjects);
bool foundTextAlternative = false; bool foundTextAlternative = false;
...@@ -2163,7 +2163,7 @@ static Node* getParentNodeForComputeParent(Node* node) { ...@@ -2163,7 +2163,7 @@ static Node* getParentNodeForComputeParent(Node* node) {
} }
AXObject* AXNodeObject::computeParent() const { AXObject* AXNodeObject::computeParent() const {
ASSERT(!isDetached()); DCHECK(!isDetached());
if (Node* parentNode = getParentNodeForComputeParent(getNode())) if (Node* parentNode = getParentNodeForComputeParent(getNode()))
return axObjectCache().getOrCreate(parentNode); return axObjectCache().getOrCreate(parentNode);
...@@ -2201,11 +2201,11 @@ AXObject* AXNodeObject::rawNextSibling() const { ...@@ -2201,11 +2201,11 @@ AXObject* AXNodeObject::rawNextSibling() const {
} }
void AXNodeObject::addChildren() { void AXNodeObject::addChildren() {
ASSERT(!isDetached()); DCHECK(!isDetached());
// If the need to add more children in addition to existing children arises, // If the need to add more children in addition to existing children arises,
// childrenChanged should have been called, leaving the object with no // childrenChanged should have been called, leaving the object with no
// children. // children.
ASSERT(!m_haveChildren); DCHECK(!m_haveChildren);
if (!m_node) if (!m_node)
return; return;
...@@ -2254,7 +2254,7 @@ void AXNodeObject::insertChild(AXObject* child, unsigned index) { ...@@ -2254,7 +2254,7 @@ void AXNodeObject::insertChild(AXObject* child, unsigned index) {
for (size_t i = 0; i < length; ++i) for (size_t i = 0; i < length; ++i)
m_children.insert(index + i, children[i]); m_children.insert(index + i, children[i]);
} else { } else {
ASSERT(child->parentObject() == this); DCHECK(child->parentObject() == this);
m_children.insert(index, child); m_children.insert(index, child);
} }
} }
...@@ -2571,7 +2571,7 @@ String AXNodeObject::nativeTextAlternative( ...@@ -2571,7 +2571,7 @@ String AXNodeObject::nativeTextAlternative(
// If nameSources is non-null, relatedObjects is used in filling it in, so it // If nameSources is non-null, relatedObjects is used in filling it in, so it
// must be non-null as well. // must be non-null as well.
if (nameSources) if (nameSources)
ASSERT(relatedObjects); DCHECK(relatedObjects);
String textAlternative; String textAlternative;
AXRelatedObjectVector localRelatedObjects; AXRelatedObjectVector localRelatedObjects;
...@@ -2907,7 +2907,7 @@ String AXNodeObject::nativeTextAlternative( ...@@ -2907,7 +2907,7 @@ String AXNodeObject::nativeTextAlternative(
nameSources->back().type = nameFrom; nameSources->back().type = nameFrom;
nameSources->back().nativeSource = AXTextFromNativeHTMLTitleElement; nameSources->back().nativeSource = AXTextFromNativeHTMLTitleElement;
} }
ASSERT(getNode()->isContainerNode()); DCHECK(getNode()->isContainerNode());
Element* title = ElementTraversal::firstChild( Element* title = ElementTraversal::firstChild(
toContainerNode(*(getNode())), HasTagName(SVGNames::titleTag)); toContainerNode(*(getNode())), HasTagName(SVGNames::titleTag));
...@@ -3054,7 +3054,7 @@ String AXNodeObject::description(AXNameFrom nameFrom, ...@@ -3054,7 +3054,7 @@ String AXNodeObject::description(AXNameFrom nameFrom,
// If descriptionSources is non-null, relatedObjects is used in filling it in, // If descriptionSources is non-null, relatedObjects is used in filling it in,
// so it must be non-null as well. // so it must be non-null as well.
if (descriptionSources) if (descriptionSources)
ASSERT(relatedObjects); DCHECK(relatedObjects);
if (!getNode()) if (!getNode())
return String(); return String();
......
...@@ -364,7 +364,7 @@ AXObject::AXObject(AXObjectCacheImpl& axObjectCache) ...@@ -364,7 +364,7 @@ AXObject::AXObject(AXObjectCacheImpl& axObjectCache)
} }
AXObject::~AXObject() { AXObject::~AXObject() {
ASSERT(isDetached()); DCHECK(isDetached());
--s_numberOfLiveAXObjects; --s_numberOfLiveAXObjects;
} }
...@@ -1672,7 +1672,7 @@ bool AXObject::isARIAInput(AccessibilityRole ariaRole) { ...@@ -1672,7 +1672,7 @@ bool AXObject::isARIAInput(AccessibilityRole ariaRole) {
} }
AccessibilityRole AXObject::ariaRoleToWebCoreRole(const String& value) { AccessibilityRole AXObject::ariaRoleToWebCoreRole(const String& value) {
ASSERT(!value.isEmpty()); DCHECK(!value.isEmpty());
static const ARIARoleMap* roleMap = createARIARoleMap(); static const ARIARoleMap* roleMap = createARIARoleMap();
......
...@@ -596,7 +596,7 @@ class MODULES_EXPORT AXObject : public GarbageCollectedFinalized<AXObject> { ...@@ -596,7 +596,7 @@ class MODULES_EXPORT AXObject : public GarbageCollectedFinalized<AXObject> {
// The AXObjectCacheImpl that owns this object, and its unique ID within this // The AXObjectCacheImpl that owns this object, and its unique ID within this
// cache. // cache.
AXObjectCacheImpl& axObjectCache() const { AXObjectCacheImpl& axObjectCache() const {
ASSERT(m_axObjectCache); DCHECK(m_axObjectCache);
return *m_axObjectCache; return *m_axObjectCache;
} }
......
...@@ -53,7 +53,7 @@ void AXSVGRoot::setParent(AXObject* parent) { ...@@ -53,7 +53,7 @@ void AXSVGRoot::setParent(AXObject* parent) {
} }
AXObject* AXSVGRoot::computeParent() const { AXObject* AXSVGRoot::computeParent() const {
ASSERT(!isDetached()); DCHECK(!isDetached());
// If a parent was set because this is a remote SVG resource, use that // If a parent was set because this is a remote SVG resource, use that
// but otherwise, we should rely on the standard layout tree for the parent. // but otherwise, we should rely on the standard layout tree for the parent.
if (m_parent) if (m_parent)
......
...@@ -80,8 +80,8 @@ AccessibilityOrientation AXSlider::orientation() const { ...@@ -80,8 +80,8 @@ AccessibilityOrientation AXSlider::orientation() const {
} }
void AXSlider::addChildren() { void AXSlider::addChildren() {
ASSERT(!isDetached()); DCHECK(!isDetached());
ASSERT(!m_haveChildren); DCHECK(!m_haveChildren);
m_haveChildren = true; m_haveChildren = true;
...@@ -101,7 +101,7 @@ void AXSlider::addChildren() { ...@@ -101,7 +101,7 @@ void AXSlider::addChildren() {
AXObject* AXSlider::elementAccessibilityHitTest(const IntPoint& point) const { AXObject* AXSlider::elementAccessibilityHitTest(const IntPoint& point) const {
if (m_children.size()) { if (m_children.size()) {
ASSERT(m_children.size() == 1); DCHECK(m_children.size() == 1);
if (m_children[0]->getBoundsInFrameCoordinates().contains(point)) if (m_children[0]->getBoundsInFrameCoordinates().contains(point))
return m_children[0].get(); return m_children[0].get();
} }
......
...@@ -38,7 +38,7 @@ AXSpinButton::AXSpinButton(AXObjectCacheImpl& axObjectCache) ...@@ -38,7 +38,7 @@ AXSpinButton::AXSpinButton(AXObjectCacheImpl& axObjectCache)
: AXMockObject(axObjectCache), m_spinButtonElement(nullptr) {} : AXMockObject(axObjectCache), m_spinButtonElement(nullptr) {}
AXSpinButton::~AXSpinButton() { AXSpinButton::~AXSpinButton() {
ASSERT(!m_spinButtonElement); DCHECK(!m_spinButtonElement);
} }
DEFINE_TRACE(AXSpinButton) { DEFINE_TRACE(AXSpinButton) {
...@@ -68,7 +68,7 @@ AccessibilityRole AXSpinButton::roleValue() const { ...@@ -68,7 +68,7 @@ AccessibilityRole AXSpinButton::roleValue() const {
} }
void AXSpinButton::addChildren() { void AXSpinButton::addChildren() {
ASSERT(!isDetached()); DCHECK(!isDetached());
m_haveChildren = true; m_haveChildren = true;
AXSpinButtonPart* incrementor = AXSpinButtonPart* incrementor =
...@@ -85,7 +85,7 @@ void AXSpinButton::addChildren() { ...@@ -85,7 +85,7 @@ void AXSpinButton::addChildren() {
} }
void AXSpinButton::step(int amount) { void AXSpinButton::step(int amount) {
ASSERT(m_spinButtonElement); DCHECK(m_spinButtonElement);
if (!m_spinButtonElement) if (!m_spinButtonElement)
return; return;
......
...@@ -364,13 +364,13 @@ void AXTable::clearChildren() { ...@@ -364,13 +364,13 @@ void AXTable::clearChildren() {
} }
void AXTable::addChildren() { void AXTable::addChildren() {
ASSERT(!isDetached()); DCHECK(!isDetached());
if (!isAXTable()) { if (!isAXTable()) {
AXLayoutObject::addChildren(); AXLayoutObject::addChildren();
return; return;
} }
ASSERT(!m_haveChildren); DCHECK(!m_haveChildren);
m_haveChildren = true; m_haveChildren = true;
if (!m_layoutObject || !m_layoutObject->isTable()) if (!m_layoutObject || !m_layoutObject->isTable())
......
...@@ -121,8 +121,8 @@ bool AXTableColumn::computeAccessibilityIsIgnored( ...@@ -121,8 +121,8 @@ bool AXTableColumn::computeAccessibilityIsIgnored(
} }
void AXTableColumn::addChildren() { void AXTableColumn::addChildren() {
ASSERT(!isDetached()); DCHECK(!isDetached());
ASSERT(!m_haveChildren); DCHECK(!m_haveChildren);
m_haveChildren = true; m_haveChildren = true;
if (!m_parent || !m_parent->isAXTable()) if (!m_parent || !m_parent->isAXTable())
......
...@@ -57,8 +57,8 @@ bool AXTableHeaderContainer::computeAccessibilityIsIgnored( ...@@ -57,8 +57,8 @@ bool AXTableHeaderContainer::computeAccessibilityIsIgnored(
} }
void AXTableHeaderContainer::addChildren() { void AXTableHeaderContainer::addChildren() {
ASSERT(!isDetached()); DCHECK(!isDetached());
ASSERT(!m_haveChildren); DCHECK(!m_haveChildren);
m_haveChildren = true; m_haveChildren = true;
if (!m_parent || !m_parent->isAXTable()) if (!m_parent || !m_parent->isAXTable())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment