Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(757)

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 813133004: [svg] Reset the initial view properly in SVGImage. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase + add comment Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 { 1411 {
1412 setScrollbarsSuppressed(false); 1412 setScrollbarsSuppressed(false);
1413 } 1413 }
1414 1414
1415 bool FrameView::scrollToFragment(const KURL& url) 1415 bool FrameView::scrollToFragment(const KURL& url)
1416 { 1416 {
1417 // If our URL has no ref, then we have no place we need to jump to. 1417 // If our URL has no ref, then we have no place we need to jump to.
1418 // OTOH If CSS target was set previously, we want to set it to 0, recalc 1418 // OTOH If CSS target was set previously, we want to set it to 0, recalc
1419 // and possibly paint invalidation because :target pseudo class may have bee n 1419 // and possibly paint invalidation because :target pseudo class may have bee n
1420 // set (see bug 11321). 1420 // set (see bug 11321).
1421 if (!url.hasFragmentIdentifier() && !m_frame->document()->cssTarget()) 1421 // Similarly for svg, if we had a previous svgView() then we need to reset
1422 // the initial view if we don't have a fragment.
1423 if (!url.hasFragmentIdentifier() && !m_frame->document()->cssTarget() && !m_ frame->document()->isSVGDocument())
1422 return false; 1424 return false;
1423 1425
1424 String fragmentIdentifier = url.fragmentIdentifier(); 1426 String fragmentIdentifier = url.fragmentIdentifier();
1425 if (scrollToAnchor(fragmentIdentifier)) 1427 if (scrollToAnchor(fragmentIdentifier))
1426 return true; 1428 return true;
1427 1429
1428 // Try again after decoding the ref, based on the document's encoding. 1430 // Try again after decoding the ref, based on the document's encoding.
1429 if (m_frame->document()->encoding().isValid()) 1431 if (m_frame->document()->encoding().isValid())
1430 return scrollToAnchor(decodeURLEscapeSequences(fragmentIdentifier, m_fra me->document()->encoding())); 1432 return scrollToAnchor(decodeURLEscapeSequences(fragmentIdentifier, m_fra me->document()->encoding()));
1431 1433
(...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after
4019 return; 4021 return;
4020 4022
4021 ScrollableArea::setScrollOrigin(origin); 4023 ScrollableArea::setScrollOrigin(origin);
4022 4024
4023 // Update if the scroll origin changes, since our position will be different if the content size did not change. 4025 // Update if the scroll origin changes, since our position will be different if the content size did not change.
4024 if (updatePositionAtAll && updatePositionSynchronously) 4026 if (updatePositionAtAll && updatePositionSynchronously)
4025 updateScrollbars(scrollOffsetDouble()); 4027 updateScrollbars(scrollOffsetDouble());
4026 } 4028 }
4027 4029
4028 } // namespace blink 4030 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/svg/as-image/svgview-references-expected.html ('k') | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698