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

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

Issue 2828013002: Replace DCHECK with DCHECK_EQ and DCHECK_GT as appropriate 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) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, Google 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 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after
2203 // aria-hidden changes from working correctly. Hence, whenever a parent is 2203 // aria-hidden changes from working correctly. Hence, whenever a parent is
2204 // getting children, ensure data is not stale. 2204 // getting children, ensure data is not stale.
2205 child->ClearChildren(); 2205 child->ClearChildren();
2206 2206
2207 if (child->AccessibilityIsIgnored()) { 2207 if (child->AccessibilityIsIgnored()) {
2208 const auto& children = child->Children(); 2208 const auto& children = child->Children();
2209 size_t length = children.size(); 2209 size_t length = children.size();
2210 for (size_t i = 0; i < length; ++i) 2210 for (size_t i = 0; i < length; ++i)
2211 children_.insert(index + i, children[i]); 2211 children_.insert(index + i, children[i]);
2212 } else { 2212 } else {
2213 DCHECK(child->ParentObject() == this); 2213 DCHECK_EQ(child->ParentObject(), this);
2214 children_.insert(index, child); 2214 children_.insert(index, child);
2215 } 2215 }
2216 } 2216 }
2217 2217
2218 bool AXNodeObject::CanHaveChildren() const { 2218 bool AXNodeObject::CanHaveChildren() const {
2219 // If this is an AXLayoutObject, then it's okay if this object 2219 // If this is an AXLayoutObject, then it's okay if this object
2220 // doesn't have a node - there are some layoutObjects that don't have 2220 // doesn't have a node - there are some layoutObjects that don't have
2221 // associated nodes, like scroll areas and css-generated text. 2221 // associated nodes, like scroll areas and css-generated text.
2222 if (!GetNode() && !IsAXLayoutObject()) 2222 if (!GetNode() && !IsAXLayoutObject())
2223 return false; 2223 return false;
(...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after
3219 return String(); 3219 return String();
3220 return ToTextControlElement(node)->StrippedPlaceholder(); 3220 return ToTextControlElement(node)->StrippedPlaceholder();
3221 } 3221 }
3222 3222
3223 DEFINE_TRACE(AXNodeObject) { 3223 DEFINE_TRACE(AXNodeObject) {
3224 visitor->Trace(node_); 3224 visitor->Trace(node_);
3225 AXObject::Trace(visitor); 3225 AXObject::Trace(visitor);
3226 } 3226 }
3227 3227
3228 } // namespace blink 3228 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698