| 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 2591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2602 // We should also use absoluteQuads for SVG elements, otherwise transforms w
on't be applied. | 2602 // We should also use absoluteQuads for SVG elements, otherwise transforms w
on't be applied. |
| 2603 | 2603 |
| 2604 LayoutRect result; | 2604 LayoutRect result; |
| 2605 if (obj->isText()) { | 2605 if (obj->isText()) { |
| 2606 Vector<FloatQuad> quads; | 2606 Vector<FloatQuad> quads; |
| 2607 toLayoutText(obj)->absoluteQuads(quads, 0, LayoutText::ClipToEllipsis); | 2607 toLayoutText(obj)->absoluteQuads(quads, 0, LayoutText::ClipToEllipsis); |
| 2608 result = LayoutRect(boundingBoxForQuads(obj, quads)); | 2608 result = LayoutRect(boundingBoxForQuads(obj, quads)); |
| 2609 } else if (isWebArea() || obj->isSVGRoot()) { | 2609 } else if (isWebArea() || obj->isSVGRoot()) { |
| 2610 result = LayoutRect(obj->absoluteBoundingBoxRect()); | 2610 result = LayoutRect(obj->absoluteBoundingBoxRect()); |
| 2611 } else { | 2611 } else { |
| 2612 result = LayoutRect(obj->absoluteFocusRingBoundingBoxRect()); | 2612 result = LayoutRect(obj->absoluteOutlineBoundingBoxRect()); |
| 2613 } | 2613 } |
| 2614 | 2614 |
| 2615 Document* document = this->document(); | 2615 Document* document = this->document(); |
| 2616 if (document && document->isSVGDocument()) | 2616 if (document && document->isSVGDocument()) |
| 2617 offsetBoundingBoxForRemoteSVGElement(result); | 2617 offsetBoundingBoxForRemoteSVGElement(result); |
| 2618 if (document && document->frame() && document->frame()->pagePopupOwner()) { | 2618 if (document && document->frame() && document->frame()->pagePopupOwner()) { |
| 2619 IntPoint popupOrigin = document->view()->contentsToScreen(IntRect()).loc
ation(); | 2619 IntPoint popupOrigin = document->view()->contentsToScreen(IntRect()).loc
ation(); |
| 2620 IntPoint mainOrigin = axObjectCache().rootObject()->documentFrameView()-
>contentsToScreen(IntRect()).location(); | 2620 IntPoint mainOrigin = axObjectCache().rootObject()->documentFrameView()-
>contentsToScreen(IntRect()).location(); |
| 2621 result.moveBy(IntPoint(popupOrigin - mainOrigin)); | 2621 result.moveBy(IntPoint(popupOrigin - mainOrigin)); |
| 2622 } | 2622 } |
| 2623 | 2623 |
| 2624 // The size of the web area should be the content size, not the clipped size
. | 2624 // The size of the web area should be the content size, not the clipped size
. |
| 2625 if (isWebArea() && obj->frame()->view()) | 2625 if (isWebArea() && obj->frame()->view()) |
| 2626 result.setSize(LayoutSize(obj->frame()->view()->contentsSize())); | 2626 result.setSize(LayoutSize(obj->frame()->view()->contentsSize())); |
| 2627 | 2627 |
| 2628 // Checkboxes and radio buttons include their label as part of their rect. | 2628 // Checkboxes and radio buttons include their label as part of their rect. |
| 2629 if (isCheckboxOrRadio()) { | 2629 if (isCheckboxOrRadio()) { |
| 2630 HTMLLabelElement* label = labelForElement(toElement(m_layoutObject->node
())); | 2630 HTMLLabelElement* label = labelForElement(toElement(m_layoutObject->node
())); |
| 2631 if (label && label->layoutObject()) { | 2631 if (label && label->layoutObject()) { |
| 2632 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); | 2632 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); |
| 2633 result.unite(labelRect); | 2633 result.unite(labelRect); |
| 2634 } | 2634 } |
| 2635 } | 2635 } |
| 2636 | 2636 |
| 2637 return result; | 2637 return result; |
| 2638 } | 2638 } |
| 2639 | 2639 |
| 2640 } // namespace blink | 2640 } // namespace blink |
| OLD | NEW |