Changeset 84206 in webkit
- Timestamp:
- Apr 18, 2011 4:28:38 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r84199 r84206 1 2011-04-05 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 WebKit2: WKTR should support WebKit2 full screen APIs 6 https://bugs.webkit.org/show_bug.cgi?id=56318 7 8 WKTR does not support the eventSender.keyDown() method, so use mouseDown() 9 in those cases that keyDown() does not exist. 10 11 * fullscreen/full-screen-test.js: 12 (runWithKeyDown.document.addEventListener): 13 (runWithKeyDown): 14 1 15 2011-04-18 Evan Martin <evan@chromium.org> 2 16 -
trunk/LayoutTests/fullscreen/full-screen-test.js
r83654 r84206 12 12 function runWithKeyDown(fn) 13 13 { 14 document.addEventListener('keypress', function() { fn(); }, false); 14 // FIXME: WKTR does not yet support the keyDown() message. Do a mouseDown here 15 // instead until keyDown support is added. 16 document.addEventListener(eventSender.keyDown ? 'keypress' : 'mousedown', function() { fn(); }, false); 15 17 if (window.layoutTestController) { 16 eventSender.keyDown(" ", []); 18 if (eventSender.keyDown) 19 eventSender.keyDown(" ", []); 20 else 21 eventSender.mouseDown(); 17 22 } 18 23 } -
trunk/Source/WebKit2/ChangeLog
r84202 r84206 1 2011-04-05 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 WebKit2: WKTR should support WebKit2 full screen APIs 6 https://bugs.webkit.org/show_bug.cgi?id=56318 7 8 Add a new WKBundlePage API for Full Screen events, and move some of the implementation 9 of WebFullScreenManager into the new InjectedBundlePageFullScreenClient class, so that 10 the default behavior can be overridden by a WKBundlePageFullScreenClient. 11 12 * WebKit2.xcodeproj/project.pbxproj: 13 * WebProcess/FullScreen/WebFullScreenManager.cpp: 14 (WebKit::WebFullScreenManager::supportsFullScreen): Moved contents into InjectedBundlePageFullScreenClient. 15 (WebKit::WebFullScreenManager::enterFullScreenForElement): Ditto. 16 (WebKit::WebFullScreenManager::exitFullScreenForElement): Ditto. 17 * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: 18 (WKBundlePageSetFullScreenClient): Added. 19 (WKBundlePageWillEnterFullScreenForElement): Added. 20 (WKBundlePageDidEnterFullScreenForElement): Added. 21 (WKBundlePageWillExitFullScreenForElement): Added. 22 (WKBundlePageDidExitFullScreenForElement): Added. 23 * WebProcess/InjectedBundle/API/c/WKBundlePage.h: 24 * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp: Added. 25 (WebKit::InjectedBundlePageFullScreenClient::supportsFullScreen): Added. 26 (WebKit::InjectedBundlePageFullScreenClient::enterFullScreenForElement): Added. 27 (WebKit::InjectedBundlePageFullScreenClient::exitFullScreenForElement): Added. 28 * WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h: Added. 29 * WebProcess/WebPage/WebPage.cpp: 30 (WebKit::WebPage::initializeInjectedBundleFullScreenClient): Added. 31 * WebProcess/WebPage/WebPage.h: 32 (WebKit::WebPage::injectedBundleFullScreenClient): Added. 33 1 34 2011-04-18 Alexey Proskuryakov <ap@apple.com> 2 35 -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r84181 r84206 771 771 C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = C574A57F12E66681002DFE98 /* PasteboardTypes.h */; }; 772 772 C574A58212E66681002DFE98 /* PasteboardTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = C574A58012E66681002DFE98 /* PasteboardTypes.mm */; }; 773 CD5C66A0134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5C669E134B9D36004FE2A8 /* InjectedBundlePageFullScreenClient.cpp */; }; 774 CD5C66A1134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5C669F134B9D37004FE2A8 /* InjectedBundlePageFullScreenClient.h */; }; 773 775 CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA3E131A2E8A00EEDED2 /* WebFullScreenManagerProxy.cpp */; }; 774 776 CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA45131ACC8800EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp */; }; … … 1689 1691 C574A57F12E66681002DFE98 /* PasteboardTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteboardTypes.h; sourceTree = "<group>"; }; 1690 1692 C574A58012E66681002DFE98 /* PasteboardTypes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardTypes.mm; sourceTree = "<group>"; }; 1693 CD5C669E134B9D36004FE2A8 /* InjectedBundlePageFullScreenClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageFullScreenClient.cpp; sourceTree = "<group>"; }; 1694 CD5C669F134B9D37004FE2A8 /* InjectedBundlePageFullScreenClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageFullScreenClient.h; sourceTree = "<group>"; }; 1691 1695 CD73BA37131A29FE00EEDED2 /* WebFullScreenManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebFullScreenManager.cpp; path = FullScreen/WebFullScreenManager.cpp; sourceTree = "<group>"; }; 1692 1696 CD73BA38131A29FE00EEDED2 /* WebFullScreenManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebFullScreenManager.h; path = FullScreen/WebFullScreenManager.h; sourceTree = "<group>"; }; … … 2855 2859 BC14DF75120B5B7900826C0C /* InjectedBundleScriptWorld.h */, 2856 2860 BCB0B0DD12305A8C00B1341E /* InjectedBundleUserMessageCoders.h */, 2861 CD5C669E134B9D36004FE2A8 /* InjectedBundlePageFullScreenClient.cpp */, 2862 CD5C669F134B9D37004FE2A8 /* InjectedBundlePageFullScreenClient.h */, 2857 2863 ); 2858 2864 path = InjectedBundle; … … 3682 3688 E1A31732134CEA6C007C9A4F /* AttributedString.h in Headers */, 3683 3689 E179FD9C134D38060015B883 /* ArgumentCodersMac.h in Headers */, 3690 CD5C66A1134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.h in Headers */, 3684 3691 ); 3685 3692 runOnlyForDeploymentPostprocessing = 0; … … 4310 4317 E179FD9F134D38250015B883 /* ArgumentCodersMac.mm in Sources */, 4311 4318 31EA25D2134F78C0005B1452 /* NativeWebMouseEventMac.mm in Sources */, 4319 CD5C66A0134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.cpp in Sources */, 4312 4320 ); 4313 4321 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
r82084 r84206 67 67 return false; 68 68 69 bool supports = true; 70 m_page->sendSync(Messages::WebFullScreenManagerProxy::SupportsFullScreen(withKeyboard), supports); 71 return supports; 69 return m_page->injectedBundleFullScreenClient().supportsFullScreen(m_page.get(), withKeyboard); 70 72 71 } 73 72 … … 77 76 m_element = element; 78 77 m_initialFrame = m_element->screenRect(); 79 m_page-> send(Messages::WebFullScreenManagerProxy::EnterFullScreen());78 m_page->injectedBundleFullScreenClient().enterFullScreenForElement(m_page.get(), element); 80 79 } 81 80 … … 84 83 ASSERT(element); 85 84 ASSERT(m_element == element); 86 m_page-> send(Messages::WebFullScreenManagerProxy::ExitFullScreen());85 m_page->injectedBundleFullScreenClient().exitFullScreenForElement(m_page.get(), element); 87 86 } 88 87 -
trunk/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h
r82084 r84206 64 64 virtual void setRootFullScreenLayer(WebCore::GraphicsLayer*) = 0; 65 65 66 void willEnterFullScreen(); 67 void didEnterFullScreen(); 68 void willExitFullScreen(); 69 void didExitFullScreen(); 70 66 71 WebCore::Element* element(); 67 72 … … 69 74 WebFullScreenManager(WebPage*); 70 75 71 void willEnterFullScreen();72 void didEnterFullScreen();73 void willExitFullScreen();74 void didExitFullScreen();75 76 virtual void beginEnterFullScreenAnimation(float duration) = 0; 76 77 virtual void beginExitFullScreenAnimation(float duration) = 0; -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
r84034 r84206 29 29 30 30 #include "InjectedBundleBackForwardList.h" 31 #include "InjectedBundleNodeHandle.h" 31 32 #include "WKAPICast.h" 32 33 #include "WKBundleAPICast.h" 34 #include "WebFullScreenManager.h" 33 35 #include "WebImage.h" 34 36 #include "WebPage.h" … … 94 96 } 95 97 98 void WKBundlePageSetFullScreenClient(WKBundlePageRef pageRef, WKBundlePageFullScreenClient* wkClient) 99 { 100 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API 101 if (wkClient && wkClient->version) 102 return; 103 toImpl(pageRef)->initializeInjectedBundleFullScreenClient(wkClient); 104 #endif 105 } 106 107 void WKBundlePageWillEnterFullScreen(WKBundlePageRef pageRef) 108 { 109 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API 110 toImpl(pageRef)->fullScreenManager()->willEnterFullScreen(); 111 #endif 112 } 113 114 void WKBundlePageDidEnterFullScreen(WKBundlePageRef pageRef) 115 { 116 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API 117 toImpl(pageRef)->fullScreenManager()->didEnterFullScreen(); 118 #endif 119 } 120 121 void WKBundlePageWillExitFullScreen(WKBundlePageRef pageRef) 122 { 123 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API 124 toImpl(pageRef)->fullScreenManager()->willExitFullScreen(); 125 #endif 126 } 127 128 void WKBundlePageDidExitFullScreen(WKBundlePageRef pageRef) 129 { 130 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API 131 toImpl(pageRef)->fullScreenManager()->didExitFullScreen(); 132 #endif 133 } 134 96 135 WKBundlePageGroupRef WKBundlePageGetPageGroup(WKBundlePageRef pageRef) 97 136 { -
trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
r82289 r84206 67 67 typedef uint32_t WKInputFieldActionType; 68 68 69 enum { 70 WKFullScreenNoKeyboard, 71 WKFullScreenKeyboard, 72 }; 73 typedef uint32_t WKFullScreenKeyboardRequestType; 74 69 75 // Loader Client 70 76 typedef void (*WKBundlePageDidStartProvisionalLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo); … … 244 250 typedef struct WKBundlePageContextMenuClient WKBundlePageContextMenuClient; 245 251 252 // Full Screen client 253 typedef bool (*WKBundlePageSupportsFullScreen)(WKBundlePageRef page, WKFullScreenKeyboardRequestType requestType); 254 typedef void (*WKBundlePageEnterFullScreenForElement)(WKBundlePageRef page, WKBundleNodeHandleRef element); 255 typedef void (*WKBundlePageExitFullScreenForElement)(WKBundlePageRef page, WKBundleNodeHandleRef element); 256 257 struct WKBundlePageFullScreenClient { 258 int version; 259 const void * clientInfo; 260 WKBundlePageSupportsFullScreen supportsFullScreen; 261 WKBundlePageEnterFullScreenForElement enterFullScreenForElement; 262 WKBundlePageExitFullScreenForElement exitFullScreenForElement; 263 }; 264 typedef struct WKBundlePageFullScreenClient WKBundlePageFullScreenClient; 265 266 WK_EXPORT void WKBundlePageWillEnterFullScreen(WKBundlePageRef page); 267 WK_EXPORT void WKBundlePageDidEnterFullScreen(WKBundlePageRef page); 268 WK_EXPORT void WKBundlePageWillExitFullScreen(WKBundlePageRef page); 269 WK_EXPORT void WKBundlePageDidExitFullScreen(WKBundlePageRef page); 270 246 271 WK_EXPORT WKTypeID WKBundlePageGetTypeID(); 247 272 248 273 WK_EXPORT void WKBundlePageSetContextMenuClient(WKBundlePageRef page, WKBundlePageContextMenuClient* client); 249 274 WK_EXPORT void WKBundlePageSetEditorClient(WKBundlePageRef page, WKBundlePageEditorClient* client); … … 253 278 WK_EXPORT void WKBundlePageSetPolicyClient(WKBundlePageRef page, WKBundlePagePolicyClient* client); 254 279 WK_EXPORT void WKBundlePageSetUIClient(WKBundlePageRef page, WKBundlePageUIClient* client); 280 281 WK_EXPORT void WKBundlePageSetFullScreenClient(WKBundlePageRef page, WKBundlePageFullScreenClient* client); 255 282 256 283 WK_EXPORT WKBundlePageGroupRef WKBundlePageGetPageGroup(WKBundlePageRef page); -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r84181 r84206 295 295 } 296 296 297 #if ENABLE(FULLSCREEN_API) 298 void WebPage::initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClient* client) 299 { 300 m_fullScreenClient.initialize(client); 301 } 302 #endif 303 297 304 PassRefPtr<Plugin> WebPage::createPlugin(const Plugin::Parameters& parameters) 298 305 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r84034 r84206 35 35 #include "InjectedBundlePageEditorClient.h" 36 36 #include "InjectedBundlePageFormClient.h" 37 #include "InjectedBundlePageFullScreenClient.h" 37 38 #include "InjectedBundlePageLoaderClient.h" 38 39 #include "InjectedBundlePagePolicyClient.h" … … 196 197 void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClient*); 197 198 void initializeInjectedBundleUIClient(WKBundlePageUIClient*); 199 #if ENABLE(FULLSCREEN_API) 200 void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClient*); 201 #endif 198 202 199 203 InjectedBundlePageContextMenuClient& injectedBundleContextMenuClient() { return m_contextMenuClient; } … … 204 208 InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; } 205 209 InjectedBundlePageUIClient& injectedBundleUIClient() { return m_uiClient; } 210 #if ENABLE(FULLSCREEN_API) 211 InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; } 212 #endif 206 213 207 214 bool findStringFromInjectedBundle(const String&, FindOptions); … … 604 611 InjectedBundlePageResourceLoadClient m_resourceLoadClient; 605 612 InjectedBundlePageUIClient m_uiClient; 613 #if ENABLE(FULLSCREEN_API) 614 InjectedBundlePageFullScreenClient m_fullScreenClient; 615 #endif 606 616 607 617 #if ENABLE(TILED_BACKING_STORE) -
trunk/Tools/ChangeLog
r84205 r84206 1 2011-04-05 Jer Noble <jer.noble@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 WebKit2: WKTR should support WebKit2 full screen APIs 6 https://bugs.webkit.org/show_bug.cgi?id=56318 7 8 Respond to enterFullScreenForElement() and exitFullScreenForElement(), allowing 9 WKTR to test the LayoutTest/fullscreen/ tests. 10 11 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: 12 (WTR::InjectedBundlePage::InjectedBundlePage): Add support for WKBundlePageFullScreenClient. 13 (WTR::InjectedBundlePage::supportsFullScreen): Added. 14 (WTR::InjectedBundlePage::enterFullScreenForElement): Added. 15 (WTR::InjectedBundlePage::exitFullScreenForElement): Added. 16 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: 17 * WebKitTestRunner/TestController.cpp: 18 (WTR::TestController::resetStateToConsistentValues): Enable the full screen preference. 19 1 20 2011-04-18 Dirk Pranke <dpranke@chromium.org> 2 21 -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
r84070 r84206 245 245 }; 246 246 WKBundlePageSetEditorClient(m_page, &editorClient); 247 248 #if ENABLE(FULLSCREEN_API) 249 WKBundlePageFullScreenClient fullScreenClient = { 250 0, 251 this, 252 supportsFullScreen, 253 enterFullScreenForElement, 254 exitFullScreenForElement, 255 }; 256 WKBundlePageSetFullScreenClient(m_page, &fullScreenClient); 257 #endif 247 258 } 248 259 … … 999 1010 } 1000 1011 1012 #if ENABLE(FULLSCREEN_API) 1013 bool InjectedBundlePage::supportsFullScreen(WKBundlePageRef pageRef, WKFullScreenKeyboardRequestType requestType) 1014 { 1015 InjectedBundle::shared().os() << "supportsFullScreen() == true\n"; 1016 return true; 1017 } 1018 1019 void InjectedBundlePage::enterFullScreenForElement(WKBundlePageRef pageRef, WKBundleNodeHandleRef elementRef) 1020 { 1021 InjectedBundle::shared().os() << "enterFullScreenForElement()\n"; 1022 WKBundlePageWillEnterFullScreen(pageRef); 1023 WKBundlePageDidEnterFullScreen(pageRef); 1024 } 1025 1026 void InjectedBundlePage::exitFullScreenForElement(WKBundlePageRef pageRef, WKBundleNodeHandleRef elementRef) 1027 { 1028 InjectedBundle::shared().os() << "exitFullScreenForElement()\n"; 1029 WKBundlePageWillExitFullScreen(pageRef); 1030 WKBundlePageDidExitFullScreen(pageRef); 1031 } 1032 #endif 1033 1001 1034 static bool compareByTargetName(WKBundleBackForwardListItemRef item1, WKBundleBackForwardListItemRef item2) 1002 1035 { -
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
r83550 r84206 117 117 void willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef); 118 118 119 #if ENABLE(FULLSCREEN_API) 120 // Full Screen client 121 static bool supportsFullScreen(WKBundlePageRef, WKFullScreenKeyboardRequestType); 122 static void enterFullScreenForElement(WKBundlePageRef, WKBundleNodeHandleRef element); 123 static void exitFullScreenForElement(WKBundlePageRef, WKBundleNodeHandleRef element); 124 #endif 125 119 126 // Editor client 120 127 static bool shouldBeginEditing(WKBundlePageRef, WKBundleRangeHandleRef, const void* clientInfo); -
trunk/Tools/WebKitTestRunner/TestController.cpp
r84064 r84206 365 365 WKPreferencesSetUniversalAccessFromFileURLsAllowed(preferences, true); 366 366 WKPreferencesSetFileAccessFromFileURLsAllowed(preferences, true); 367 #if ENABLE(FULLSCREEN_API) 368 WKPreferencesSetFullScreenEnabled(preferences, true); 369 #endif 367 370 368 371 static WKStringRef standardFontFamily = WKStringCreateWithUTF8CString("Times");
Note: See TracChangeset
for help on using the changeset viewer.