Chromium Code Reviews| Index: Source/core/accessibility/AXNodeObject.cpp |
| diff --git a/Source/core/accessibility/AXNodeObject.cpp b/Source/core/accessibility/AXNodeObject.cpp |
| index 6410e9cafdbb12241ee581154b6f6e2862e2affa..a660c567575d811404203fe6185ffd529634e7a9 100644 |
| --- a/Source/core/accessibility/AXNodeObject.cpp |
| +++ b/Source/core/accessibility/AXNodeObject.cpp |
| @@ -1247,6 +1247,23 @@ LayoutRect AXNodeObject::elementRect() const |
| if (!m_explicitElementRect.isEmpty()) |
| return m_explicitElementRect; |
| + if (node()->parentElement()->isInCanvasSubtree()) { |
|
dmazzoni
2014/06/09 07:27:26
OK for now, but add a FIXME indicating that this i
zino
2014/06/10 10:09:34
Done.
|
| + LayoutRect rect; |
| + |
| + for (Node* child = node()->firstChild(); child; child = child->nextSibling()) { |
| + if (child->isHTMLElement()) { |
| + if (AXObject* obj = axObjectCache()->get(child)) { |
| + if (rect.isEmpty()) |
| + rect = obj->elementRect(); |
| + else |
| + rect.unite(obj->elementRect()); |
| + } |
| + } |
| + } |
| + |
| + return rect; |
|
dmazzoni
2014/06/09 07:27:26
If the resulting rect is still empty, fall through
zino
2014/06/10 10:09:34
Done.
|
| + } |
| + |
| // AXNodeObjects have no mechanism yet to return a size or position. |
|
dmazzoni
2014/06/09 07:27:26
Delete this first bit of the comment and change it
zino
2014/06/10 10:09:34
Done.
|
| // For now, let's return the position of the ancestor that does have a position, |
| // and make it the width of that parent, and about the height of a line of text, so that it's clear the object is a child of the parent. |