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

Unified Diff: Source/core/accessibility/AXRenderObject.cpp

Issue 216343002: Add a test that confirms there's no crash on accessing properties of AccesibilityObject at the init… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: dmazzoni's review Created 6 years, 9 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 | « LayoutTests/fast/dom/Window/resources/window-property-collector.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/accessibility/AXRenderObject.cpp
diff --git a/Source/core/accessibility/AXRenderObject.cpp b/Source/core/accessibility/AXRenderObject.cpp
index d5dc4bcbcc40179ba39e61f6bcb02007af7379c0..6e48ca3ace3b507c913c1ea51012e83ba889b2f1 100644
--- a/Source/core/accessibility/AXRenderObject.cpp
+++ b/Source/core/accessibility/AXRenderObject.cpp
@@ -797,7 +797,8 @@ String AXRenderObject::text() const
int AXRenderObject::textLength() const
{
- ASSERT(isTextControl());
+ if (!isTextControl())
+ return -1;
if (isPasswordField())
return -1; // need to return something distinct from 0
@@ -1568,7 +1569,8 @@ Widget* AXRenderObject::widgetForAttachmentView() const
AXObject::PlainTextRange AXRenderObject::selectedTextRange() const
{
- ASSERT(isTextControl());
+ if (!isTextControl())
+ return PlainTextRange();
if (isPasswordField())
return PlainTextRange();
« no previous file with comments | « LayoutTests/fast/dom/Window/resources/window-property-collector.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698