Bug 45572 - WebAccessibilityCacheImpl needs to handle invalid accessibility object ids
Summary: WebAccessibilityCacheImpl needs to handle invalid accessibility object ids
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P1 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-10 16:18 PDT by Chris Guillory
Modified: 2010-09-13 16:00 PDT (History)
5 users (show)

See Also:


Attachments
Return invalidObjectID in WebAccessibilityCacheImpl when an AccessibilityObject's id is 0 (1.15 KB, patch)
2010-09-10 16:24 PDT, Chris Guillory
no flags Details | Formatted Diff | Diff
Need to ensure updateBackingStore is called (2.48 KB, patch)
2010-09-10 18:31 PDT, Chris Guillory
no flags Details | Formatted Diff | Diff
Compiles now (2.49 KB, patch)
2010-09-10 18:33 PDT, Chris Guillory
no flags Details | Formatted Diff | Diff
Logic is correct now (2.49 KB, patch)
2010-09-10 18:52 PDT, Chris Guillory
no flags Details | Formatted Diff | Diff
Passes style check now (2.49 KB, patch)
2010-09-10 19:07 PDT, Chris Guillory
cfleizach: review-
cfleizach: commit-queue-
Details | Formatted Diff | Diff
Naming new method isValid (2.88 KB, patch)
2010-09-12 23:06 PDT, Chris Guillory
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Guillory 2010-09-10 16:18:31 PDT
The Chromium renderer crashes when it accesses objects that have been removed from the webkit accessibility tree. 
http://code.google.com/p/chromium/issues/detail?id=54973

WebAccessibilityCacheImpl::addOrGetId should know that AccessibilityObject's with an id of 0 are invalid - they've been removed from the webkit accessibility tree.
Comment 1 Chris Guillory 2010-09-10 16:24:25 PDT
Created attachment 67258 [details]
Return invalidObjectID in WebAccessibilityCacheImpl when an AccessibilityObject's id is 0
Comment 2 Chris Guillory 2010-09-10 18:31:19 PDT
Created attachment 67280 [details]
Need to ensure updateBackingStore is called

Looks like updateBackingStore is where the accessibility object can become invalid.
Comment 3 Chris Guillory 2010-09-10 18:33:03 PDT
Created attachment 67281 [details]
Compiles now
Comment 4 Chris Guillory 2010-09-10 18:52:06 PDT
Created attachment 67283 [details]
Logic is correct now
Comment 5 WebKit Review Bot 2010-09-10 18:58:09 PDT
Attachment 67283 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
WebKit/chromium/src/WebAccessibilityObject.cpp:110:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Chris Guillory 2010-09-10 19:07:17 PDT
Created attachment 67285 [details]
Passes style check now
Comment 7 chris fleizach 2010-09-12 20:03:13 PDT
Comment on attachment 67285 [details]
Passes style check now

> Index: WebKit/chromium/ChangeLog
> ===================================================================
> --- WebKit/chromium/ChangeLog	(revision 67263)
> +++ WebKit/chromium/ChangeLog	(working copy)
> @@ -1,3 +1,16 @@
> +2010-09-10  Chris Guillory  <chris.guillory@google.com>
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        WebAccessibilityCacheImpl needs to handle invalid accessibility object ids

period at end of sentence
> +    WEBKIT_API bool isAxObjectIdValid() const;

since this is inside of an ax object, the method name should probably just be "isIdValid()"

>  
>      WEBKIT_API unsigned childCount() const;
>  
> +bool WebAccessibilityObject::isAxObjectIdValid() const
> +{
> +    if (!m_private)
> +        return false;
> +
> +    m_private->updateBackingStore();

after calling updateBackingStore() it's possible that m_private will be invalidated (on the WebCore side at least, where it's called m_object). 
you should probably confirm that the object is still valid after calling this method

> +    return m_private->axObjectID();
> +}
> +
Comment 8 Chris Guillory 2010-09-12 23:02:25 PDT
> after calling updateBackingStore() it's possible that m_private will be invalidated (on the WebCore side at least, where it's called m_object). 
> you should probably confirm that the object is still valid after calling this method
I'm adding this method to determine if the WebAccessibilityObject is valid. Perhaps I should just name this method isValid(). An invalid WebCore::AccessibilityObject has an ID of 0.
Comment 9 chris fleizach 2010-09-12 23:03:48 PDT
(In reply to comment #8)
> > after calling updateBackingStore() it's possible that m_private will be invalidated (on the WebCore side at least, where it's called m_object). 
> > you should probably confirm that the object is still valid after calling this method
> I'm adding this method to determine if the WebAccessibilityObject is valid. Perhaps I should just name this method isValid(). An invalid WebCore::AccessibilityObject has an ID of 0.

yea, if updateBackingStore is just checking validity, it should be renamed.
Comment 10 Chris Guillory 2010-09-12 23:06:38 PDT
Created attachment 67360 [details]
Naming new method isValid
Comment 11 chris fleizach 2010-09-13 12:15:52 PDT
Comment on attachment 67360 [details]
Naming new method isValid

r=me
Comment 12 WebKit Commit Bot 2010-09-13 16:00:40 PDT
Comment on attachment 67360 [details]
Naming new method isValid

Clearing flags on attachment: 67360

Committed r67418: <http://trac.webkit.org/changeset/67418>
Comment 13 WebKit Commit Bot 2010-09-13 16:00:45 PDT
All reviewed patches have been landed.  Closing bug.