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

Unified Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 98913002: Avoid DCHECK failures from get_characterExtents and get_unclippedSubstrings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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: content/browser/accessibility/browser_accessibility_win.cc
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index fb4c32e7001f228af8bbbda74d27f6b12becbb04..801a2d7a965667c4db4c3958e0ab096012cb33c6 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -1932,6 +1932,9 @@ STDMETHODIMP BrowserAccessibilityWin::get_characterExtents(
if (offset < 0 || offset > static_cast<LONG>(text_str.size()))
return E_INVALIDARG;
+ if (role_ != blink::WebAXRoleStaticText)
+ return E_FAIL;
+
gfx::Rect character_bounds;
if (coordinate_type == IA2_COORDTYPE_SCREEN_RELATIVE) {
character_bounds = GetGlobalBoundsForRange(offset, 1);
@@ -2717,6 +2720,9 @@ STDMETHODIMP BrowserAccessibilityWin::get_unclippedSubstringBounds(
return E_INVALIDARG;
}
+ if (role_ != blink::WebAXRoleStaticText)
+ return E_FAIL;
+
gfx::Rect bounds = GetGlobalBoundsForRange(
start_index, end_index - start_index);
*out_x = bounds.x();
« 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