Simplify and add caching for accessible bounding box calculation.

There were several mostly-redundant methods to compute the
bounding box rect of an accessible object. Simplified those all
to just one, elementRect(), which returns the absolute-coordinate
bounding box of the object in frame coordinates.

Adds a system to cache the rect so that the computation of the
absolute coordinates is really fast when it hasn't moved.
Relies on the fact that a RenderBox has a frameRect in local
coordinates that can be accessed directly; no computation is
needed.

Each AccessibleRenderObject caches its element rect and frame
rect lazily, along with a flag indicating if they're dirty.
If the frame rect changes, it invalidates all of its
children (marks them as dirty). When querying the (global) element
rect, it checks all of its parents - if none of them are dirty,
it can use the cached element rect.

I believe that the runtime to recompute the bounding rect of
every element in the tree is O(n * d), where d is the depth.
This is fine, lots of other accessibility code also requires a
quick walk up the parent chain; there's no easy way around this.

Perhaps we should rename elementRect and frameRect while we're
at it? How about elementRect -> absoluteRect and frameRect ->
localRect?

BUG=222636

Review URL: https://chromiumcodereview.appspot.com/14740025

git-svn-id: svn://svn.chromium.org/blink/trunk@149754 bbb929c8-8fbe-4397-9dbb-9b2b20218538
9 files changed