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 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 { | 1407 { |
1408 setScrollbarsSuppressed(false); | 1408 setScrollbarsSuppressed(false); |
1409 } | 1409 } |
1410 | 1410 |
1411 bool FrameView::scrollToFragment(const KURL& url) | 1411 bool FrameView::scrollToFragment(const KURL& url) |
1412 { | 1412 { |
1413 // If our URL has no ref, then we have no place we need to jump to. | 1413 // If our URL has no ref, then we have no place we need to jump to. |
1414 // OTOH If CSS target was set previously, we want to set it to 0, recalc | 1414 // OTOH If CSS target was set previously, we want to set it to 0, recalc |
1415 // and possibly paint invalidation because :target pseudo class may have bee
n | 1415 // and possibly paint invalidation because :target pseudo class may have bee
n |
1416 // set (see bug 11321). | 1416 // set (see bug 11321). |
1417 if (!url.hasFragmentIdentifier() && !m_frame->document()->cssTarget()) | 1417 // Similarly for svg, if we had a previous svgView() then we need to reset |
| 1418 // the initial view if we don't have a fragment. |
| 1419 if (!url.hasFragmentIdentifier() && !m_frame->document()->cssTarget() && !m_
frame->document()->isSVGDocument()) |
1418 return false; | 1420 return false; |
1419 | 1421 |
1420 String fragmentIdentifier = url.fragmentIdentifier(); | 1422 String fragmentIdentifier = url.fragmentIdentifier(); |
1421 if (scrollToAnchor(fragmentIdentifier)) | 1423 if (scrollToAnchor(fragmentIdentifier)) |
1422 return true; | 1424 return true; |
1423 | 1425 |
1424 // Try again after decoding the ref, based on the document's encoding. | 1426 // Try again after decoding the ref, based on the document's encoding. |
1425 if (m_frame->document()->encoding().isValid()) | 1427 if (m_frame->document()->encoding().isValid()) |
1426 return scrollToAnchor(decodeURLEscapeSequences(fragmentIdentifier, m_fra
me->document()->encoding())); | 1428 return scrollToAnchor(decodeURLEscapeSequences(fragmentIdentifier, m_fra
me->document()->encoding())); |
1427 | 1429 |
(...skipping 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3981 return; | 3983 return; |
3982 | 3984 |
3983 ScrollableArea::setScrollOrigin(origin); | 3985 ScrollableArea::setScrollOrigin(origin); |
3984 | 3986 |
3985 // Update if the scroll origin changes, since our position will be different
if the content size did not change. | 3987 // Update if the scroll origin changes, since our position will be different
if the content size did not change. |
3986 if (updatePositionAtAll && updatePositionSynchronously) | 3988 if (updatePositionAtAll && updatePositionSynchronously) |
3987 updateScrollbars(scrollOffsetDouble()); | 3989 updateScrollbars(scrollOffsetDouble()); |
3988 } | 3990 } |
3989 | 3991 |
3990 } // namespace blink | 3992 } // namespace blink |
OLD | NEW |