OLD | NEW |
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 13 matching lines...) Expand all Loading... |
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #include "config.h" | 29 #include "config.h" |
30 #include "modules/accessibility/AXRenderObject.h" | 30 #include "modules/accessibility/AXRenderObject.h" |
31 | 31 |
32 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 32 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
33 #include "core/InputTypeNames.h" | 33 #include "core/InputTypeNames.h" |
| 34 #include "core/dom/AXObjectCache.h" |
34 #include "core/dom/ElementTraversal.h" | 35 #include "core/dom/ElementTraversal.h" |
35 #include "core/dom/shadow/ShadowRoot.h" | 36 #include "core/dom/shadow/ShadowRoot.h" |
36 #include "core/editing/FrameSelection.h" | 37 #include "core/editing/FrameSelection.h" |
37 #include "core/editing/RenderedPosition.h" | 38 #include "core/editing/RenderedPosition.h" |
38 #include "core/editing/TextIterator.h" | 39 #include "core/editing/TextIterator.h" |
39 #include "core/editing/VisibleUnits.h" | 40 #include "core/editing/VisibleUnits.h" |
40 #include "core/editing/htmlediting.h" | 41 #include "core/editing/htmlediting.h" |
41 #include "core/frame/LocalFrame.h" | 42 #include "core/frame/LocalFrame.h" |
42 #include "core/frame/Settings.h" | 43 #include "core/frame/Settings.h" |
43 #include "core/html/HTMLImageElement.h" | 44 #include "core/html/HTMLImageElement.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 static RenderBoxModelObject* nextContinuation(RenderObject* renderer) | 160 static RenderBoxModelObject* nextContinuation(RenderObject* renderer) |
160 { | 161 { |
161 ASSERT(renderer); | 162 ASSERT(renderer); |
162 if (renderer->isRenderInline() && !renderer->isReplaced()) | 163 if (renderer->isRenderInline() && !renderer->isReplaced()) |
163 return toRenderInline(renderer)->continuation(); | 164 return toRenderInline(renderer)->continuation(); |
164 if (renderer->isRenderBlock()) | 165 if (renderer->isRenderBlock()) |
165 return toRenderBlock(renderer)->inlineElementContinuation(); | 166 return toRenderBlock(renderer)->inlineElementContinuation(); |
166 return 0; | 167 return 0; |
167 } | 168 } |
168 | 169 |
169 AXRenderObject::AXRenderObject(RenderObject* renderer) | 170 AXRenderObject::AXRenderObject(RenderObject* renderer, AXObjectCache* axObjectCa
che) |
170 : AXNodeObject(renderer->node()) | 171 : AXNodeObject(renderer->node(), axObjectCache) |
171 , m_renderer(renderer) | 172 , m_renderer(renderer) |
172 , m_cachedElementRectDirty(true) | 173 , m_cachedElementRectDirty(true) |
173 { | 174 { |
174 #if ENABLE(ASSERT) | 175 #if ENABLE(ASSERT) |
175 m_renderer->setHasAXObject(true); | 176 m_renderer->setHasAXObject(true); |
176 #endif | 177 #endif |
177 } | 178 } |
178 | 179 |
179 PassRefPtr<AXRenderObject> AXRenderObject::create(RenderObject* renderer) | 180 PassRefPtr<AXRenderObject> AXRenderObject::create(RenderObject* renderer, AXObje
ctCache* axObjectCache) |
180 { | 181 { |
181 return adoptRef(new AXRenderObject(renderer)); | 182 return adoptRef(new AXRenderObject(renderer, axObjectCache)); |
182 } | 183 } |
183 | 184 |
184 AXRenderObject::~AXRenderObject() | 185 AXRenderObject::~AXRenderObject() |
185 { | 186 { |
186 ASSERT(isDetached()); | 187 ASSERT(isDetached()); |
187 } | 188 } |
188 | 189 |
189 LayoutRect AXRenderObject::elementRect() const | 190 LayoutRect AXRenderObject::elementRect() const |
190 { | 191 { |
191 if (!m_explicitElementRect.isEmpty()) | 192 if (!m_explicitElementRect.isEmpty()) |
(...skipping 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2397 if (label && label->renderer()) { | 2398 if (label && label->renderer()) { |
2398 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); | 2399 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); |
2399 result.unite(labelRect); | 2400 result.unite(labelRect); |
2400 } | 2401 } |
2401 } | 2402 } |
2402 | 2403 |
2403 return result; | 2404 return result; |
2404 } | 2405 } |
2405 | 2406 |
2406 } // namespace blink | 2407 } // namespace blink |
OLD | NEW |