diff options
author | Kristian Monsen <kristianm@google.com> | 2010-05-21 16:53:46 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-05-25 10:24:15 +0100 |
commit | 6c2af9490927c3c5959b5cb07461b646f8b32f6c (patch) | |
tree | f7111b9b22befab472616c1d50ec94eb50f1ec8c /WebKit/win | |
parent | a149172322a9067c14e8b474a53e63649aa17cad (diff) | |
download | external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.zip external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.tar.gz external_webkit-6c2af9490927c3c5959b5cb07461b646f8b32f6c.tar.bz2 |
Merge WebKit at r59636: Initial merge by git
Change-Id: I59b289c4e6b18425f06ce41cc9d34c522515de91
Diffstat (limited to 'WebKit/win')
-rw-r--r-- | WebKit/win/ChangeLog | 76 | ||||
-rw-r--r-- | WebKit/win/FullscreenVideoController.cpp | 11 | ||||
-rw-r--r-- | WebKit/win/FullscreenVideoController.h | 8 | ||||
-rwxr-xr-x | WebKit/win/Interfaces/IWebFramePrivate.idl | 2 | ||||
-rw-r--r-- | WebKit/win/Interfaces/IWebViewPrivate.idl | 4 | ||||
-rw-r--r-- | WebKit/win/WebFrame.cpp | 36 | ||||
-rw-r--r-- | WebKit/win/WebFrame.h | 5 | ||||
-rw-r--r-- | WebKit/win/WebKit.vcproj/WebKit.sln | 1 | ||||
-rw-r--r-- | WebKit/win/WebView.cpp | 35 | ||||
-rw-r--r-- | WebKit/win/WebView.h | 9 |
10 files changed, 179 insertions, 8 deletions
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index c342ab0..a67e10f 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,3 +1,79 @@ +2010-05-13 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Tim Hatcher. + + <rdar://problem/7982652> + + Allow reporting exceptions that occur when using JavaScriptCore APIs to the Web Inspector. + + * Interfaces/IWebViewPrivate.idl: Add a reportException function off of IWebViewPrivate. + * Interfaces/WebKit.idl: Touch WebKit.idl to make sure Interfaces rebuild. + * WebView.cpp: + (WebView::reportException): Make sure the function was called with a context from a WebView, and call + WebCore::reportException. + * WebView.h: + +2010-05-12 Jer Noble <jer.noble@apple.com> + + Reviewed by Darin Adler. + + Bug 38689: #34005 will break fullscreen video playback + https://bugs.webkit.org/show_bug.cgi?id=38689 + + Use the new definition of PlatformMedia to check the actual type + returned by MediaPlayer. + + * FullscreenVideoController.cpp: + (FullscreenVideoController::movie): + +2010-05-11 Jer Noble <jer.noble@apple.com> + + No Review. + + Fix build error: The QTMovieWin project is dependent on the JavaScriptCore project. + + * WebKit.vcproj/WebKit.sln: + +2010-05-11 Alice Liu <alice.liu@apple.com> + + Rubber-stamped by Gavin Barraclough. + + Fix build error when enabling debugging block in WebKit win painting code + + * WebView.cpp: + (WebView::paintIntoBackingStore): + +2010-05-11 Alice Liu <alice.liu@apple.com> + + Reviewed by Steve Falkenburg. + + https://bugs.webkit.org/show_bug.cgi?id=38937 + W7 window preview paints content at the wrong location + + * WebFrame.cpp: + (WebFrame::paintDocumentRectToContext): Revert r58895 + (WebFrame::paintDocumentRectToContextAtPoint): Added + + * Interfaces/IWebFramePrivate.idl: Added paintDocumentRectToContextAtPoint + * Interfaces/IWebViewPrivate.idl: ditto + * Interfaces/WebKit.idl: touch to rebuild + * WebFrame.h: ditto + * WebView.cpp: ditto + (WebView::paintDocumentRectToContextAtPoint): ditto + * WebView.h: ditto + +2010-05-07 Jer Noble <jer.noble@apple.com> + + Reviewed by Adele Peterson. + + Safari pegs CPU and drops tons of frames using HTML5 Vimeo player + https://bugs.webkit.org/show_bug.cgi?id=34005 + + QTMovieWin is now QTMovieGWorld. + * FullscreenVideoController.cpp: + (FullscreenVideoController::movie): + * FullscreenVideoController.h: + 2010-05-06 Adam Roben <aroben@apple.com> Bail out of WebView::paint when there's nothing to paint diff --git a/WebKit/win/FullscreenVideoController.cpp b/WebKit/win/FullscreenVideoController.cpp index 884f46a..6132fca 100644 --- a/WebKit/win/FullscreenVideoController.cpp +++ b/WebKit/win/FullscreenVideoController.cpp @@ -192,9 +192,16 @@ FullscreenVideoController::~FullscreenVideoController() movie()->exitFullscreen(); } -QTMovieWin* FullscreenVideoController::movie() const +QTMovieGWorld* FullscreenVideoController::movie() const { - return m_mediaElement ? reinterpret_cast<QTMovieWin*>(m_mediaElement->platformMedia().qtMovie) : 0; + if (!m_mediaElement) + return 0; + + PlatformMedia platformMedia = m_mediaElement->platformMedia(); + if (platformMedia.type != PlatformMedia::QTMovieGWorldType) + return 0; + + return platformMedia.media.qtMovieGWorld; } void FullscreenVideoController::setMediaElement(HTMLMediaElement* mediaElement) diff --git a/WebKit/win/FullscreenVideoController.h b/WebKit/win/FullscreenVideoController.h index 60145ad..31acc63 100644 --- a/WebKit/win/FullscreenVideoController.h +++ b/WebKit/win/FullscreenVideoController.h @@ -28,7 +28,7 @@ #if ENABLE(VIDEO) -#include "QTMovieWin.h" +#include "QTMovieGWorld.h" #include <WebCore/HTMLMediaElement.h> #include <WebCore/Image.h> @@ -99,7 +99,7 @@ private: int m_dragStartOffset; }; -class FullscreenVideoController : QTMovieWinFullscreenClient, public Noncopyable { +class FullscreenVideoController : QTMovieGWorldFullscreenClient, public Noncopyable { public: FullscreenVideoController(); virtual ~FullscreenVideoController(); @@ -111,11 +111,11 @@ public: void exitFullscreen(); private: - // QTMovieWinFullscreenClient + // QTMovieGWorldFullscreenClient virtual LRESULT fullscreenClientWndProc(HWND, UINT message, WPARAM, LPARAM); void ensureWindow(); - QTMovieWin* movie() const; + QTMovieGWorld* movie() const; bool canPlay() const; void play(); diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl index 3172ce6..80a3e24 100755 --- a/WebKit/win/Interfaces/IWebFramePrivate.idl +++ b/WebKit/win/Interfaces/IWebFramePrivate.idl @@ -110,4 +110,6 @@ interface IWebFramePrivate : IUnknown HRESULT numberOfPages([in] float pageWidthInPixels, [in] float pageHeightInPixels, [out, retval] int* pageNumber); HRESULT layerTreeAsText([out, retval] BSTR* result); + + HRESULT paintDocumentRectToContextAtPoint([in] RECT rect, [in] POINT pt, [in] OLE_HANDLE deviceContext); } diff --git a/WebKit/win/Interfaces/IWebViewPrivate.idl b/WebKit/win/Interfaces/IWebViewPrivate.idl index 77ef4ac..1bf21d5 100644 --- a/WebKit/win/Interfaces/IWebViewPrivate.idl +++ b/WebKit/win/Interfaces/IWebViewPrivate.idl @@ -233,4 +233,8 @@ interface IWebViewPrivate : IUnknown HRESULT registerURLSchemeAsSecure([in] BSTR scheme); HRESULT nextDisplayIsSynchronous(); + + HRESULT paintDocumentRectToContextAtPoint([in] RECT rect, [in] POINT pt, [in] OLE_HANDLE dc); + + [local] HRESULT reportException([in] JSContextRef context, [in] JSValueRef exception); } diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp index 3d9c8a8..0e8ee80 100644 --- a/WebKit/win/WebFrame.cpp +++ b/WebKit/win/WebFrame.cpp @@ -342,11 +342,45 @@ HRESULT STDMETHODCALLTYPE WebFrame::paintDocumentRectToContext( // We can't paint with a layout still pending. view->layoutIfNeededRecursive(); - HDC dc = (HDC)(ULONG64)deviceContext; + HDC dc = reinterpret_cast<HDC>(static_cast<ULONG64>(deviceContext)); + GraphicsContext gc(dc); + gc.setShouldIncludeChildWindows(true); + gc.save(); + LONG width = rect.right - rect.left; + LONG height = rect.bottom - rect.top; + FloatRect dirtyRect; + dirtyRect.setWidth(width); + dirtyRect.setHeight(height); + gc.clip(dirtyRect); + gc.translate(-rect.left, -rect.top); + view->paintContents(&gc, rect); + gc.restore(); + + return S_OK; +} + +HRESULT STDMETHODCALLTYPE WebFrame::paintDocumentRectToContextAtPoint( + /* [in] */ RECT rect, + /* [in] */ POINT pt, + /* [in] */ OLE_HANDLE deviceContext) +{ + Frame* coreFrame = core(this); + if (!coreFrame) + return E_FAIL; + + FrameView* view = coreFrame->view(); + if (!view) + return E_FAIL; + + // We can't paint with a layout still pending. + view->layoutIfNeededRecursive(); + + HDC dc = reinterpret_cast<HDC>(static_cast<ULONG64>(deviceContext)); GraphicsContext gc(dc); gc.setShouldIncludeChildWindows(true); gc.save(); IntRect dirtyRect(rect); + gc.translate(-pt.x, -pt.y); gc.clip(dirtyRect); view->paintContents(&gc, rect); gc.restore(); diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h index d053d3b..b556192 100644 --- a/WebKit/win/WebFrame.h +++ b/WebKit/win/WebFrame.h @@ -245,6 +245,11 @@ public: /* [in] */ RECT rect, /* [in] */ OLE_HANDLE deviceContext); + virtual HRESULT STDMETHODCALLTYPE paintDocumentRectToContextAtPoint( + /* [in] */ RECT rect, + /* [in] */ POINT pt, + /* [in] */ OLE_HANDLE deviceContext); + virtual HRESULT STDMETHODCALLTYPE elementDoesAutoComplete( /* [in] */ IDOMElement* element, /* [retval][out] */ BOOL* result); diff --git a/WebKit/win/WebKit.vcproj/WebKit.sln b/WebKit/win/WebKit.vcproj/WebKit.sln index 3b641fd..6f437f3 100644 --- a/WebKit/win/WebKit.vcproj/WebKit.sln +++ b/WebKit/win/WebKit.vcproj/WebKit.sln @@ -66,6 +66,7 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QTMovieWin", "..\..\..\WebCore\WebCore.vcproj\QTMovieWin.vcproj", "{E498CA9D-3BD2-4D52-8E37-C8DC76526325}"
ProjectSection(ProjectDependencies) = postProject
{0A324352-B3B6-496C-9E5B-4C7E923E628B} = {0A324352-B3B6-496C-9E5B-4C7E923E628B}
+ {011D10F1-B656-4A1B-A0C3-3842F02122C5} = {011D10F1-B656-4A1B-A0C3-3842F02122C5}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinLauncher", "..\..\..\WebKitTools\WinLauncher\WinLauncher.vcproj", "{114FCA11-216B-4C8C-957E-30A75AE80443}"
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index 3a6a51f..1fbd8d3 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -58,6 +58,7 @@ #include "WebPreferences.h" #include "WebScriptWorld.h" #include "WindowsTouch.h" +#include <JavaScriptCore/APICast.h> #include <JavaScriptCore/InitializeThreading.h> #include <JavaScriptCore/JSLock.h> #include <JavaScriptCore/JSValue.h> @@ -1029,7 +1030,7 @@ void WebView::paintIntoBackingStore(FrameView* frameView, HDC bitmapDC, const In #if FLASH_BACKING_STORE_REDRAW HDC dc = ::GetDC(m_viewWindow); - OwnPtr<HBRUSH> yellowBrush = CreateSolidBrush(RGB(255, 255, 0)); + OwnPtr<HBRUSH> yellowBrush(CreateSolidBrush(RGB(255, 255, 0))); FillRect(dc, &rect, yellowBrush.get()); GdiFlush(); Sleep(50); @@ -5612,6 +5613,38 @@ HRESULT STDMETHODCALLTYPE WebView::paintDocumentRectToContext( return m_mainFrame->paintDocumentRectToContext(rect, deviceContext); } +HRESULT STDMETHODCALLTYPE WebView::paintDocumentRectToContextAtPoint( + /* [in] */ RECT rect, + /* [in] */ POINT pt, + /* [in] */ OLE_HANDLE deviceContext) +{ + if (!deviceContext) + return E_POINTER; + + if (!m_mainFrame) + return E_FAIL; + + return m_mainFrame->paintDocumentRectToContextAtPoint(rect, pt, deviceContext); +} + +HRESULT STDMETHODCALLTYPE WebView::reportException( + /* [in] */ JSContextRef context, + /* [in] */ JSValueRef exception) +{ + if (!context || !exception) + return E_FAIL; + + JSLock lock(JSC::SilenceAssertionsOnly); + JSC::ExecState* execState = toJS(context); + + // Make sure the context has a DOMWindow global object, otherwise this context didn't originate from a WebView. + if (!toJSDOMWindow(execState->lexicalGlobalObject())) + return E_FAIL; + + WebCore::reportException(execState, toJS(execState, exception)); + return S_OK; +} + HRESULT STDMETHODCALLTYPE WebView::setCustomHTMLTokenizerTimeDelay( /* [in] */ double timeDelay) { diff --git a/WebKit/win/WebView.h b/WebKit/win/WebView.h index 7c10039..29f8705 100644 --- a/WebKit/win/WebView.h +++ b/WebKit/win/WebView.h @@ -694,6 +694,15 @@ public: /* [in] */ RECT rect, /* [in] */ OLE_HANDLE dc); + virtual HRESULT STDMETHODCALLTYPE paintDocumentRectToContextAtPoint( + /* [in] */ RECT rect, + /* [in] */ POINT pt, + /* [in] */ OLE_HANDLE dc); + + virtual HRESULT STDMETHODCALLTYPE reportException( + /* [in] */ JSContextRef context, + /* [in] */ JSValueRef exception); + virtual HRESULT STDMETHODCALLTYPE setCustomHTMLTokenizerTimeDelay( /* [in] */ double timeDelay); |