Changeset 73412 in webkit
- Timestamp:
- Dec 6, 2010 4:33:18 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r73410 r73412 1 2010-12-06 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Generalize didChangeLocationWithinPageForFrame for all same document navigations 6 https://bugs.webkit.org/show_bug.cgi?id=50584 7 8 - Rename didChangeLocationWithinPageForFrame callbacks to didSameDocumentNavigationForFrame 9 - Add WKSameDocumentNavigationType to didChangeLocationWithinPageForFrame. 10 - Call didSameDocumentNavigationForFrame for HTML session state changes. 11 12 * Shared/API/c/WKPageLoadTypes.h: Added. 13 * Shared/API/c/WKSharedAPICast.h: 14 (WebKit::toAPI): 15 Moved WKFrameNavigationType here from WKPage.h and add WKSameDocumentNavigationType. 16 17 * Shared/SameDocumentNavigationType.h: Added. 18 * UIProcess/API/C/WKAPICast.h: 19 Moved WKFrameNavigationType conversion from here. 20 21 * UIProcess/API/C/WKPage.h: 22 * UIProcess/API/qt/qwkpage.cpp: 23 (QWKPage::QWKPage): 24 Update comment. 25 26 * UIProcess/WebFrameProxy.cpp: 27 (WebKit::WebFrameProxy::didSameDocumentNavigation): 28 * UIProcess/WebFrameProxy.h: 29 * UIProcess/WebLoaderClient.cpp: 30 (WebKit::WebLoaderClient::didSameDocumentNavigationForFrame): 31 * UIProcess/WebLoaderClient.h: 32 * UIProcess/WebPageProxy.cpp: 33 (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): 34 * UIProcess/WebPageProxy.h: 35 * UIProcess/WebPageProxy.messages.in: 36 * WebProcess/InjectedBundle/API/c/WKBundlePage.h: 37 * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: 38 (WebKit::InjectedBundlePageLoaderClient::didSameDocumentNavigationForFrame): 39 * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: 40 Pipe new name through. 41 42 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 43 (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): 44 (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): 45 (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): 46 (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): 47 Call didChangeLocationWithinPageForFrame for session state changes. 48 49 * WebKit2.pro: 50 * WebKit2.xcodeproj/project.pbxproj: 51 * win/WebKit2.vcproj: 52 * win/WebKit2Generated.make: 53 Add new files. 54 1 55 2010-12-06 Jessie Berlin <jberlin@apple.com> 2 56 -
trunk/WebKit2/Shared/API/c/WKSharedAPICast.h
r73267 r73412 27 27 #define WKSharedAPICast_h 28 28 29 #include "SameDocumentNavigationType.h" 29 30 #include "WKBase.h" 30 31 #include "WKContextMenuItemTypes.h" … … 32 33 #include "WKFindOptions.h" 33 34 #include "WKGeometry.h" 35 #include "WKPageLoadTypes.h" 34 36 #include "WebError.h" 35 37 #include "WebEvent.h" … … 39 41 #include "WebURL.h" 40 42 #include <WebCore/ContextMenuItem.h> 43 #include <WebCore/FloatRect.h> 44 #include <WebCore/FrameLoaderTypes.h> 45 #include <WebCore/IntPoint.h> 41 46 #include <WebCore/IntRect.h> 42 #include <WebCore/FloatRect.h>43 #include <WebCore/IntPoint.h>44 47 #include <wtf/TypeTraits.h> 45 48 … … 646 649 } 647 650 651 inline WKFrameNavigationType toAPI(WebCore::NavigationType type) 652 { 653 WKFrameNavigationType wkType = kWKFrameNavigationTypeOther; 654 655 switch (type) { 656 case WebCore::NavigationTypeLinkClicked: 657 wkType = kWKFrameNavigationTypeLinkClicked; 658 break; 659 case WebCore::NavigationTypeFormSubmitted: 660 wkType = kWKFrameNavigationTypeFormSubmitted; 661 break; 662 case WebCore::NavigationTypeBackForward: 663 wkType = kWKFrameNavigationTypeBackForward; 664 break; 665 case WebCore::NavigationTypeReload: 666 wkType = kWKFrameNavigationTypeReload; 667 break; 668 case WebCore::NavigationTypeFormResubmitted: 669 wkType = kWKFrameNavigationTypeFormResubmitted; 670 break; 671 case WebCore::NavigationTypeOther: 672 wkType = kWKFrameNavigationTypeOther; 673 break; 674 } 675 676 return wkType; 677 } 678 679 inline WKSameDocumentNavigationType toAPI(SameDocumentNavigationType type) 680 { 681 WKFrameNavigationType wkType = kWKSameDocumentNavigationAnchorNavigation; 682 683 switch (type) { 684 case SameDocumentNavigationAnchorNavigation: 685 wkType = kWKSameDocumentNavigationAnchorNavigation; 686 break; 687 case SameDocumentNavigationSessionStatePush: 688 wkType = kWKSameDocumentNavigationSessionStatePush; 689 break; 690 case SameDocumentNavigationSessionStateReplace: 691 wkType = kWKSameDocumentNavigationSessionStateReplace; 692 break; 693 case SameDocumentNavigationSessionStatePop: 694 wkType = kWKSameDocumentNavigationSessionStatePop; 695 break; 696 } 697 698 return wkType; 699 } 700 648 701 } // namespace WebKit 649 702 -
trunk/WebKit2/UIProcess/API/C/WKAPICast.h
r73281 r73412 33 33 #include "WKPreferencesPrivate.h" 34 34 #include "WKSharedAPICast.h" 35 #include <WebCore/FrameLoaderTypes.h>36 35 37 36 namespace WebKit { … … 76 75 77 76 /* Enum conversions */ 78 79 inline WKFrameNavigationType toAPI(WebCore::NavigationType type)80 {81 WKFrameNavigationType wkType = kWKFrameNavigationTypeOther;82 83 switch (type) {84 case WebCore::NavigationTypeLinkClicked:85 wkType = kWKFrameNavigationTypeLinkClicked;86 break;87 case WebCore::NavigationTypeFormSubmitted:88 wkType = kWKFrameNavigationTypeFormSubmitted;89 break;90 case WebCore::NavigationTypeBackForward:91 wkType = kWKFrameNavigationTypeBackForward;92 break;93 case WebCore::NavigationTypeReload:94 wkType = kWKFrameNavigationTypeReload;95 break;96 case WebCore::NavigationTypeFormResubmitted:97 wkType = kWKFrameNavigationTypeFormResubmitted;98 break;99 case WebCore::NavigationTypeOther:100 wkType = kWKFrameNavigationTypeOther;101 break;102 }103 104 return wkType;105 }106 77 107 78 inline CacheModel toCacheModel(WKCacheModel wkCacheModel) -
trunk/WebKit2/UIProcess/API/C/WKPage.h
r73336 r73412 32 32 #include <WebKit2/WKGeometry.h> 33 33 #include <WebKit2/WKNativeEvent.h> 34 #include <WebKit2/WKPageLoadTypes.h> 34 35 35 36 #ifndef __cplusplus … … 40 41 extern "C" { 41 42 #endif 42 43 enum {44 kWKFrameNavigationTypeLinkClicked = 0,45 kWKFrameNavigationTypeFormSubmitted = 1,46 kWKFrameNavigationTypeBackForward = 2,47 kWKFrameNavigationTypeReload = 3,48 kWKFrameNavigationTypeFormResubmitted = 4,49 kWKFrameNavigationTypeOther = 550 };51 typedef uint32_t WKFrameNavigationType;52 43 53 44 // FrameLoad Client … … 59 50 typedef void (*WKPageDidFinishLoadForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo); 60 51 typedef void (*WKPageDidFailLoadWithErrorForFrameCallback)(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void *clientInfo); 61 typedef void (*WKPageDid ChangeLocationWithinPageForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);52 typedef void (*WKPageDidSameDocumentNavigationForFrameCallback)(WKPageRef page, WKFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef userData, const void *clientInfo); 62 53 typedef void (*WKPageDidReceiveTitleForFrameCallback)(WKPageRef page, WKStringRef title, WKFrameRef frame, WKTypeRef userData, const void *clientInfo); 63 54 typedef void (*WKPageDidFirstLayoutForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo); … … 92 83 WKPageDidFinishLoadForFrameCallback didFinishLoadForFrame; 93 84 WKPageDidFailLoadWithErrorForFrameCallback didFailLoadWithErrorForFrame; 94 WKPageDid ChangeLocationWithinPageForFrameCallback didChangeLocationWithinPageForFrame;85 WKPageDidSameDocumentNavigationForFrameCallback didSameDocumentNavigationForFrame; 95 86 WKPageDidReceiveTitleForFrameCallback didReceiveTitleForFrame; 96 87 WKPageDidFirstLayoutForFrameCallback didFirstLayoutForFrame; -
trunk/WebKit2/UIProcess/API/qt/qwkpage.cpp
r73336 r73412 318 318 qt_wk_didFinishLoadForFrame, 319 319 qt_wk_didFailLoadWithErrorForFrame, 320 0, /* did ChangeLocationWithinPageForFrame */320 0, /* didSameDocumentNavigationForFrame */ 321 321 qt_wk_didReceiveTitleForFrame, 322 322 qt_wk_didFirstLayoutForFrame, -
trunk/WebKit2/UIProcess/WebFrameProxy.cpp
r73336 r73412 116 116 } 117 117 118 void WebFrameProxy::did ChangeURLWithoutNavigation(const String& url)118 void WebFrameProxy::didSameDocumentNavigation(const String& url) 119 119 { 120 120 m_url = url; -
trunk/WebKit2/UIProcess/WebFrameProxy.h
r73336 r73412 96 96 void didFinishLoad(); 97 97 void didFailLoad(); 98 void did ChangeURLWithoutNavigation(const String&); // eg. anchor navigation, session state change.98 void didSameDocumentNavigation(const String&); // eg. anchor navigation, session state change. 99 99 void didReceiveTitle(const String&); 100 100 -
trunk/WebKit2/UIProcess/WebLoaderClient.cpp
r73336 r73412 89 89 } 90 90 91 void WebLoaderClient::did ChangeLocationWithinPageForFrame(WebPageProxy* page, WebFrameProxy* frame, APIObject* userData)92 { 93 if (!m_client.did ChangeLocationWithinPageForFrame)94 return; 95 96 m_client.did ChangeLocationWithinPageForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.clientInfo);91 void WebLoaderClient::didSameDocumentNavigationForFrame(WebPageProxy* page, WebFrameProxy* frame, SameDocumentNavigationType type, APIObject* userData) 92 { 93 if (!m_client.didSameDocumentNavigationForFrame) 94 return; 95 96 m_client.didSameDocumentNavigationForFrame(toAPI(page), toAPI(frame), toAPI(type), toAPI(userData), m_client.clientInfo); 97 97 } 98 98 -
trunk/WebKit2/UIProcess/WebLoaderClient.h
r73336 r73412 28 28 29 29 #include "APIClient.h" 30 #include "SameDocumentNavigationType.h" 30 31 #include "WKPage.h" 31 32 #include <wtf/Forward.h> … … 53 54 void didFinishLoadForFrame(WebPageProxy*, WebFrameProxy*, APIObject*); 54 55 void didFailLoadWithErrorForFrame(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceError&, APIObject*); 55 void did ChangeLocationWithinPageForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);56 void didSameDocumentNavigationForFrame(WebPageProxy*, WebFrameProxy*, SameDocumentNavigationType, APIObject*); 56 57 void didReceiveTitleForFrame(WebPageProxy*, const String&, WebFrameProxy*, APIObject*); 57 58 void didFirstLayoutForFrame(WebPageProxy*, WebFrameProxy*, APIObject*); -
trunk/WebKit2/UIProcess/WebPageProxy.cpp
r73336 r73412 863 863 } 864 864 865 void WebPageProxy::did ChangeLocationWithinPageForFrame(uint64_t frameID, const String& url, CoreIPC::ArgumentDecoder* arguments)866 { 867 RefPtr<APIObject> userData; 868 WebContextUserMessageDecoder messageDecoder(userData, pageNamespace()->context()); 869 if (!arguments->decode(messageDecoder)) 870 return; 871 872 WebFrameProxy* frame = process()->webFrame(frameID); 873 frame->did ChangeURLWithoutNavigation(url);874 875 m_loaderClient.did ChangeLocationWithinPageForFrame(this, frame, userData.get());865 void WebPageProxy::didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t opaqueSameDocumentNavigationType, const String& url, CoreIPC::ArgumentDecoder* arguments) 866 { 867 RefPtr<APIObject> userData; 868 WebContextUserMessageDecoder messageDecoder(userData, pageNamespace()->context()); 869 if (!arguments->decode(messageDecoder)) 870 return; 871 872 WebFrameProxy* frame = process()->webFrame(frameID); 873 frame->didSameDocumentNavigation(url); 874 875 m_loaderClient.didSameDocumentNavigationForFrame(this, frame, static_cast<SameDocumentNavigationType>(opaqueSameDocumentNavigationType), userData.get()); 876 876 } 877 877 -
trunk/WebKit2/UIProcess/WebPageProxy.h
r73336 r73412 284 284 void didFinishLoadForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*); 285 285 void didFailLoadForFrame(uint64_t frameID, const WebCore::ResourceError&, CoreIPC::ArgumentDecoder*); 286 void did ChangeLocationWithinPageForFrame(uint64_t frameID, const String&, CoreIPC::ArgumentDecoder*);286 void didSameDocumentNavigationForFrame(uint64_t frameID, uint32_t sameDocumentNavigationType, const String&, CoreIPC::ArgumentDecoder*); 287 287 void didReceiveTitleForFrame(uint64_t frameID, const String&, CoreIPC::ArgumentDecoder*); 288 288 void didFirstLayoutForFrame(uint64_t frameID, CoreIPC::ArgumentDecoder*); -
trunk/WebKit2/UIProcess/WebPageProxy.messages.in
r73336 r73412 87 87 DidDisplayInsecureContentForFrame(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData) 88 88 DidRunInsecureContentForFrame(uint64_t frameID, WebKit::InjectedBundleUserMessageEncoder userData) 89 Did ChangeLocationWithinPageForFrame(uint64_t frameID, WTF::String url, WebKit::InjectedBundleUserMessageEncoder userData)89 DidSameDocumentNavigationForFrame(uint64_t frameID, uint32_t type, WTF::String url, WebKit::InjectedBundleUserMessageEncoder userData) 90 90 91 91 FrameDidBecomeFrameSet(uint64_t frameID, bool value) -
trunk/WebKit2/WebKit2.pro
r73281 r73412 219 219 Shared/API/c/WKGeometry.h \ 220 220 Shared/API/c/WKNumber.h \ 221 Shared/API/c/WKPageLoadTypes.h \ 221 222 Shared/API/c/WKSecurityOrigin.h \ 222 223 Shared/API/c/WKSerializedScriptValue.h \ … … 242 243 Shared/NotImplemented.h \ 243 244 Shared/PlatformPopupMenuData.h \ 245 Shared/SameDocumentNavigationType.h \ 244 246 Shared/StringPairVector.h \ 245 247 Shared/UserMessageCoders.h \ -
trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj
r73301 r73412 328 328 BC2652181182608100243E12 /* ChunkedUpdateDrawingAreaProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2652141182608100243E12 /* ChunkedUpdateDrawingAreaProxy.cpp */; }; 329 329 BC2652191182608100243E12 /* ChunkedUpdateDrawingAreaProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2652151182608100243E12 /* ChunkedUpdateDrawingAreaProxy.h */; }; 330 BC2D021712AC41CB00E732A3 /* SameDocumentNavigationType.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2D021612AC41CB00E732A3 /* SameDocumentNavigationType.h */; }; 331 BC2D021912AC426C00E732A3 /* WKPageLoadTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2D021812AC426C00E732A3 /* WKPageLoadTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; 330 332 BC2DFBA312A761A500E732A3 /* WebPreferencesCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2DFBA212A761A500E732A3 /* WebPreferencesCF.cpp */; }; 331 333 BC2E6E871141971500A63B1E /* RunLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2E6E771141970C00A63B1E /* RunLoop.cpp */; }; … … 958 960 BC2652141182608100243E12 /* ChunkedUpdateDrawingAreaProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ChunkedUpdateDrawingAreaProxy.cpp; sourceTree = "<group>"; }; 959 961 BC2652151182608100243E12 /* ChunkedUpdateDrawingAreaProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChunkedUpdateDrawingAreaProxy.h; sourceTree = "<group>"; }; 962 BC2D021612AC41CB00E732A3 /* SameDocumentNavigationType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SameDocumentNavigationType.h; sourceTree = "<group>"; }; 963 BC2D021812AC426C00E732A3 /* WKPageLoadTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageLoadTypes.h; sourceTree = "<group>"; }; 960 964 BC2DFBA212A761A500E732A3 /* WebPreferencesCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPreferencesCF.cpp; path = cf/WebPreferencesCF.cpp; sourceTree = "<group>"; }; 961 965 BC2E6E771141970C00A63B1E /* RunLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoop.cpp; sourceTree = "<group>"; }; … … 1513 1517 BCC43AB8127B95DC00317F16 /* PlatformPopupMenuData.cpp */, 1514 1518 BCC43AB9127B95DC00317F16 /* PlatformPopupMenuData.h */, 1519 BC2D021612AC41CB00E732A3 /* SameDocumentNavigationType.h */, 1515 1520 1AAB4A8C1296F0A20023952F /* SandboxExtension.h */, 1516 1521 BCBD3C3A125BFA7A00D2C29F /* StringPairVector.h */, … … 2238 2243 BC4075E5124FF0270068F20A /* WKNumber.cpp */, 2239 2244 BC4075E6124FF0270068F20A /* WKNumber.h */, 2245 BC2D021812AC426C00E732A3 /* WKPageLoadTypes.h */, 2240 2246 F634445A12A885E9000612D8 /* WKSecurityOrigin.cpp */, 2241 2247 F634445B12A885E9000612D8 /* WKSecurityOrigin.h */, … … 2620 2626 F634445612A885C8000612D8 /* WebSecurityOrigin.h in Headers */, 2621 2627 F634445D12A885E9000612D8 /* WKSecurityOrigin.h in Headers */, 2628 BC2D021712AC41CB00E732A3 /* SameDocumentNavigationType.h in Headers */, 2629 BC2D021912AC426C00E732A3 /* WKPageLoadTypes.h in Headers */, 2622 2630 ); 2623 2631 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
r73336 r73412 30 30 #include <WebKit2/WKEvent.h> 31 31 #include <WebKit2/WKFindOptions.h> 32 #include <WebKit2/WKPageLoadTypes.h> 32 33 33 34 #ifndef __cplusplus … … 74 75 typedef void (*WKBundlePageDidFinishDocumentLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo); 75 76 typedef void (*WKBundlePageDidFailLoadWithErrorForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKErrorRef error, WKTypeRef* userData, const void *clientInfo); 76 typedef void (*WKBundlePageDid ChangeLocationWithinPageForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo);77 typedef void (*WKBundlePageDidSameDocumentNavigationForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef* userData, const void *clientInfo); 77 78 typedef void (*WKBundlePageDidReceiveTitleForFrameCallback)(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo); 78 79 typedef void (*WKBundlePageDidFirstLayoutForFrame)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo); … … 98 99 WKBundlePageDidFinishLoadForFrameCallback didFinishLoadForFrame; 99 100 WKBundlePageDidFailLoadWithErrorForFrameCallback didFailLoadWithErrorForFrame; 100 WKBundlePageDid ChangeLocationWithinPageForFrameCallback didChangeLocationWithinPageForFrame;101 WKBundlePageDidSameDocumentNavigationForFrameCallback didSameDocumentNavigationForFrame; 101 102 WKBundlePageDidReceiveTitleForFrameCallback didReceiveTitleForFrame; 102 103 WKBundlePageDidFirstLayoutForFrame didFirstLayoutForFrame; -
trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
r73336 r73412 106 106 } 107 107 108 void InjectedBundlePageLoaderClient::did ChangeLocationWithinPageForFrame(WebPage* page, WebFrame* frame, RefPtr<APIObject>& userData)109 { 110 if (!m_client.did ChangeLocationWithinPageForFrame)111 return; 112 113 WKTypeRef userDataToPass = 0; 114 m_client.did ChangeLocationWithinPageForFrame(toAPI(page), toAPI(frame), &userDataToPass, m_client.clientInfo);108 void InjectedBundlePageLoaderClient::didSameDocumentNavigationForFrame(WebPage* page, WebFrame* frame, SameDocumentNavigationType type, RefPtr<APIObject>& userData) 109 { 110 if (!m_client.didSameDocumentNavigationForFrame) 111 return; 112 113 WKTypeRef userDataToPass = 0; 114 m_client.didSameDocumentNavigationForFrame(toAPI(page), toAPI(frame), toAPI(type), &userDataToPass, m_client.clientInfo); 115 115 userData = adoptRef(toImpl(userDataToPass)); 116 116 } -
trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
r73336 r73412 28 28 29 29 #include "APIClient.h" 30 #include "SameDocumentNavigationType.h" 30 31 #include "WKBundlePage.h" 31 32 #include <JavaScriptCore/JSBase.h> … … 52 53 void didFinishLoadForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData); 53 54 void didFailLoadWithErrorForFrame(WebPage*, WebFrame*, const WebCore::ResourceError&, RefPtr<APIObject>& userData); 54 void did ChangeLocationWithinPageForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData);55 void didSameDocumentNavigationForFrame(WebPage*, WebFrame*, SameDocumentNavigationType, RefPtr<APIObject>& userData); 55 56 void didReceiveTitleForFrame(WebPage*, const String&, WebFrame*, RefPtr<APIObject>& userData); 56 57 void didFirstLayoutForFrame(WebPage*, WebFrame*, RefPtr<APIObject>& userData); -
trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r73336 r73412 279 279 280 280 // Notify the bundle client. 281 webPage->injectedBundleLoaderClient().did ChangeLocationWithinPageForFrame(webPage, m_frame, userData);282 283 // Notify the UIProcess. 284 webPage->send(Messages::WebPageProxy::Did ChangeLocationWithinPageForFrame(m_frame->frameID(), m_frame->coreFrame()->loader()->url().string(), InjectedBundleUserMessageEncoder(userData.get())));281 webPage->injectedBundleLoaderClient().didSameDocumentNavigationForFrame(webPage, m_frame, SameDocumentNavigationAnchorNavigation, userData); 282 283 // Notify the UIProcess. 284 webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), SameDocumentNavigationAnchorNavigation, m_frame->coreFrame()->loader()->url().string(), InjectedBundleUserMessageEncoder(userData.get()))); 285 285 } 286 286 287 287 void WebFrameLoaderClient::dispatchDidPushStateWithinPage() 288 288 { 289 notImplemented(); 289 WebPage* webPage = m_frame->page(); 290 if (!webPage) 291 return; 292 293 RefPtr<APIObject> userData; 294 295 // Notify the bundle client. 296 webPage->injectedBundleLoaderClient().didSameDocumentNavigationForFrame(webPage, m_frame, SameDocumentNavigationSessionStatePush, userData); 297 298 // Notify the UIProcess. 299 webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), SameDocumentNavigationSessionStatePush, m_frame->coreFrame()->loader()->url().string(), InjectedBundleUserMessageEncoder(userData.get()))); 290 300 } 291 301 292 302 void WebFrameLoaderClient::dispatchDidReplaceStateWithinPage() 293 303 { 294 notImplemented(); 304 WebPage* webPage = m_frame->page(); 305 if (!webPage) 306 return; 307 308 RefPtr<APIObject> userData; 309 310 // Notify the bundle client. 311 webPage->injectedBundleLoaderClient().didSameDocumentNavigationForFrame(webPage, m_frame, SameDocumentNavigationSessionStateReplace, userData); 312 313 // Notify the UIProcess. 314 webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), SameDocumentNavigationSessionStateReplace, m_frame->coreFrame()->loader()->url().string(), InjectedBundleUserMessageEncoder(userData.get()))); 295 315 } 296 316 297 317 void WebFrameLoaderClient::dispatchDidPopStateWithinPage() 298 318 { 299 notImplemented(); 319 WebPage* webPage = m_frame->page(); 320 if (!webPage) 321 return; 322 323 RefPtr<APIObject> userData; 324 325 // Notify the bundle client. 326 webPage->injectedBundleLoaderClient().didSameDocumentNavigationForFrame(webPage, m_frame, SameDocumentNavigationSessionStatePop, userData); 327 328 // Notify the UIProcess. 329 webPage->send(Messages::WebPageProxy::DidSameDocumentNavigationForFrame(m_frame->frameID(), SameDocumentNavigationSessionStatePop, m_frame->coreFrame()->loader()->url().string(), InjectedBundleUserMessageEncoder(userData.get()))); 300 330 } 301 331 -
trunk/WebKit2/win/WebKit2.vcproj
r73281 r73412 480 480 </File> 481 481 <File 482 RelativePath="..\Shared\SameDocumentNavigationType.h" 483 > 484 </File> 485 <File 482 486 RelativePath="..\Shared\StringPairVector.h" 483 487 > … … 756 760 <File 757 761 RelativePath="..\Shared\API\c\WKNumber.h" 762 > 763 </File> 764 <File 765 RelativePath="..\Shared\API\c\WKPageLoadTypes.h" 758 766 > 759 767 </File> -
trunk/WebKit2/win/WebKit2Generated.make
r73286 r73412 22 22 xcopy /y /d "..\Shared\API\c\WKMutableDictionary.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 23 23 xcopy /y /d "..\Shared\API\c\WKNumber.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 24 xcopy /y /d "..\Shared\API\c\WKPageLoadTypes.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 24 25 xcopy /y /d "..\Shared\API\C\WKSecurityOrigin.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" 25 26 xcopy /y /d "..\Shared\API\c\WKSerializedScriptValue.h" "$(WEBKITOUTPUTDIR)\include\WebKit2" -
trunk/WebKitTools/ChangeLog
r73409 r73412 1 2010-12-06 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Anders Carlsson. 4 5 Generalize didChangeLocationWithinPageForFrame for all same document navigations 6 https://bugs.webkit.org/show_bug.cgi?id=50584 7 8 * MiniBrowser/mac/BrowserWindowController.m: 9 (didSameDocumentNavigationForFrame): 10 (-[BrowserWindowController awakeFromNib]): 11 (-[BrowserWindowController didSameDocumentNavigationForFrame:]): 12 * TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp: 13 (TestWebKitAPI::didSameDocumentNavigationForFrame): 14 (TestWebKitAPI::TEST): 15 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: 16 (WTR::InjectedBundlePage::InjectedBundlePage): 17 (WTR::InjectedBundlePage::didSameDocumentNavigationForFrame): 18 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: 19 * WebKitTestRunner/TestController.cpp: 20 (WTR::TestController::initialize): 21 1 22 2010-12-06 Kinuko Yasuda <kinuko@chromium.org> 2 23 -
trunk/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
r73336 r73412 39 39 - (void)didFailProvisionalLoadWithErrorForFrame:(WKFrameRef)frame; 40 40 - (void)didFailLoadWithErrorForFrame:(WKFrameRef)frame; 41 - (void)did ChangeLocationWithinPageForFrame:(WKFrameRef)frame;41 - (void)didSameDocumentNavigationForFrame:(WKFrameRef)frame; 42 42 @end 43 43 … … 285 285 } 286 286 287 static void did ChangeLocationWithinPageForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)288 { 289 [(BrowserWindowController *)clientInfo did ChangeLocationWithinPageForFrame:frame];287 static void didSameDocumentNavigationForFrame(WKPageRef page, WKFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef userData, const void *clientInfo) 288 { 289 [(BrowserWindowController *)clientInfo didSameDocumentNavigationForFrame:frame]; 290 290 } 291 291 … … 555 555 didFinishLoadForFrame, 556 556 didFailLoadWithErrorForFrame, 557 did ChangeLocationWithinPageForFrame,557 didSameDocumentNavigationForFrame, 558 558 didReceiveTitleForFrame, 559 559 didFirstLayoutForFrame, … … 680 680 } 681 681 682 - (void)did ChangeLocationWithinPageForFrame:(WKFrameRef)frame682 - (void)didSameDocumentNavigationForFrame:(WKFrameRef)frame 683 683 { 684 684 } -
trunk/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp
r73336 r73412 44 44 45 45 static bool didChangeLocationWithinPage; 46 static void did ChangeLocationWithinPageForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void*)46 static void didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef, WKSameDocumentNavigationType type, WKTypeRef, const void*) 47 47 { 48 TEST_ASSERT(type == kWKSameDocumentNavigationAnchorNavigation); 48 49 didChangeLocationWithinPage = true; 49 50 } … … 59 60 memset(&loaderClient, 0, sizeof(loaderClient)); 60 61 loaderClient.didFinishLoadForFrame = didFinishLoadForFrame; 61 loaderClient.did ChangeLocationWithinPageForFrame = didChangeLocationWithinPageForFrame;62 loaderClient.didSameDocumentNavigationForFrame = didSameDocumentNavigationForFrame; 62 63 WKPageSetPageLoaderClient(webView.page(), &loaderClient); 63 64 -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
r73336 r73412 181 181 didFinishLoadForFrame, 182 182 didFailLoadWithErrorForFrame, 183 did ChangeLocationWithinPageForFrame,183 didSameDocumentNavigationForFrame, 184 184 didReceiveTitleForFrame, 185 185 0, … … 303 303 } 304 304 305 void InjectedBundlePage::did ChangeLocationWithinPageForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo)306 { 307 static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->did ChangeLocationWithinPageForFrame(frame);305 void InjectedBundlePage::didSameDocumentNavigationForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKSameDocumentNavigationType type, WKTypeRef*, const void* clientInfo) 306 { 307 static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didSameDocumentNavigationForFrame(frame, type); 308 308 } 309 309 … … 536 536 } 537 537 538 void InjectedBundlePage::did ChangeLocationWithinPageForFrame(WKBundleFrameRef frame)538 void InjectedBundlePage::didSameDocumentNavigationForFrame(WKBundleFrameRef frame, WKSameDocumentNavigationType type) 539 539 { 540 540 } -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
r73336 r73412 61 61 static void didCancelClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); 62 62 static void willPerformClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, WKURLRef url, double delay, double date, const void*); 63 static void did ChangeLocationWithinPageForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);63 static void didSameDocumentNavigationForFrame(WKBundlePageRef, WKBundleFrameRef, WKSameDocumentNavigationType, WKTypeRef*, const void*); 64 64 static void didHandleOnloadEventsForFrame(WKBundlePageRef, WKBundleFrameRef, const void*); 65 65 static void didDisplayInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*); … … 75 75 void didCancelClientRedirectForFrame(WKBundleFrameRef); 76 76 void willPerformClientRedirectForFrame(WKBundleFrameRef, WKURLRef url, double delay, double date); 77 void did ChangeLocationWithinPageForFrame(WKBundleFrameRef);77 void didSameDocumentNavigationForFrame(WKBundleFrameRef, WKSameDocumentNavigationType); 78 78 void didFinishDocumentLoadForFrame(WKBundleFrameRef); 79 79 void didHandleOnloadEventsForFrame(WKBundleFrameRef); -
trunk/WebKitTools/WebKitTestRunner/TestController.cpp
r73336 r73412 252 252 didFinishLoadForFrame, 253 253 0, // didFailLoadWithErrorForFrame 254 0, // did ChangeLocationWithinPageForFrame254 0, // didSameDocumentNavigationForFrame 255 255 0, // didReceiveTitleForFrame 256 256 0, // didFirstLayoutForFrame
Note: See TracChangeset
for help on using the changeset viewer.