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

Side by Side Diff: Source/core/editing/FrameSelection.cpp

Issue 914573004: Discard scrolling to the saved scroll points if there is any selection done by user. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 5 years, 8 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
« no previous file with comments | « LayoutTests/editing/input/reveal-selection-having-stored-scroll-position-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1763 rect = LayoutRect(revealExtentOption == RevealExtent ? VisiblePosition(e xtent()).absoluteCaretBounds() : enclosingIntRect(unclippedBounds())); 1763 rect = LayoutRect(revealExtentOption == RevealExtent ? VisiblePosition(e xtent()).absoluteCaretBounds() : enclosingIntRect(unclippedBounds()));
1764 break; 1764 break;
1765 } 1765 }
1766 1766
1767 Position start = this->start(); 1767 Position start = this->start();
1768 ASSERT(start.deprecatedNode()); 1768 ASSERT(start.deprecatedNode());
1769 if (start.deprecatedNode() && start.deprecatedNode()->layoutObject()) { 1769 if (start.deprecatedNode() && start.deprecatedNode()->layoutObject()) {
1770 // FIXME: This code only handles scrolling the startContainer's layer, b ut 1770 // FIXME: This code only handles scrolling the startContainer's layer, b ut
1771 // the selection rect could intersect more than just that. 1771 // the selection rect could intersect more than just that.
1772 // See <rdar://problem/4799899>. 1772 // See <rdar://problem/4799899>.
1773 m_frame->view()->setWasScrolledByUser(true);
1773 if (start.deprecatedNode()->layoutObject()->scrollRectToVisible(rect, al ignment, alignment)) 1774 if (start.deprecatedNode()->layoutObject()->scrollRectToVisible(rect, al ignment, alignment))
1774 updateAppearance(); 1775 updateAppearance();
1775 } 1776 }
1776 } 1777 }
1777 1778
1778 void FrameSelection::setSelectionFromNone() 1779 void FrameSelection::setSelectionFromNone()
1779 { 1780 {
1780 // Put a caret inside the body if the entire frame is editable (either the 1781 // Put a caret inside the body if the entire frame is editable (either the
1781 // entire WebView is editable or designMode is on for this document). 1782 // entire WebView is editable or designMode is on for this document).
1782 1783
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1949 sel.showTreeForThis(); 1950 sel.showTreeForThis();
1950 } 1951 }
1951 1952
1952 void showTree(const blink::FrameSelection* sel) 1953 void showTree(const blink::FrameSelection* sel)
1953 { 1954 {
1954 if (sel) 1955 if (sel)
1955 sel->showTreeForThis(); 1956 sel->showTreeForThis();
1956 } 1957 }
1957 1958
1958 #endif 1959 #endif
OLDNEW
« no previous file with comments | « LayoutTests/editing/input/reveal-selection-having-stored-scroll-position-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698