summaryrefslogtreecommitdiffstats
path: root/WebKit/win
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-09-13 16:35:48 +0100
committerIain Merrick <husky@google.com>2010-09-16 12:10:42 +0100
commit5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306 (patch)
treeddce1aa5e3b6967a69691892e500897558ff8ab6 /WebKit/win
parent12bec63ec71e46baba27f0bd9bd9d8067683690a (diff)
downloadexternal_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.zip
external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.gz
external_webkit-5abb8606fa57c3ebfc8b3c3dbc3fa4a25d2ae306.tar.bz2
Merge WebKit at r67178 : Initial merge by git.
Change-Id: I57e01163b6866cb029cdadf405a0394a3918bc18
Diffstat (limited to 'WebKit/win')
-rw-r--r--WebKit/win/ChangeLog139
-rw-r--r--WebKit/win/FullscreenVideoController.cpp3
-rw-r--r--WebKit/win/Interfaces/WebKit.idl1
-rw-r--r--WebKit/win/WebCoreSupport/WebChromeClient.cpp11
-rw-r--r--WebKit/win/WebCoreSupport/WebContextMenuClient.cpp2
-rw-r--r--WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp22
-rw-r--r--WebKit/win/WebCoreSupport/WebInspectorClient.cpp21
-rw-r--r--WebKit/win/WebCoreSupport/WebInspectorClient.h3
-rw-r--r--WebKit/win/WebDataSource.cpp4
-rw-r--r--WebKit/win/WebFrame.cpp9
-rw-r--r--WebKit/win/WebFrame.h2
-rw-r--r--WebKit/win/WebScrollBar.cpp12
-rw-r--r--WebKit/win/WebScrollBar.h2
-rw-r--r--WebKit/win/WebView.cpp12
14 files changed, 215 insertions, 28 deletions
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index b3877dc..b7e49cf 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,142 @@
+2010-09-09 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Scrollbars fail to render in composited iframes.
+ https://bugs.webkit.org/show_bug.cgi?id=45335
+
+ Use LocalWindowsContext when painting scrollbars.
+
+ * WebCoreSupport/WebChromeClient.cpp:
+ (WebChromeClient::paintCustomScrollbar):
+ (WebChromeClient::paintCustomScrollCorner):
+
+2010-09-08 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Move functions from Frame to Editor as planned
+ https://bugs.webkit.org/show_bug.cgi?id=45218
+
+ * WebCoreSupport/WebContextMenuClient.cpp:
+ (WebContextMenuClient::searchWithGoogle):
+ * WebFrame.cpp:
+ (WebFrame::selectedString):
+ * WebView.cpp:
+ (WebView::selectedText):
+ (WebView::prepareCandidateWindow):
+ (WebView::onIMERequestCharPosition):
+ Changed call sites to use editor().
+
+2010-09-08 Peter Kasting <pkasting@google.com>
+
+ Not reviewed, build fix.
+
+ * WebScrollBar.cpp:
+ (WebScrollBar::setScrollOffsetFromAnimation):
+
+2010-09-08 Peter Kasting <pkasting@google.com>
+
+ Not reviewed, build fix.
+
+ * WebScrollBar.cpp:
+ (WebScrollBar::scrollSize):
+ (WebScrollBar::setScrollOffsetFromAnimation):
+
+2010-09-08 Peter Kasting <pkasting@google.com>
+
+ Not reviewed, build fix.
+
+ * WebScrollBar.cpp:
+ (WebScrollBar::setValue):
+ (WebScrollBar::scrollSize):
+ (WebScrollBar::setScrollOffsetFromAnimation):
+ * WebScrollBar.h:
+
+2010-09-08 Adam Barth <abarth@webkit.org>
+
+ Attempted Window build fix.
+
+ * WebDataSource.cpp:
+ (WebDataSource::subresourceForURL):
+
+2010-09-08 Adam Barth <abarth@webkit.org>
+
+ Rubber-stamped by Eric Seidel.
+
+ Rename DocLoader to CachedResourceLoader because that's what it does.
+
+ * WebDataSource.cpp:
+
+2010-09-07 Brent Fulgham <bfulgham@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Clean up a potential resource leak.
+ https://bugs.webkit.org/show_bug.cgi?id=45198
+
+ Several bitmap device context were being created and used,
+ and destroyed without returning the context to its original
+ state. This showed up as bitmap leaks in BoundsChecker.
+
+ * FullscreenVideoController.cpp:
+ * WebView.cpp:
+ (WebView::scrollBackingStore):
+ (WebView::paint):
+
+2010-09-06 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Rename SecurityOrigin::canLoad to canDisplay
+ https://bugs.webkit.org/show_bug.cgi?id=45214
+
+ Propagate name change.
+
+ * WebFrame.cpp:
+ (WebFrame::allowsFollowingLink):
+
+2010-09-03 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Darin Adler.
+
+ Add NetworkingContext to avoid layer violations
+ https://bugs.webkit.org/show_bug.cgi?id=42292
+
+ Add Win's specific implementation of NetworkingContext.
+
+ * WebCoreSupport/WebFrameNetworkingContext.cpp:
+ (WebFrameNetworkingContext::create):
+ (WebFrameNetworkingContext::userAgent):
+ (WebFrameNetworkingContext::referrer):
+ * WebFrame.cpp:
+ (WebFrame::createNetworkingContext):
+ * WebFrame.h:
+
+2010-09-03 Adam Roben <aroben@apple.com>
+
+ Attempt to fixing Windows nightlies again
+
+ The fix in r66438 should be sufficient, but we have to touch
+ WebKit.idl to force that change to be picked up by the build.
+
+ * Interfaces/WebKit.idl: Touched this file to force a build.
+
+2010-09-02 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by PavelFeldman.
+
+ REGRESSION: Crash occurs at objc_msgSend when closing a window that is displaying the web inspector
+ https://bugs.webkit.org/show_bug.cgi?id=44230
+
+ * WebCoreSupport/WebInspectorClient.cpp:
+ (WebInspectorFrontendClient::~WebInspectorFrontendClient):
+ (WebInspectorFrontendClient::closeWindow):
+ (WebInspectorFrontendClient::disconnectFromBackend):
+ (WebInspectorFrontendClient::closeWindowWithoutNotifications):
+ (WebInspectorFrontendClient::destroyInspectorView):
+ * WebCoreSupport/WebInspectorClient.h:
+
2010-09-01 Jessie Berlin <jberlin@apple.com>
Reviewed by Adam Roben.
diff --git a/WebKit/win/FullscreenVideoController.cpp b/WebKit/win/FullscreenVideoController.cpp
index 3aeb1ba..4b50889 100644
--- a/WebKit/win/FullscreenVideoController.cpp
+++ b/WebKit/win/FullscreenVideoController.cpp
@@ -476,7 +476,7 @@ void FullscreenVideoController::draw()
HDC windowDC = GetDC(m_hudWindow);
HDC bitmapDC = CreateCompatibleDC(windowDC);
::ReleaseDC(m_hudWindow, windowDC);
- SelectObject(bitmapDC, m_bitmap.get());
+ HGDIOBJ oldBitmap = SelectObject(bitmapDC, m_bitmap.get());
GraphicsContext context(bitmapDC, true);
@@ -543,6 +543,7 @@ void FullscreenVideoController::draw()
context.restore();
+ ::SelectObject(bitmapDC, oldBitmap);
::DeleteDC(bitmapDC);
}
diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl
index d25cdfe..98f5da8 100644
--- a/WebKit/win/Interfaces/WebKit.idl
+++ b/WebKit/win/Interfaces/WebKit.idl
@@ -300,3 +300,4 @@ library WebKit
[default] interface IWebUserContentURLPattern;
}
}
+
diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index d5aea25..7a025a7 100644
--- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -53,6 +53,7 @@
#endif
#include <WebCore/HTMLNames.h>
#include <WebCore/Icon.h>
+#include <WebCore/LocalWindowsContext.h>
#include <WebCore/LocalizedStrings.h>
#include <WebCore/NotImplemented.h>
#include <WebCore/Page.h>
@@ -705,10 +706,9 @@ bool WebChromeClient::paintCustomScrollbar(GraphicsContext* context, const Float
webState |= WebPressedScrollbarState;
RECT webRect = enclosingIntRect(rect);
- HDC hDC = context->getWindowsContext(webRect);
- HRESULT hr = delegate->paintCustomScrollbar(m_webView, hDC, webRect, webSize, webState, webPressedPart,
+ LocalWindowsContext windowsContext(context, webRect);
+ HRESULT hr = delegate->paintCustomScrollbar(m_webView, windowsContext.hdc(), webRect, webSize, webState, webPressedPart,
vertical, value, proportion, webParts);
- context->releaseWindowsContext(hDC, webRect);
return SUCCEEDED(hr);
}
@@ -722,9 +722,8 @@ bool WebChromeClient::paintCustomScrollCorner(GraphicsContext* context, const Fl
return false;
RECT webRect = enclosingIntRect(rect);
- HDC hDC = context->getWindowsContext(webRect);
- HRESULT hr = delegate->paintCustomScrollCorner(m_webView, hDC, webRect);
- context->releaseWindowsContext(hDC, webRect);
+ LocalWindowsContext windowsContext(context, webRect);
+ HRESULT hr = delegate->paintCustomScrollCorner(m_webView, windowsContext.hdc(), webRect);
return SUCCEEDED(hr);
}
diff --git a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
index 078b725..ca0374a 100644
--- a/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp
@@ -131,7 +131,7 @@ void WebContextMenuClient::downloadURL(const KURL& url)
void WebContextMenuClient::searchWithGoogle(const Frame* frame)
{
- String searchString = frame->selectedText();
+ String searchString = frame->editor()->selectedText();
searchString.stripWhiteSpace();
String encoded = encodeWithURLEscapeSequences(searchString);
encoded.replace("%20", "+");
diff --git a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
index 941cfaa..9fcd4b1 100644
--- a/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
+++ b/WebKit/win/WebCoreSupport/WebFrameNetworkingContext.cpp
@@ -17,5 +17,23 @@
Boston, MA 02110-1301, USA.
*/
-// Checking this file in empty to get the build system work out of the way.
-// Will put the code in here later.
+#include "config.h"
+
+#include "WebFrameNetworkingContext.h"
+
+using namespace WebCore;
+
+PassRefPtr<WebFrameNetworkingContext> WebFrameNetworkingContext::create(Frame* frame, const String& userAgent)
+{
+ return adoptRef(new WebFrameNetworkingContext(frame, userAgent));
+}
+
+String WebFrameNetworkingContext::userAgent() const
+{
+ return m_userAgent;
+}
+
+String WebFrameNetworkingContext::referrer() const
+{
+ return frame()->loader()->referrer();
+}
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
index 34fb827..1b79dde 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp
@@ -228,7 +228,7 @@ WebInspectorFrontendClient::WebInspectorFrontendClient(WebView* inspectedWebView
WebInspectorFrontendClient::~WebInspectorFrontendClient()
{
- destroyInspectorView();
+ destroyInspectorView(true);
}
void WebInspectorFrontendClient::frontendLoaded()
@@ -260,7 +260,12 @@ void WebInspectorFrontendClient::bringToFront()
void WebInspectorFrontendClient::closeWindow()
{
- destroyInspectorView();
+ destroyInspectorView(true);
+}
+
+void WebInspectorFrontendClient::disconnectFromBackend()
+{
+ destroyInspectorView(false);
}
void WebInspectorFrontendClient::attachWindow()
@@ -344,8 +349,6 @@ void WebInspectorFrontendClient::closeWindowWithoutNotifications()
HWND hostWindow;
if (SUCCEEDED(m_inspectedWebView->hostWindow((OLE_HANDLE*)&hostWindow)))
SendMessage(hostWindow, WM_SIZE, 0, 0);
-
- m_inspectorClient->updateHighlight();
}
void WebInspectorFrontendClient::showWindowWithoutNotifications()
@@ -397,16 +400,20 @@ void WebInspectorFrontendClient::showWindowWithoutNotifications()
m_inspectorClient->updateHighlight();
}
-void WebInspectorFrontendClient::destroyInspectorView()
+void WebInspectorFrontendClient::destroyInspectorView(bool notifyInspectorController)
{
if (m_destroyingInspectorView)
return;
m_destroyingInspectorView = true;
- m_inspectedWebView->page()->inspectorController()->disconnectFrontend();
closeWindowWithoutNotifications();
- m_inspectorClient->frontendClosing();
+
+ if (notifyInspectorController) {
+ m_inspectedWebView->page()->inspectorController()->disconnectFrontend();
+ m_inspectorClient->updateHighlight();
+ m_inspectorClient->frontendClosing();
+ }
::DestroyWindow(m_frontendHwnd);
}
diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.h b/WebKit/win/WebCoreSupport/WebInspectorClient.h
index 4da3984..0c38247 100644
--- a/WebKit/win/WebCoreSupport/WebInspectorClient.h
+++ b/WebKit/win/WebCoreSupport/WebInspectorClient.h
@@ -93,6 +93,7 @@ public:
virtual void bringToFront();
virtual void closeWindow();
+ virtual void disconnectFromBackend();
virtual void attachWindow();
virtual void detachWindow();
@@ -106,7 +107,7 @@ private:
void closeWindowWithoutNotifications();
void showWindowWithoutNotifications();
- void destroyInspectorView();
+ void destroyInspectorView(bool notifyInspectorController);
void updateWindowTitle();
diff --git a/WebKit/win/WebDataSource.cpp b/WebKit/win/WebDataSource.cpp
index 566f174..0350373 100644
--- a/WebKit/win/WebDataSource.cpp
+++ b/WebKit/win/WebDataSource.cpp
@@ -39,7 +39,7 @@
#include "WebResource.h"
#include "WebURLResponse.h"
#include <WebCore/BString.h>
-#include <WebCore/DocLoader.h>
+#include <WebCore/CachedResourceLoader.h>
#include <WebCore/Document.h>
#include <WebCore/Frame.h>
#include <WebCore/FrameLoader.h>
@@ -297,7 +297,7 @@ HRESULT STDMETHODCALLTYPE WebDataSource::subresourceForURL(
if (!doc)
return E_FAIL;
- CachedResource *cachedResource = doc->docLoader()->cachedResource(String(url));
+ CachedResource *cachedResource = doc->cachedResourceLoader()->cachedResource(String(url));
if (!cachedResource)
return E_FAIL;
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index d12989b..014ea15 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -42,6 +42,7 @@
#include "WebDownload.h"
#include "WebEditorClient.h"
#include "WebError.h"
+#include "WebFrameNetworkingContext.h"
#include "WebFramePolicyListener.h"
#include "WebHistory.h"
#include "WebHistoryItem.h"
@@ -1044,7 +1045,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::selectedString(
if (!coreFrame)
return E_FAIL;
- String text = coreFrame->displayStringModifiedByEncoding(coreFrame->selectedText());
+ String text = coreFrame->displayStringModifiedByEncoding(coreFrame->editor()->selectedText());
*result = BString(text).release();
return S_OK;
@@ -1352,7 +1353,7 @@ HRESULT WebFrame::allowsFollowingLink(BSTR url, BOOL* result)
if (!frame)
return E_FAIL;
- *result = SecurityOrigin::canLoad(MarshallingHelpers::BSTRToKURL(url), String(), frame->document());
+ *result = SecurityOrigin::canDisplay(MarshallingHelpers::BSTRToKURL(url), String(), frame->document());
return S_OK;
}
@@ -2614,3 +2615,7 @@ void WebFrame::updateBackground()
coreFrame->view()->updateBackgroundRecursively(backgroundColor, webView()->transparent());
}
+PassRefPtr<FrameNetworkingContext> WebFrame::createNetworkingContext()
+{
+ return WebFrameNetworkingContext::create(core(this), userAgent(url()));
+}
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index 24a7e2b..f4795c8 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -343,6 +343,8 @@ public:
virtual void registerForIconNotification(bool listen);
+ virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
+
// WebFrame
PassRefPtr<WebCore::Frame> init(IWebView*, WebCore::Page*, WebCore::HTMLFrameOwnerElement*);
WebCore::Frame* impl();
diff --git a/WebKit/win/WebScrollBar.cpp b/WebKit/win/WebScrollBar.cpp
index ccf40d9..8613c1c 100644
--- a/WebKit/win/WebScrollBar.cpp
+++ b/WebKit/win/WebScrollBar.cpp
@@ -143,7 +143,7 @@ HRESULT STDMETHODCALLTYPE WebScrollBar::setRect(
HRESULT STDMETHODCALLTYPE WebScrollBar::setValue(
/* [in] */ int value)
{
- m_scrollBar->setValue(value);
+ m_scrollBar->setValue(value, Scrollbar::NotFromScrollAnimator);
return S_OK;
}
@@ -252,6 +252,16 @@ HRESULT STDMETHODCALLTYPE WebScrollBar::scroll(
}
// ScrollbarClient -------------------------------------------------------
+int WebScrollBar::scrollSize(ScrollbarOrientation orientation) const
+{
+ return (orientation == m_scrollBar->orientation()) ? (m_scrollBar->totalSize() - m_scrollBar->visibleSize()) : 0;
+}
+
+void WebScrollBar::setScrollOffsetFromAnimation(const IntPoint& offset)
+{
+ m_scrollBar->setValue((m_scrollBar->orientation() == HorizontalScrollbar) ? offset.x() : offset.y(), Scrollbar::FromScrollAnimator);
+}
+
void WebScrollBar::valueChanged(Scrollbar* scrollBar)
{
if (m_scrollBar != scrollBar) {
diff --git a/WebKit/win/WebScrollBar.h b/WebKit/win/WebScrollBar.h
index 0fed8a3..90f2491 100644
--- a/WebKit/win/WebScrollBar.h
+++ b/WebKit/win/WebScrollBar.h
@@ -116,6 +116,8 @@ public:
protected:
// ScrollbarClient
+ virtual int scrollSize(ScrollbarOrientation orientation) const;
+ virtual void setScrollOffsetFromAnimation(const IntPoint&);
virtual void valueChanged(Scrollbar*);
virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index 5aa4fc4..0a1e334 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -826,7 +826,7 @@ void WebView::scrollBackingStore(FrameView* frameView, int dx, int dy, const Int
// Collect our device context info and select the bitmap to scroll.
HDC windowDC = ::GetDC(m_viewWindow);
HDC bitmapDC = ::CreateCompatibleDC(windowDC);
- ::SelectObject(bitmapDC, m_backingStoreBitmap->handle());
+ HGDIOBJ oldBitmap = ::SelectObject(bitmapDC, m_backingStoreBitmap->handle());
// Scroll the bitmap.
RECT scrollRectWin(scrollViewRect);
@@ -848,6 +848,7 @@ void WebView::scrollBackingStore(FrameView* frameView, int dx, int dy, const Int
updateBackingStore(frameView, bitmapDC, false);
// Clean up.
+ ::SelectObject(bitmapDC, oldBitmap);
::DeleteDC(bitmapDC);
::ReleaseDC(m_viewWindow, windowDC);
}
@@ -987,7 +988,7 @@ void WebView::paint(HDC dc, LPARAM options)
m_paintCount++;
HDC bitmapDC = ::CreateCompatibleDC(hdc);
- ::SelectObject(bitmapDC, m_backingStoreBitmap->handle());
+ HGDIOBJ oldBitmap = ::SelectObject(bitmapDC, m_backingStoreBitmap->handle());
// Update our backing store if needed.
updateBackingStore(frameView, bitmapDC, backingStoreCompletelyDirty, windowsToPaint);
@@ -1012,6 +1013,7 @@ void WebView::paint(HDC dc, LPARAM options)
updateRootLayerContents();
#endif
+ ::SelectObject(bitmapDC, oldBitmap);
::DeleteDC(bitmapDC);
if (!dc)
@@ -3545,7 +3547,7 @@ HRESULT STDMETHODCALLTYPE WebView::selectedText(
if (!focusedFrame)
return E_FAIL;
- String frameSelectedText = focusedFrame->selectedText();
+ String frameSelectedText = focusedFrame->editor()->selectedText();
*text = SysAllocStringLen(frameSelectedText.characters(), frameSelectedText.length());
if (!*text && frameSelectedText.length())
return E_OUTOFMEMORY;
@@ -5265,7 +5267,7 @@ void WebView::prepareCandidateWindow(Frame* targetFrame, HIMC hInputContext)
if (RefPtr<Range> range = targetFrame->selection()->selection().toNormalizedRange()) {
ExceptionCode ec = 0;
RefPtr<Range> tempRange = range->cloneRange(ec);
- caret = targetFrame->firstRectForRange(tempRange.get());
+ caret = targetFrame->editor()->firstRectForRange(tempRange.get());
}
caret = targetFrame->view()->contentsToWindow(caret);
CANDIDATEFORM form;
@@ -5536,7 +5538,7 @@ LRESULT WebView::onIMERequestCharPosition(Frame* targetFrame, IMECHARPOSITION* c
ExceptionCode ec = 0;
RefPtr<Range> tempRange = range->cloneRange(ec);
tempRange->setStart(tempRange->startContainer(ec), tempRange->startOffset(ec) + charPos->dwCharPos, ec);
- caret = targetFrame->firstRectForRange(tempRange.get());
+ caret = targetFrame->editor()->firstRectForRange(tempRange.get());
}
caret = targetFrame->view()->contentsToWindow(caret);
charPos->pt.x = caret.x();