Changeset 14669 in webkit
- Timestamp:
- Jun 1, 2006 2:29:31 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r14667 r14669 1 2006-06-01 Anders Carlsson <acarlsson@apple.com> 2 3 Reviewed by Darin. 4 5 http://bugzilla.opendarwin.org/show_bug.cgi?id=6309 6 multiple problems prevent bookmarking/back button technique for AJAX/DHTML applications from working 7 8 * fast/dom/location-hash-expected.txt: Added. 9 * fast/dom/location-hash.html: Added. 10 Added tests. 11 1 12 2006-06-01 Maciej Stachowiak <mjs@apple.com> 2 13 -
trunk/WebCore/ChangeLog
r14668 r14669 1 2006-06-01 Anders Carlsson <acarlsson@apple.com> 2 3 Reviewed by Darin. 4 5 http://bugzilla.opendarwin.org/show_bug.cgi?id=6309 6 multiple problems prevent bookmarking/back button technique for AJAX/DHTML applications from working 7 8 * bindings/js/kjs_window.cpp: 9 (KJS::Location::put): 10 Handle the case where the hash starts with a "#". Also, don't do anything if the previous and new hashes 11 are equal. 12 13 * bridge/BrowserExtension.h: 14 * bridge/mac/BrowserExtensionMac.h: 15 * bridge/mac/BrowserExtensionMac.mm: 16 (WebCore::BrowserExtensionMac::historyURL): 17 * bridge/mac/WebCoreFrameBridge.h: 18 * bridge/mac/WebCoreFrameBridge.mm: 19 New function historyURL which returns the complete URL for a given item in the history. 20 21 * page/Frame.cpp: 22 (WebCore::Frame::scheduleLocationChange): 23 (WebCore::Frame::scheduleHistoryNavigation): 24 If the URL of the new location only differs in the hash, don't schedule the load. Instead, load it 25 directly. 26 27 * platform/KURL.cpp: 28 * platform/KURL.h: 29 Add equalsIgnoringRef which returns whether two URLs are equal, ignoring the ref. 30 1 31 2006-06-01 Anders Carlsson <acarlsson@apple.com> 2 32 -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r14646 r14669 1515 1515 FAE04190097596C9000540BE /* SVGImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = FAE0418E097596C9000540BE /* SVGImageLoader.h */; }; 1516 1516 /* End PBXBuildFile section */ 1517 1518 /* Begin PBXBuildStyle section */1519 DB14676D0A237ECE00C9DD16 /* Development */ = {1520 isa = PBXBuildStyle;1521 buildSettings = {1522 COPY_PHASE_STRIP = NO;1523 };1524 name = Development;1525 };1526 DB14676E0A237ECE00C9DD16 /* Deployment */ = {1527 isa = PBXBuildStyle;1528 buildSettings = {1529 COPY_PHASE_STRIP = YES;1530 };1531 name = Deployment;1532 };1533 /* End PBXBuildStyle section */1534 1517 1535 1518 /* Begin PBXContainerItemProxy section */ … … 6187 6170 isa = PBXProject; 6188 6171 buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */; 6189 buildSettings = {6190 };6191 buildStyles = (6192 DB14676D0A237ECE00C9DD16 /* Development */,6193 DB14676E0A237ECE00C9DD16 /* Deployment */,6194 );6195 6172 hasScannedForEncodings = 1; 6196 6173 knownRegions = ( -
trunk/WebCore/bindings/js/kjs_window.cpp
r14651 r14669 2108 2108 break; 2109 2109 } 2110 case Hash: 2110 case Hash: { 2111 if (str.startsWith("#")) 2112 str = str.mid(1); 2113 2114 if (url.ref() == str) 2115 return; 2116 2111 2117 url.setRef(str); 2112 2118 break; 2119 } 2113 2120 case Host: { 2114 2121 DeprecatedString host = str.left(str.find(":")); -
trunk/WebCore/bridge/BrowserExtension.h
r14643 r14669 66 66 virtual int getHistoryLength() = 0; 67 67 virtual void goBackOrForward(int distance) = 0; 68 68 virtual KURL historyURL(int distance) = 0; 69 69 70 virtual bool canRunModal() = 0; 70 71 virtual bool canRunModalNow() = 0; -
trunk/WebCore/bridge/mac/BrowserExtensionMac.h
r13440 r14669 45 45 virtual int getHistoryLength(); 46 46 virtual void goBackOrForward(int distance); 47 virtual KURL historyURL(int distance); 47 48 48 49 virtual bool canRunModal(); -
trunk/WebCore/bridge/mac/BrowserExtensionMac.mm
r14651 r14669 166 166 } 167 167 168 KURL BrowserExtensionMac::historyURL(int distance) 169 { 170 BEGIN_BLOCK_OBJC_EXCEPTIONS; 171 return KURL([m_frame->bridge() historyURL:distance]); 172 END_BLOCK_OBJC_EXCEPTIONS; 173 return KURL(); 174 } 175 168 176 bool BrowserExtensionMac::canRunModal() 169 177 { -
trunk/WebCore/bridge/mac/WebCoreFrameBridge.h
r14651 r14669 254 254 - (void)removeFromFrame; 255 255 256 - (void)scrollToAnchor:(NSString *)anchor;257 256 - (void)scrollToAnchorWithURL:(NSURL *)URL; 258 257 … … 618 617 - (void)goBackOrForward:(int)distance; 619 618 - (BOOL)canGoBackOrForward:(int)distance; 619 - (NSURL *)historyURL:(int)distance; 620 620 621 621 - (void)textFieldDidBeginEditing:(DOMHTMLInputElement *)element; -
trunk/WebCore/bridge/mac/WebCoreFrameBridge.mm
r14643 r14669 737 737 } 738 738 739 - (void)scrollToAnchor:(NSString *)anchor740 {741 m_frame->gotoAnchor(anchor);742 }743 744 739 - (BOOL)isSelectionEditable 745 740 { -
trunk/WebCore/page/Frame.cpp
r14658 r14669 899 899 void Frame::scheduleLocationChange(const DeprecatedString& url, const DeprecatedString& referrer, bool lockHistory, bool userGesture) 900 900 { 901 KURL u(url); 902 903 // If the URL we're going to navigate to is the same as the current one, except for the 904 // fragment part, we don't need to schedule the location change. 905 if (u.hasRef() && equalIgnoringRef(d->m_url, u)) { 906 changeLocation(url, referrer, lockHistory, userGesture); 907 return; 908 } 909 901 910 // Handle a location change of a page with no document as a special case. 902 911 // This may happen when a frame changes the location of another frame. … … 909 918 stopLoading(true); 910 919 } 911 920 912 921 d->m_delayRedirect = 0; 913 922 d->m_redirectURL = url; … … 943 952 } 944 953 954 // If the URL we're going to navigate to is the same as the current one, except for the 955 // fragment part, we don't need to schedule the navigation. 956 if (d->m_extension) { 957 KURL u = d->m_extension->historyURL(steps); 958 959 if (equalIgnoringRef(d->m_url, u)) { 960 d->m_extension->goBackOrForward(steps); 961 return; 962 } 963 } 964 945 965 d->m_scheduledRedirection = historyNavigationScheduled; 946 966 d->m_delayRedirect = 0; -
trunk/WebCore/platform/KURL.cpp
r14320 r14669 1201 1201 } 1202 1202 1203 bool urlcmp(const DeprecatedString &a, const DeprecatedString &b, bool ignoreTrailingSlash, bool ignoreRef) 1204 { 1205 if (ignoreRef) { 1206 KURL aURL(a); 1207 KURL bURL(b); 1208 if (aURL.m_isValid && bURL.m_isValid) 1209 return aURL.urlString.left(aURL.queryEndPos) == bURL.urlString.left(bURL.queryEndPos); 1210 } 1211 return a == b; 1203 bool equalIgnoringRef(const KURL& a, const KURL& b) const; 1204 { 1205 return a.urlString.left(a.queryEndPos) == b.urlString.left(b.queryEndPos); 1212 1206 } 1213 1207 -
trunk/WebCore/platform/KURL.h
r13821 r14669 111 111 int fragmentEndPos; 112 112 113 // True if both URLs are the same. 114 friend bool urlcmp(const DeprecatedString &URLA, const DeprecatedString &URLB, bool ignoreTrailingSlash, bool ignoreRef); 113 friend bool equalIgnoringRef(const KURL& a, const KURL& b); 115 114 }; 116 115 -
trunk/WebKit/ChangeLog
r14667 r14669 1 2006-06-01 Anders Carlsson <acarlsson@apple.com> 2 3 Reviewed by Darin. 4 5 http://bugzilla.opendarwin.org/show_bug.cgi?id=6309 6 multiple problems prevent bookmarking/back button technique for AJAX/DHTML applications from working 7 8 * Misc/WebNSURLExtras.m: 9 (-[NSString _webkit_URLFragment]): 10 Don't include the "#" character in the fragment. 11 12 * WebCoreSupport/WebFrameBridge.m: 13 (-[WebFrameBridge historyURL:]): 14 New function, returns the history URL for a given position in the back/forward list 15 16 * WebView/WebFrame.m: 17 (-[WebFrame _loadItem:withLoadType:]): 18 Always call scrollToAnchorWithURL, even if there is no fragment. This way we keep the WebCore frame's 19 URL up-to-date. 20 1 21 2006-06-01 Maciej Stachowiak <mjs@apple.com> 2 22 -
trunk/WebKit/Misc/WebNSURLExtras.m
r14021 r14669 1088 1088 if (fragmentRange.location == NSNotFound) 1089 1089 return nil; 1090 return [self substringFromIndex:fragmentRange.location ];1090 return [self substringFromIndex:fragmentRange.location + 1]; 1091 1091 } 1092 1092 -
trunk/WebKit/WebCoreSupport/WebFrameBridge.m
r14651 r14669 1240 1240 } 1241 1241 1242 - (NSURL*)historyURL:(int)distance 1243 { 1244 WebView *webView = [self webView]; 1245 WebBackForwardList *list = [webView backForwardList]; 1246 WebHistoryItem *item = [list itemAtIndex:distance]; 1247 if (!item) { 1248 if (distance > 0) { 1249 int forwardListCount = [list forwardListCount]; 1250 if (forwardListCount > 0) 1251 item = [list itemAtIndex:forwardListCount]; 1252 } else { 1253 int backListCount = [list forwardListCount]; 1254 if (backListCount > 0) 1255 item = [list itemAtIndex:-backListCount]; 1256 } 1257 } 1258 if (item) 1259 return [item URL]; 1260 1261 return nil; 1262 } 1263 1242 1264 static id <WebFormDelegate> formDelegate(WebFrameBridge *self) 1243 1265 { -
trunk/WebKit/WebKit.xcodeproj/project.pbxproj
r14651 r14669 281 281 ED7F6D8B0980683500C235ED /* WebNSDataExtrasPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = ED7F6D8A0980683500C235ED /* WebNSDataExtrasPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 282 282 /* End PBXBuildFile section */ 283 284 /* Begin PBXBuildStyle section */285 BC5D261E0A2E3FC000102DF0 /* Development */ = {286 isa = PBXBuildStyle;287 buildSettings = {288 COPY_PHASE_STRIP = NO;289 };290 name = Development;291 };292 BC5D261F0A2E3FC000102DF0 /* Deployment */ = {293 isa = PBXBuildStyle;294 buildSettings = {295 COPY_PHASE_STRIP = YES;296 };297 name = Deployment;298 };299 /* End PBXBuildStyle section */300 283 301 284 /* Begin PBXFileReference section */ … … 1257 1240 isa = PBXProject; 1258 1241 buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */; 1259 buildSettings = {1260 };1261 buildStyles = (1262 BC5D261E0A2E3FC000102DF0 /* Development */,1263 BC5D261F0A2E3FC000102DF0 /* Deployment */,1264 );1265 1242 hasScannedForEncodings = 1; 1266 1243 knownRegions = ( -
trunk/WebKit/WebView/WebFrame.m
r14586 r14669 1335 1335 // FIXME: form state might want to be saved here too 1336 1336 1337 // FIXME: Perhaps we can use scrollToAnchorWithURL here instead and remove the older scrollToAnchor:? 1338 NSString *anchor = [[item URLString] _webkit_URLFragment]; 1339 if (anchor) 1340 [[_private->dataSource _bridge] scrollToAnchor: anchor]; 1337 // We always call scrollToAnchorWithURL here, even if the URL doesn't have an 1338 // anchor fragment. This is so we'll keep the WebCore Frame's URL up-to-date. 1339 [[_private->dataSource _bridge] scrollToAnchorWithURL:[item URL]]; 1341 1340 1342 1341 // must do this maintenance here, since we don't go through a real page reload -
trunk/WebKitTools/ChangeLog
r14665 r14669 1 2006-06-01 Anders Carlsson <acarlsson@apple.com> 2 3 Reviewed by Darin. 4 5 * DumpRenderTree/DumpRenderTree.m: 6 (+[LayoutTestController isSelectorExcludedFromWebScript:]): 7 (-[LayoutTestController clearBackForwardList]): 8 Add clearBackForwardList function to layoutTestController 9 1 10 2006-06-01 Anders Carlsson <acarlsson@apple.com> 2 11 -
trunk/WebKitTools/DumpRenderTree/DumpRenderTree.m
r14665 r14669 598 598 || aSelector == @selector(display) 599 599 || aSelector == @selector(testRepaint) 600 || aSelector == @selector(repaintSweepHorizontally)) 600 || aSelector == @selector(repaintSweepHorizontally) 601 || aSelector == @selector(clearBackForwardList)) 601 602 return NO; 602 603 return YES; … … 610 611 return @"setMainFrameIsFirstResponder"; 611 612 return nil; 613 } 614 615 - (void)clearBackForwardList 616 { 617 WebBackForwardList *backForwardList = [[frame webView] backForwardList]; 618 WebHistoryItem *item = [[backForwardList currentItem] retain]; 619 620 // We clear the history by setting the back/forward list's capacity to 0 621 // then restoring it back and adding back the current item. 622 int capacity = [backForwardList capacity]; 623 [backForwardList setCapacity:0]; 624 [backForwardList setCapacity:capacity]; 625 [backForwardList addItem:item]; 626 [backForwardList goToItem:item]; 627 [item release]; 612 628 } 613 629
Note: See TracChangeset
for help on using the changeset viewer.