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

Unified Diff: components/test_runner/web_ax_object_proxy.cc

Issue 2297243002: Don't crash if WebAXObject::characterOffsets doesn't return any bounds. (Closed)
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/web_ax_object_proxy.cc
diff --git a/components/test_runner/web_ax_object_proxy.cc b/components/test_runner/web_ax_object_proxy.cc
index 1dbe3be923ceee7f453af8c15f00bab4d6773206..15f789487c7d6b13b80823db2f37541102071a13 100644
--- a/components/test_runner/web_ax_object_proxy.cc
+++ b/components/test_runner/web_ax_object_proxy.cc
@@ -357,8 +357,9 @@ blink::WebRect BoundsForCharacter(const blink::WebAXObject& object,
int localIndex = characterIndex - start;
blink::WebVector<int> character_offsets;
inline_text_box.characterOffsets(character_offsets);
- DCHECK(character_offsets.size() > 0 &&
- character_offsets.size() == name.length());
+ if (character_offsets.size() != name.length())
+ return blink::WebRect();
+
switch (inline_text_box.textDirection()) {
case blink::WebAXTextDirectionLR: {
if (localIndex) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698