OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1961 if (!anchorNode) | 1961 if (!anchorNode) |
1962 return; | 1962 return; |
1963 | 1963 |
1964 if (!anchorNode->renderer()) | 1964 if (!anchorNode->renderer()) |
1965 return; | 1965 return; |
1966 | 1966 |
1967 LayoutRect rect; | 1967 LayoutRect rect; |
1968 if (anchorNode != m_frame->document()) | 1968 if (anchorNode != m_frame->document()) |
1969 rect = anchorNode->boundingBox(); | 1969 rect = anchorNode->boundingBox(); |
1970 | 1970 |
1971 RefPtrWillBeRawPtr<LocalFrame> boundaryFrame = m_frame->document()->findUnsa
feParentScrollPropagationBoundary(); | 1971 RefPtrWillBeRawPtr<Frame> boundaryFrame = m_frame->findUnsafeParentScrollPro
pagationBoundary(); |
1972 | 1972 |
1973 if (boundaryFrame) | 1973 // FIXME: Handle RemoteFrames |
1974 boundaryFrame->view()->setSafeToPropagateScrollToParent(false); | 1974 if (boundaryFrame && boundaryFrame->isLocalFrame()) |
| 1975 toLocalFrame(boundaryFrame.get())->view()->setSafeToPropagateScrollToPar
ent(false); |
1975 | 1976 |
1976 // Scroll nested layers and frames to reveal the anchor. | 1977 // Scroll nested layers and frames to reveal the anchor. |
1977 // Align to the top and to the closest side (this matches other browsers). | 1978 // Align to the top and to the closest side (this matches other browsers). |
1978 anchorNode->renderer()->scrollRectToVisible(rect, ScrollAlignment::alignToEd
geIfNeeded, ScrollAlignment::alignTopAlways); | 1979 anchorNode->renderer()->scrollRectToVisible(rect, ScrollAlignment::alignToEd
geIfNeeded, ScrollAlignment::alignTopAlways); |
1979 | 1980 |
1980 if (boundaryFrame) | 1981 if (boundaryFrame && boundaryFrame->isLocalFrame()) |
1981 boundaryFrame->view()->setSafeToPropagateScrollToParent(true); | 1982 toLocalFrame(boundaryFrame.get())->view()->setSafeToPropagateScrollToPar
ent(true); |
1982 | 1983 |
1983 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) | 1984 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) |
1984 cache->handleScrolledToAnchor(anchorNode.get()); | 1985 cache->handleScrolledToAnchor(anchorNode.get()); |
1985 | 1986 |
1986 // scrollRectToVisible can call into setScrollPosition(), which resets m_mai
ntainScrollPositionAnchor. | 1987 // scrollRectToVisible can call into setScrollPosition(), which resets m_mai
ntainScrollPositionAnchor. |
1987 m_maintainScrollPositionAnchor = anchorNode; | 1988 m_maintainScrollPositionAnchor = anchorNode; |
1988 } | 1989 } |
1989 | 1990 |
1990 bool FrameView::updateWidgets() | 1991 bool FrameView::updateWidgets() |
1991 { | 1992 { |
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4007 return; | 4008 return; |
4008 | 4009 |
4009 ScrollableArea::setScrollOrigin(origin); | 4010 ScrollableArea::setScrollOrigin(origin); |
4010 | 4011 |
4011 // Update if the scroll origin changes, since our position will be different
if the content size did not change. | 4012 // Update if the scroll origin changes, since our position will be different
if the content size did not change. |
4012 if (updatePositionAtAll && updatePositionSynchronously) | 4013 if (updatePositionAtAll && updatePositionSynchronously) |
4013 updateScrollbars(scrollOffsetDouble()); | 4014 updateScrollbars(scrollOffsetDouble()); |
4014 } | 4015 } |
4015 | 4016 |
4016 } // namespace blink | 4017 } // namespace blink |
OLD | NEW |