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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp

Issue 2168663002: Bypass cached element rects in AXLayoutObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add link to bug Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 AXLayoutObject::~AXLayoutObject() 195 AXLayoutObject::~AXLayoutObject()
196 { 196 {
197 ASSERT(isDetached()); 197 ASSERT(isDetached());
198 } 198 }
199 199
200 LayoutRect AXLayoutObject::elementRect() const 200 LayoutRect AXLayoutObject::elementRect() const
201 { 201 {
202 if (!m_explicitElementRect.isEmpty()) 202 if (!m_explicitElementRect.isEmpty())
203 return m_explicitElementRect; 203 return m_explicitElementRect;
204 if (!m_layoutObject)
205 return LayoutRect();
206 if (!m_layoutObject->isBox())
207 return computeElementRect();
208 204
209 for (const AXObject* obj = this; obj; obj = obj->parentObject()) { 205 // FIXME(dmazzoni): use relative bounds instead since this is a bottleneck.
210 if (obj->isAXLayoutObject()) 206 // http://crbug.com/618120
211 toAXLayoutObject(obj)->checkCachedElementRect(); 207 return computeElementRect();
212 }
213 for (const AXObject* obj = this; obj; obj = obj->parentObject()) {
214 if (obj->isAXLayoutObject())
215 toAXLayoutObject(obj)->updateCachedElementRect();
216 }
217
218 return m_cachedElementRect;
219 } 208 }
220 209
221 SkMatrix44 AXLayoutObject::transformFromLocalParentFrame() const 210 SkMatrix44 AXLayoutObject::transformFromLocalParentFrame() const
222 { 211 {
223 if (!m_layoutObject) 212 if (!m_layoutObject)
224 return SkMatrix44(); 213 return SkMatrix44();
225 LayoutView* layoutView = toLayoutView(LayoutAPIShim::layoutObjectFrom(docume ntFrameView()->layoutViewItem())); 214 LayoutView* layoutView = toLayoutView(LayoutAPIShim::layoutObjectFrom(docume ntFrameView()->layoutViewItem()));
226 215
227 FrameView* parentFrameView = documentFrameView()->parentFrameView(); 216 FrameView* parentFrameView = documentFrameView()->parentFrameView();
228 if (!parentFrameView) 217 if (!parentFrameView)
(...skipping 2350 matching lines...) Expand 10 before | Expand all | Expand 10 after
2579 result.unite(labelRect); 2568 result.unite(labelRect);
2580 } 2569 }
2581 } 2570 }
2582 } 2571 }
2583 } 2572 }
2584 2573
2585 return result; 2574 return result;
2586 } 2575 }
2587 2576
2588 } // namespace blink 2577 } // namespace blink
OLDNEW
« 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