|
Lines 178-184
NSString *WebPageCacheDocumentViewKey =
./WebView.subproj/WebFrame.m_sec1
|
| 178 |
|
178 |
|
| 179 |
- (void)_saveScrollPositionToItem:(WebHistoryItem *)item; |
179 |
- (void)_saveScrollPositionToItem:(WebHistoryItem *)item; |
| 180 |
- (void)_restoreScrollPosition; |
180 |
- (void)_restoreScrollPosition; |
| 181 |
- (void)_scrollToTop; |
|
|
| 182 |
|
181 |
|
| 183 |
- (WebHistoryItem *)_createItem: (BOOL)useOriginal; |
182 |
- (WebHistoryItem *)_createItem: (BOOL)useOriginal; |
| 184 |
- (WebHistoryItem *)_createItemTreeWithTargetFrame:(WebFrame *)targetFrame clippedAtTarget:(BOOL)doClip; |
183 |
- (WebHistoryItem *)_createItemTreeWithTargetFrame:(WebFrame *)targetFrame clippedAtTarget:(BOOL)doClip; |
|
Lines 794-803
NSString *WebPageCacheDocumentViewKey =
./WebView.subproj/WebFrame.m_sec2
|
| 794 |
} |
793 |
} |
| 795 |
else |
794 |
else |
| 796 |
[self _makeDocumentView]; |
795 |
[self _makeDocumentView]; |
| 797 |
|
|
|
| 798 |
// FIXME - I'm not sure this call does anything. Should be dealt with as |
| 799 |
// part of 3024377 |
| 800 |
[self _restoreScrollPosition]; |
| 801 |
} |
796 |
} |
| 802 |
break; |
797 |
break; |
| 803 |
|
798 |
|
|
Lines 1069-1076
static CFAbsoluteTime _timeOfLastComplet
./WebView.subproj/WebFrame.m_sec3
|
| 1069 |
} |
1064 |
} |
| 1070 |
[view setNeedsLayout: YES]; |
1065 |
[view setNeedsLayout: YES]; |
| 1071 |
[view layout]; |
1066 |
[view layout]; |
| 1072 |
[self _restoreScrollPosition]; |
1067 |
|
| 1073 |
|
|
|
| 1074 |
NSArray *responses = [[self dataSource] _responses]; |
1068 |
NSArray *responses = [[self dataSource] _responses]; |
| 1075 |
NSURLResponse *response; |
1069 |
NSURLResponse *response; |
| 1076 |
int i, count = [responses count]; |
1070 |
int i, count = [responses count]; |
|
Lines 2093-2098
static CFAbsoluteTime _timeOfLastComplet
./WebView.subproj/WebFrame.m_sec4
|
| 2093 |
} |
2087 |
} |
| 2094 |
} |
2088 |
} |
| 2095 |
|
2089 |
|
|
|
2090 |
/* |
| 2091 |
There is a race condition between the layout and load completion that affects restoring the scroll position. |
| 2092 |
We try to restore the scroll position at both the first layout and upon load completion. |
| 2093 |
|
| 2094 |
1) If first layout happens before the load completes, we want to restore the scroll position then so that the |
| 2095 |
first time we draw the page is already scrolled to the right place, instead of starting at the top and later |
| 2096 |
jumping down. It is possible that the old scroll position is past the part of the doc laid out so far, in |
| 2097 |
which case the restore silent fails and we will fix it in when we try to restore on doc completion. |
| 2098 |
2) If the layout happens after the load completes, the attempt to restore at load completion time silently |
| 2099 |
fails. We then successfully restore it when the layout happens. |
| 2100 |
*/ |
| 2101 |
|
| 2096 |
- (void)_restoreScrollPosition |
2102 |
- (void)_restoreScrollPosition |
| 2097 |
{ |
2103 |
{ |
| 2098 |
ASSERT([_private currentItem]); |
2104 |
ASSERT([_private currentItem]); |
|
Lines 2700-2705
static CFAbsoluteTime _timeOfLastComplet
./WebView.subproj/WebFrame.m_sec5
|
| 2700 |
{ |
2706 |
{ |
| 2701 |
[[self _bridge] unmarkAllMisspellings]; |
2707 |
[[self _bridge] unmarkAllMisspellings]; |
| 2702 |
[_private->children makeObjectsPerformSelector:@selector(_unmarkAllMisspellings)]; |
2708 |
[_private->children makeObjectsPerformSelector:@selector(_unmarkAllMisspellings)]; |
|
|
2709 |
} |
| 2710 |
|
| 2711 |
- (void)_didFirstLayout |
| 2712 |
{ |
| 2713 |
if ([[self webView] backForwardList]) { |
| 2714 |
WebFrameLoadType loadType = [self _loadType]; |
| 2715 |
if (loadType == WebFrameLoadTypeForward || |
| 2716 |
loadType == WebFrameLoadTypeBack || |
| 2717 |
loadType == WebFrameLoadTypeIndexedBackForward) |
| 2718 |
{ |
| 2719 |
[self _restoreScrollPosition]; |
| 2720 |
} |
| 2721 |
} |
| 2703 |
} |
2722 |
} |
| 2704 |
|
2723 |
|
| 2705 |
@end |
2724 |
@end |