OLD | NEW |
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 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 if (HTMLFormElement* form = associatedFormElement(*element)) | 1744 if (HTMLFormElement* form = associatedFormElement(*element)) |
1745 return form; | 1745 return form; |
1746 } | 1746 } |
1747 | 1747 |
1748 // Try walking forward in the node tree to find a form element. | 1748 // Try walking forward in the node tree to find a form element. |
1749 return scanForForm(start); | 1749 return scanForForm(start); |
1750 } | 1750 } |
1751 | 1751 |
1752 void FrameSelection::revealSelection(const ScrollAlignment& alignment, RevealExt
entOption revealExtentOption) | 1752 void FrameSelection::revealSelection(const ScrollAlignment& alignment, RevealExt
entOption revealExtentOption) |
1753 { | 1753 { |
| 1754 bool isLoading = !m_frame->document()->loadEventFinished(); |
| 1755 HistoryItem* currentItem = m_frame->loader().currentItem(); |
| 1756 FrameView* view = m_frame->view(); |
| 1757 |
| 1758 // Ignore scrolling to the focused element if the page already scrolled to s
tored scroll position in history while page is loading. |
| 1759 if (view && isLoading && currentItem && !view->wasScrolledByUser() && curren
tItem->scrollPoint() != IntPoint::zero() && currentItem->scrollPoint() == view->
scrollPosition()) |
| 1760 return; |
| 1761 |
1754 LayoutRect rect; | 1762 LayoutRect rect; |
1755 | 1763 |
1756 switch (selectionType()) { | 1764 switch (selectionType()) { |
1757 case NoSelection: | 1765 case NoSelection: |
1758 return; | 1766 return; |
1759 case CaretSelection: | 1767 case CaretSelection: |
1760 rect = absoluteCaretBounds(); | 1768 rect = absoluteCaretBounds(); |
1761 break; | 1769 break; |
1762 case RangeSelection: | 1770 case RangeSelection: |
1763 rect = revealExtentOption == RevealExtent ? VisiblePosition(extent()).ab
soluteCaretBounds() : enclosingIntRect(unclippedBounds()); | 1771 rect = revealExtentOption == RevealExtent ? VisiblePosition(extent()).ab
soluteCaretBounds() : enclosingIntRect(unclippedBounds()); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 sel.showTreeForThis(); | 1929 sel.showTreeForThis(); |
1922 } | 1930 } |
1923 | 1931 |
1924 void showTree(const blink::FrameSelection* sel) | 1932 void showTree(const blink::FrameSelection* sel) |
1925 { | 1933 { |
1926 if (sel) | 1934 if (sel) |
1927 sel->showTreeForThis(); | 1935 sel->showTreeForThis(); |
1928 } | 1936 } |
1929 | 1937 |
1930 #endif | 1938 #endif |
OLD | NEW |