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 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1687 Element* AXLayoutObject::anchorElement() const | 1687 Element* AXLayoutObject::anchorElement() const |
1688 { | 1688 { |
1689 if (!m_layoutObject) | 1689 if (!m_layoutObject) |
1690 return 0; | 1690 return 0; |
1691 | 1691 |
1692 AXObjectCacheImpl& cache = axObjectCache(); | 1692 AXObjectCacheImpl& cache = axObjectCache(); |
1693 LayoutObject* currLayoutObject; | 1693 LayoutObject* currLayoutObject; |
1694 | 1694 |
1695 // Search up the layout tree for a LayoutObject with a DOM node. Defer to an
earlier continuation, though. | 1695 // Search up the layout tree for a LayoutObject with a DOM node. Defer to an
earlier continuation, though. |
1696 for (currLayoutObject = m_layoutObject; currLayoutObject && !currLayoutObjec
t->node(); currLayoutObject = currLayoutObject->parent()) { | 1696 for (currLayoutObject = m_layoutObject; currLayoutObject && !currLayoutObjec
t->node(); currLayoutObject = currLayoutObject->parent()) { |
1697 if (currLayoutObject->isAnonymousBlock()) { | 1697 if (currLayoutObject->isAnonymousBlock() && currLayoutObject->isLayoutBl
ockFlow()) { |
1698 LayoutObject* continuation = toLayoutBlock(currLayoutObject)->contin
uation(); | 1698 LayoutObject* continuation = toLayoutBlockFlow(currLayoutObject)->co
ntinuation(); |
1699 if (continuation) | 1699 if (continuation) |
1700 return cache.getOrCreate(continuation)->anchorElement(); | 1700 return cache.getOrCreate(continuation)->anchorElement(); |
1701 } | 1701 } |
1702 } | 1702 } |
1703 | 1703 |
1704 // bail if none found | 1704 // bail if none found |
1705 if (!currLayoutObject) | 1705 if (!currLayoutObject) |
1706 return 0; | 1706 return 0; |
1707 | 1707 |
1708 // search up the DOM tree for an anchor element | 1708 // search up the DOM tree for an anchor element |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2476 if (label && label->layoutObject()) { | 2476 if (label && label->layoutObject()) { |
2477 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); | 2477 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); |
2478 result.unite(labelRect); | 2478 result.unite(labelRect); |
2479 } | 2479 } |
2480 } | 2480 } |
2481 | 2481 |
2482 return result; | 2482 return result; |
2483 } | 2483 } |
2484 | 2484 |
2485 } // namespace blink | 2485 } // namespace blink |
OLD | NEW |