diff options
Diffstat (limited to 'WebKit/win')
-rw-r--r-- | WebKit/win/ChangeLog | 64 | ||||
-rw-r--r-- | WebKit/win/FullscreenVideoController.cpp | 4 | ||||
-rwxr-xr-x | WebKit/win/WebKit.vcproj/WebKit.make | 1 | ||||
-rw-r--r-- | WebKit/win/WebKit.vcproj/WebKit.rc | 2 | ||||
-rw-r--r-- | WebKit/win/WebView.cpp | 102 | ||||
-rw-r--r-- | WebKit/win/WebView.h | 4 |
6 files changed, 173 insertions, 4 deletions
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index 6cc5d6e..36d3144 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,3 +1,67 @@ +2010-02-03 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Steve Falkenburg. + + Scroll does not work with IBM Thinkpad. + <https://bugs.webkit.org/show_bug.cgi?id=14227> + <rdar://7142545> + + When initializing the WebView, add two scrollbar Windows inside of + our WebView, to allow it to receive WM_VSCROLL and WM_HSCROLL events. + (similar to what Firefox did in: <https://bugzilla.mozilla.org/show_bug.cgi?id=507222>. + + Only do this if the user has installed some kind of Trackpoint driver, using an algorithm + like <https://bugzilla.mozilla.org/show_bug.cgi?id=514927>. + + Also, add code to handle WM_HSCROLL and WM_VSCROLL messages to scroll + the WebView. + + * WebView.cpp: + (WebView::verticalScroll): Handle the WM_VSCROLL messages, and scroll up and down + by lines or pages. + (WebView::horizontalScroll): Handle the WM_HSCROLL messages, and scroll left or right + by lines or pages. + (WebView::WebViewWndProc): Add cases for WM_VSCROLL and WM_HSCROLL. + (WebView::initWithFrame): Call shouldInitializeTrackPointHack, and if we should, create + vertical and horizontal scrollbars to receive WM_VSCROLL and WM_HSCROLL messages. + (WebView::shouldInitializeTrackPointHack): Check if there is a registry key for + the some kind of IBM Trackpoint driver. + * WebView.h: + +2010-02-02 Steve Falkenburg <sfalken@apple.com> + + Reviewed by Darin Adler. + + Copyright year updating for Windows version resources should be automatic + https://bugs.webkit.org/show_bug.cgi?id=34503 + + * WebKit.vcproj/WebKit.rc: + +2010-02-02 Adam Roben <aroben@apple.com> + + Stop copying WebCore's IDL files from SRCROOT to OBJROOT + + WebKit doesn't use these anymore (as of r52921). + + Part of Bug 34496: Clean up WebCore's IDL/script copying + <https://bugs.webkit.org/show_bug.cgi?id=34496> + + Reviewed by Steve Falkenburg. + + * WebKit.vcproj/WebKit.make: + +2010-01-29 Gavin Barraclough <barraclough@apple.com> + + Reviewed by Sam Weinig + Oliver Hunt. + + Bug 34346 - With JSC bindings, make processingUserGesture work with events in Isolated Worlds + + Pass processeing user gensture flag to media play/pause methods. + + * FullscreenVideoController.cpp: + (FullscreenVideoController::play): + (FullscreenVideoController::pause): + 2010-01-29 Brian Weinstein <bweinstein@apple.com> Reviewed by Adam Roben. diff --git a/WebKit/win/FullscreenVideoController.cpp b/WebKit/win/FullscreenVideoController.cpp index 6b8e5ac..dbfc794 100644 --- a/WebKit/win/FullscreenVideoController.cpp +++ b/WebKit/win/FullscreenVideoController.cpp @@ -243,13 +243,13 @@ bool FullscreenVideoController::canPlay() const void FullscreenVideoController::play() { if (m_mediaElement) - m_mediaElement->play(); + m_mediaElement->play(m_mediaElement->processingUserGesture()); } void FullscreenVideoController::pause() { if (m_mediaElement) - m_mediaElement->pause(); + m_mediaElement->pause(m_mediaElement->processingUserGesture()); } float FullscreenVideoController::volume() const diff --git a/WebKit/win/WebKit.vcproj/WebKit.make b/WebKit/win/WebKit.vcproj/WebKit.make index 072d724..6c2ce85 100755 --- a/WebKit/win/WebKit.vcproj/WebKit.make +++ b/WebKit/win/WebKit.vcproj/WebKit.make @@ -8,7 +8,6 @@ install: set WebKitLibrariesDir=$(SRCROOT)\AppleInternal set WebKitOutputDir=$(OBJROOT) set PRODUCTION=1 - xcopy "$(SRCROOT)\AppleInternal\obj\WebKit\DOMInterfaces\*" "$(OBJROOT)\obj\WebKit\DOMInterfaces" /e/v/i/h/y devenv "WebKit.submit.sln" /rebuild $(BUILDSTYLE) -xcopy "$(OBJROOT)\bin\*.exe" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y xcopy "$(OBJROOT)\bin\*.pdb" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y diff --git a/WebKit/win/WebKit.vcproj/WebKit.rc b/WebKit/win/WebKit.vcproj/WebKit.rc index fa57ca3..92d1e6c 100644 --- a/WebKit/win/WebKit.vcproj/WebKit.rc +++ b/WebKit/win/WebKit.vcproj/WebKit.rc @@ -42,7 +42,7 @@ BEGIN VALUE "FileVersion", __VERSION_TEXT__ VALUE "CompanyName", "Apple Inc." VALUE "InternalName", "WebKit" - VALUE "LegalCopyright", "Copyright Apple Inc. 2003-2010" + VALUE "LegalCopyright", "Copyright Apple Inc. 2003-" __COPYRIGHT_YEAR_END_TEXT__ VALUE "OriginalFilename", "WebKit.dll" VALUE "ProductName", "WebKit" VALUE "ProductVersion", __BUILD_NUMBER_SHORT__ diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index 4d67110..6144532 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -1589,6 +1589,66 @@ bool WebView::mouseWheel(WPARAM wParam, LPARAM lParam, bool isMouseHWheel) return coreFrame->eventHandler()->handleWheelEvent(wheelEvent); } +bool WebView::verticalScroll(WPARAM wParam, LPARAM /*lParam*/) +{ + ScrollDirection direction; + ScrollGranularity granularity; + switch (LOWORD(wParam)) { + case SB_LINEDOWN: + granularity = ScrollByLine; + direction = ScrollDown; + break; + case SB_LINEUP: + granularity = ScrollByLine; + direction = ScrollUp; + break; + case SB_PAGEDOWN: + granularity = ScrollByDocument; + direction = ScrollDown; + break; + case SB_PAGEUP: + granularity = ScrollByDocument; + direction = ScrollUp; + break; + default: + return false; + break; + } + + Frame* frame = m_page->focusController()->focusedOrMainFrame(); + return frame->eventHandler()->scrollRecursively(direction, granularity); +} + +bool WebView::horizontalScroll(WPARAM wParam, LPARAM /*lParam*/) +{ + ScrollDirection direction; + ScrollGranularity granularity; + switch (LOWORD(wParam)) { + case SB_LINELEFT: + granularity = ScrollByLine; + direction = ScrollLeft; + break; + case SB_LINERIGHT: + granularity = ScrollByLine; + direction = ScrollRight; + break; + case SB_PAGELEFT: + granularity = ScrollByDocument; + direction = ScrollLeft; + break; + case SB_PAGERIGHT: + granularity = ScrollByDocument; + direction = ScrollRight; + break; + default: + return false; + } + + Frame* frame = m_page->focusController()->focusedOrMainFrame(); + return frame->eventHandler()->scrollRecursively(direction, granularity); +} + + bool WebView::execCommand(WPARAM wParam, LPARAM /*lParam*/) { Frame* frame = m_page->focusController()->focusedOrMainFrame(); @@ -2155,6 +2215,12 @@ LRESULT CALLBACK WebView::WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, break; __fallthrough; + case WM_VSCROLL: + handled = webView->verticalScroll(wParam, lParam); + break; + case WM_HSCROLL: + handled = webView->horizontalScroll(wParam, lParam); + break; default: handled = false; break; @@ -2387,6 +2453,34 @@ static void WebKitSetApplicationCachePathIfNecessary() initialized = true; } + +bool WebView::shouldInitializeTrackPointHack() +{ + static bool shouldCreateScrollbars; + static bool hasRunTrackPointCheck; + + if (hasRunTrackPointCheck) + return shouldCreateScrollbars; + + hasRunTrackPointCheck = true; + const TCHAR trackPointKeys[][50] = { TEXT("Software\\Lenovo\\TrackPoint"), + TEXT("Software\\Lenovo\\UltraNav"), + TEXT("Software\\Alps\\Apoint\\TrackPoint"), + TEXT("Software\\Synaptics\\SynTPEnh\\UltraNavUSB"), + TEXT("Software\\Synaptics\\SynTPEnh\\UltraNavPS2") }; + + for (int i = 0; i < 5; ++i) { + HKEY trackPointKey; + int readKeyResult = ::RegOpenKeyEx(HKEY_CURRENT_USER, trackPointKeys[i], 0, KEY_READ, &trackPointKey); + ::RegCloseKey(trackPointKey); + if (readKeyResult == ERROR_SUCCESS) { + shouldCreateScrollbars = true; + return shouldCreateScrollbars; + } + } + + return shouldCreateScrollbars; +} HRESULT STDMETHODCALLTYPE WebView::initWithFrame( /* [in] */ RECT frame, @@ -2404,6 +2498,14 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame( frame.left, frame.top, frame.right - frame.left, frame.bottom - frame.top, m_hostWindow ? m_hostWindow : HWND_MESSAGE, 0, gInstance, 0); ASSERT(::IsWindow(m_viewWindow)); + if (shouldInitializeTrackPointHack()) { + // If we detected a registry key belonging to a TrackPoint driver, then create fake trackpoint + // scrollbars, so the WebView will receive WM_VSCROLL and WM_HSCROLL messages. We create one + // vertical scrollbar and one horizontal to allow for receiving both types of messages. + ::CreateWindow(TEXT("SCROLLBAR"), TEXT("FAKETRACKPOINTHSCROLLBAR"), WS_CHILD | WS_VISIBLE | SBS_HORZ, 0, 0, 0, 0, m_viewWindow, 0, gInstance, 0); + ::CreateWindow(TEXT("SCROLLBAR"), TEXT("FAKETRACKPOINTVSCROLLBAR"), WS_CHILD | WS_VISIBLE | SBS_VERT, 0, 0, 0, 0, m_viewWindow, 0, gInstance, 0); + } + hr = registerDragDrop(); if (FAILED(hr)) return hr; diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h index cd857a8..56fb40c 100644 --- a/WebKit/win/WebView.h +++ b/WebKit/win/WebView.h @@ -793,6 +793,8 @@ public: bool onUninitMenuPopup(WPARAM, LPARAM); void performContextMenuAction(WPARAM, LPARAM, bool byPosition); bool mouseWheel(WPARAM, LPARAM, bool isMouseHWheel); + bool verticalScroll(WPARAM, LPARAM); + bool horizontalScroll(WPARAM, LPARAM); bool gesture(WPARAM, LPARAM); bool gestureNotify(WPARAM, LPARAM); bool execCommand(WPARAM wParam, LPARAM lParam); @@ -919,6 +921,8 @@ protected: LRESULT onIMERequestReconvertString(WebCore::Frame*, RECONVERTSTRING*); bool developerExtrasEnabled() const; + bool shouldInitializeTrackPointHack(); + // AllWebViewSet functions void addToAllWebViewsSet(); void removeFromAllWebViewsSet(); |