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 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1421 m_cachedElementRectDirty = false; | 1421 m_cachedElementRectDirty = false; |
1422 } | 1422 } |
1423 | 1423 |
1424 void AXLayoutObject::markCachedElementRectDirty() const | 1424 void AXLayoutObject::markCachedElementRectDirty() const |
1425 { | 1425 { |
1426 if (m_cachedElementRectDirty) | 1426 if (m_cachedElementRectDirty) |
1427 return; | 1427 return; |
1428 | 1428 |
1429 // Marks children recursively, if this element changed. | 1429 // Marks children recursively, if this element changed. |
1430 m_cachedElementRectDirty = true; | 1430 m_cachedElementRectDirty = true; |
1431 for (AXObject* child = rawFirstChild(); child; child = child->rawFirstSiblin
g()) | 1431 for (AXObject* child = rawFirstChild(); child; child = child->rawNextSibling
()) |
1432 child->markCachedElementRectDirty(); | 1432 child->markCachedElementRectDirty(); |
1433 } | 1433 } |
1434 | 1434 |
1435 IntPoint AXLayoutObject::clickPoint() | 1435 IntPoint AXLayoutObject::clickPoint() |
1436 { | 1436 { |
1437 // Headings are usually much wider than their textual content. If the mid po
int is used, often it can be wrong. | 1437 // Headings are usually much wider than their textual content. If the mid po
int is used, often it can be wrong. |
1438 if (isHeading() && children().size() == 1) | 1438 if (isHeading() && children().size() == 1) |
1439 return children()[0]->clickPoint(); | 1439 return children()[0]->clickPoint(); |
1440 | 1440 |
1441 // use the default position unless this is an editable web area, in which ca
se we use the selection bounds. | 1441 // use the default position unless this is an editable web area, in which ca
se we use the selection bounds. |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1573 return 0; | 1573 return 0; |
1574 | 1574 |
1575 LayoutObject* firstChild = firstChildConsideringContinuation(m_layoutObject)
; | 1575 LayoutObject* firstChild = firstChildConsideringContinuation(m_layoutObject)
; |
1576 | 1576 |
1577 if (!firstChild) | 1577 if (!firstChild) |
1578 return 0; | 1578 return 0; |
1579 | 1579 |
1580 return axObjectCache().getOrCreate(firstChild); | 1580 return axObjectCache().getOrCreate(firstChild); |
1581 } | 1581 } |
1582 | 1582 |
1583 AXObject* AXLayoutObject::rawFirstSibling() const | 1583 AXObject* AXLayoutObject::rawNextSibling() const |
1584 { | 1584 { |
1585 if (!m_layoutObject) | 1585 if (!m_layoutObject) |
1586 return 0; | 1586 return 0; |
1587 | 1587 |
1588 LayoutObject* nextSibling = 0; | 1588 LayoutObject* nextSibling = 0; |
1589 | 1589 |
1590 LayoutInline* inlineContinuation = m_layoutObject->isLayoutBlock() ? toLayou
tBlock(m_layoutObject)->inlineElementContinuation() : 0; | 1590 LayoutInline* inlineContinuation = m_layoutObject->isLayoutBlock() ? toLayou
tBlock(m_layoutObject)->inlineElementContinuation() : 0; |
1591 if (inlineContinuation) { | 1591 if (inlineContinuation) { |
1592 // Case 1: node is a block and has an inline continuation. Next sibling
is the inline continuation's first child. | 1592 // Case 1: node is a block and has an inline continuation. Next sibling
is the inline continuation's first child. |
1593 nextSibling = firstChildConsideringContinuation(inlineContinuation); | 1593 nextSibling = firstChildConsideringContinuation(inlineContinuation); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 ASSERT(!m_haveChildren); | 1632 ASSERT(!m_haveChildren); |
1633 | 1633 |
1634 m_haveChildren = true; | 1634 m_haveChildren = true; |
1635 | 1635 |
1636 if (!canHaveChildren()) | 1636 if (!canHaveChildren()) |
1637 return; | 1637 return; |
1638 | 1638 |
1639 HeapVector<Member<AXObject>> ownedChildren; | 1639 HeapVector<Member<AXObject>> ownedChildren; |
1640 computeAriaOwnsChildren(ownedChildren); | 1640 computeAriaOwnsChildren(ownedChildren); |
1641 | 1641 |
1642 for (AXObject* obj = rawFirstChild(); obj; obj = obj->rawFirstSibling()) { | 1642 for (AXObject* obj = rawFirstChild(); obj; obj = obj->rawNextSibling()) { |
1643 if (!axObjectCache().isAriaOwned(obj)) | 1643 if (!axObjectCache().isAriaOwned(obj)) |
1644 addChild(obj); | 1644 addChild(obj); |
1645 } | 1645 } |
1646 | 1646 |
1647 addHiddenChildren(); | 1647 addHiddenChildren(); |
1648 addAttachmentChildren(); | 1648 addAttachmentChildren(); |
1649 addPopupChildren(); | 1649 addPopupChildren(); |
1650 addImageMapChildren(); | 1650 addImageMapChildren(); |
1651 addTextFieldChildren(); | 1651 addTextFieldChildren(); |
1652 addCanvasChildren(); | 1652 addCanvasChildren(); |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2528 if (label && label->layoutObject()) { | 2528 if (label && label->layoutObject()) { |
2529 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); | 2529 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); |
2530 result.unite(labelRect); | 2530 result.unite(labelRect); |
2531 } | 2531 } |
2532 } | 2532 } |
2533 | 2533 |
2534 return result; | 2534 return result; |
2535 } | 2535 } |
2536 | 2536 |
2537 } // namespace blink | 2537 } // namespace blink |
OLD | NEW |