| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * (C) 2007 David Smith (catfish.man@gmail.com) | 6 * (C) 2007 David Smith (catfish.man@gmail.com) |
| 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc.
All rights reserved. |
| 8 * (C) 2007 Eric Seidel (eric@webkit.org) | 8 * (C) 2007 Eric Seidel (eric@webkit.org) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 | 854 |
| 855 double scaledLeft = view->scrollPositionDouble().x(); | 855 double scaledLeft = view->scrollPositionDouble().x(); |
| 856 double scaledTop = view->scrollPositionDouble().y(); | 856 double scaledTop = view->scrollPositionDouble().y(); |
| 857 if (scrollToOptions.hasLeft()) | 857 if (scrollToOptions.hasLeft()) |
| 858 scaledLeft = scrollToOptions.left() * frame->pageZoomFactor(); | 858 scaledLeft = scrollToOptions.left() * frame->pageZoomFactor(); |
| 859 if (scrollToOptions.hasTop()) | 859 if (scrollToOptions.hasTop()) |
| 860 scaledTop = scrollToOptions.top() * frame->pageZoomFactor(); | 860 scaledTop = scrollToOptions.top() * frame->pageZoomFactor(); |
| 861 view->setScrollPosition(DoublePoint(scaledLeft, scaledTop), scrollBehavior); | 861 view->setScrollPosition(DoublePoint(scaledLeft, scaledTop), scrollBehavior); |
| 862 } | 862 } |
| 863 | 863 |
| 864 IntRect Element::boundsInRootViewSpace() | 864 IntRect Element::boundsInViewportSpace() |
| 865 { | 865 { |
| 866 document().updateLayoutIgnorePendingStylesheets(); | 866 document().updateLayoutIgnorePendingStylesheets(); |
| 867 | 867 |
| 868 FrameView* view = document().view(); | 868 FrameView* view = document().view(); |
| 869 if (!view) | 869 if (!view) |
| 870 return IntRect(); | 870 return IntRect(); |
| 871 | 871 |
| 872 Vector<FloatQuad> quads; | 872 Vector<FloatQuad> quads; |
| 873 if (isSVGElement() && renderer()) { | 873 if (isSVGElement() && renderer()) { |
| 874 // Get the bounding rectangle from the SVG model. | 874 // Get the bounding rectangle from the SVG model. |
| 875 SVGElement* svgElement = toSVGElement(this); | 875 SVGElement* svgElement = toSVGElement(this); |
| 876 FloatRect localRect; | 876 FloatRect localRect; |
| 877 if (svgElement->getBoundingBox(localRect)) | 877 if (svgElement->getBoundingBox(localRect)) |
| 878 quads.append(renderer()->localToAbsoluteQuad(localRect)); | 878 quads.append(renderer()->localToAbsoluteQuad(localRect)); |
| 879 } else { | 879 } else { |
| 880 // Get the bounding rectangle from the box model. | 880 // Get the bounding rectangle from the box model. |
| 881 if (renderBoxModelObject()) | 881 if (renderBoxModelObject()) |
| 882 renderBoxModelObject()->absoluteQuads(quads); | 882 renderBoxModelObject()->absoluteQuads(quads); |
| 883 } | 883 } |
| 884 | 884 |
| 885 if (quads.isEmpty()) | 885 if (quads.isEmpty()) |
| 886 return IntRect(); | 886 return IntRect(); |
| 887 | 887 |
| 888 IntRect result = quads[0].enclosingBoundingBox(); | 888 IntRect result = quads[0].enclosingBoundingBox(); |
| 889 for (size_t i = 1; i < quads.size(); ++i) | 889 for (size_t i = 1; i < quads.size(); ++i) |
| 890 result.unite(quads[i].enclosingBoundingBox()); | 890 result.unite(quads[i].enclosingBoundingBox()); |
| 891 | 891 |
| 892 result = view->contentsToRootView(result); | 892 result = view->contentsToWindow(result); |
| 893 | 893 |
| 894 // FIXME: Cleanup pinch viewport coordinate translations. crbug.com/371902. | 894 // FIXME: Cleanup pinch viewport coordinate translations. crbug.com/371902. |
| 895 PinchViewport& pinchViewport = document().page()->frameHost().pinchViewport(
); | 895 PinchViewport& pinchViewport = document().page()->frameHost().pinchViewport(
); |
| 896 result = enclosingIntRect(pinchViewport.mainViewToViewportCSSPixels(result))
; | 896 result = enclosingIntRect(pinchViewport.mainViewToViewportCSSPixels(result))
; |
| 897 | 897 |
| 898 return result; | 898 return result; |
| 899 } | 899 } |
| 900 | 900 |
| 901 PassRefPtrWillBeRawPtr<ClientRectList> Element::getClientRects() | 901 PassRefPtrWillBeRawPtr<ClientRectList> Element::getClientRects() |
| 902 { | 902 { |
| (...skipping 2467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3370 { | 3370 { |
| 3371 #if ENABLE(OILPAN) | 3371 #if ENABLE(OILPAN) |
| 3372 if (hasRareData()) | 3372 if (hasRareData()) |
| 3373 visitor->trace(elementRareData()); | 3373 visitor->trace(elementRareData()); |
| 3374 visitor->trace(m_elementData); | 3374 visitor->trace(m_elementData); |
| 3375 #endif | 3375 #endif |
| 3376 ContainerNode::trace(visitor); | 3376 ContainerNode::trace(visitor); |
| 3377 } | 3377 } |
| 3378 | 3378 |
| 3379 } // namespace blink | 3379 } // namespace blink |
| OLD | NEW |