HostWindow invalidation functions should use root view coordinates
https://bugs.webkit.org/show_bug.cgi?id=72338

Reviewed by Dan Bernstein.

Source/WebCore:

Rename invalidateWindow to invalidateRootView, and invalidateContentsAndWindow
to invalidateContentsAndRootView. Make sure that the rects passed to the renamed functions
are in root view coordinates by changing contentsToWindow calls to contentsToRootView.

In practice this doesn't matter because for all platforms except Mac WebKit1, root view coordinates
and window coordinates are equivalent, and Mac WebKit1 doesn't use these invalidation functions.

* loader/EmptyClients.h:
* page/Chrome.cpp:
(WebCore::Chrome::invalidateRootView):
(WebCore::Chrome::invalidateContentsAndRootView):
* page/Chrome.h:
* page/ChromeClient.h:
* page/Frame.cpp:
(WebCore::Frame::tiledBackingStorePaintEnd):
* page/FrameView.cpp:
(WebCore::FrameView::invalidateRect):
(WebCore::FrameView::scrollContentsFastPath):
* platform/HostWindow.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::rectToCopyOnScroll):
(WebCore::ScrollView::scrollContents):
(WebCore::ScrollView::wheelEvent):
* platform/chromium/FramelessScrollView.cpp:
(WebCore::FramelessScrollView::invalidateRect):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImageChromeClient::invalidateContentsAndRootView):

Source/WebKit/chromium:

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::invalidateRootView):
(WebKit::ChromeClientImpl::invalidateContentsAndRootView):
(WebKit::ChromeClientImpl::invalidateContentsForSlowScroll):
* src/ChromeClientImpl.h:
* src/WebPopupMenuImpl.cpp:
(WebKit::WebPopupMenuImpl::invalidateRootView):
(WebKit::WebPopupMenuImpl::invalidateContentsAndRootView):
(WebKit::WebPopupMenuImpl::invalidateContentsForSlowScroll):
* src/WebPopupMenuImpl.h:

Source/WebKit/efl:

* WebCoreSupport/ChromeClientEfl.cpp:
(WebCore::ChromeClientEfl::invalidateRootView):
(WebCore::ChromeClientEfl::invalidateContentsAndRootView):
(WebCore::ChromeClientEfl::invalidateContentsForSlowScroll):
* WebCoreSupport/ChromeClientEfl.h:

Source/WebKit/gtk:

* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit::ChromeClient::invalidateRootView):
(WebKit::ChromeClient::invalidateContentsAndRootView):
(WebKit::ChromeClient::invalidateContentsForSlowScroll):
* WebCoreSupport/ChromeClientGtk.h:

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::invalidateRootView):
(WebChromeClient::invalidateContentsAndRootView):
(WebChromeClient::invalidateContentsForSlowScroll):

Source/WebKit/qt:

* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::invalidateRootView):
(WebCore::ChromeClientQt::invalidateContentsAndRootView):
(WebCore::ChromeClientQt::invalidateContentsForSlowScroll):
* WebCoreSupport/ChromeClientQt.h:

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::invalidateRootView):
(WebChromeClient::invalidateContentsAndRootView):
* WebCoreSupport/WebChromeClient.h:

Source/WebKit/wince:

* WebCoreSupport/ChromeClientWinCE.cpp:
(WebKit::ChromeClientWinCE::invalidateRootView):
(WebKit::ChromeClientWinCE::invalidateContentsAndRootView):
(WebKit::ChromeClientWinCE::invalidateContentsForSlowScroll):
(WebKit::ChromeClientWinCE::scroll):
* WebCoreSupport/ChromeClientWinCE.h:

Source/WebKit/wx:

* WebKitSupport/ChromeClientWx.cpp:
(WebCore::ChromeClientWx::invalidateRootView):
(WebCore::ChromeClientWx::invalidateContentsForSlowScroll):
(WebCore::ChromeClientWx::invalidateContentsAndRootView):
* WebKitSupport/ChromeClientWx.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::invalidateRootView):
(WebKit::WebChromeClient::invalidateContentsAndRootView):
* WebProcess/WebCoreSupport/WebChromeClient.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 3b68b60..c5c9ea2 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,38 @@
+2011-11-14  Anders Carlsson  <andersca@apple.com>
+
+        HostWindow invalidation functions should use root view coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=72338
+
+        Reviewed by Dan Bernstein.
+
+        Rename invalidateWindow to invalidateRootView, and invalidateContentsAndWindow
+        to invalidateContentsAndRootView. Make sure that the rects passed to the renamed functions
+        are in root view coordinates by changing contentsToWindow calls to contentsToRootView.
+        
+        In practice this doesn't matter because for all platforms except Mac WebKit1, root view coordinates
+        and window coordinates are equivalent, and Mac WebKit1 doesn't use these invalidation functions.
+
+        * loader/EmptyClients.h:
+        * page/Chrome.cpp:
+        (WebCore::Chrome::invalidateRootView):
+        (WebCore::Chrome::invalidateContentsAndRootView):
+        * page/Chrome.h:
+        * page/ChromeClient.h:
+        * page/Frame.cpp:
+        (WebCore::Frame::tiledBackingStorePaintEnd):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::invalidateRect):
+        (WebCore::FrameView::scrollContentsFastPath):
+        * platform/HostWindow.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::rectToCopyOnScroll):
+        (WebCore::ScrollView::scrollContents):
+        (WebCore::ScrollView::wheelEvent):
+        * platform/chromium/FramelessScrollView.cpp:
+        (WebCore::FramelessScrollView::invalidateRect):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImageChromeClient::invalidateContentsAndRootView):
+
 2011-11-15  Philip Rogers  <pdr@google.com>
 
         Implement maxWidth for fillText and strokeText, fixing the canvas/philip/tests/2d.text.draw.fill.maxWidth.fontface.html test.
diff --git a/Source/WebCore/loader/EmptyClients.h b/Source/WebCore/loader/EmptyClients.h
index 13cc08f..d863673 100644
--- a/Source/WebCore/loader/EmptyClients.h
+++ b/Source/WebCore/loader/EmptyClients.h
@@ -157,9 +157,9 @@
 
     virtual IntRect windowResizerRect() const { return IntRect(); }
 
-    virtual void invalidateWindow(const IntRect&, bool) { }
-    virtual void invalidateContentsAndWindow(const IntRect&, bool) { }
-    virtual void invalidateContentsForSlowScroll(const IntRect&, bool) {};
+    virtual void invalidateRootView(const IntRect&, bool) OVERRIDE { }
+    virtual void invalidateContentsAndRootView(const IntRect&, bool) OVERRIDE { }
+    virtual void invalidateContentsForSlowScroll(const IntRect&, bool) OVERRIDE { }
     virtual void scroll(const IntSize&, const IntRect&, const IntRect&) { }
 #if USE(TILED_BACKING_STORE)
     virtual void delegatedScrollRequested(const IntPoint&) { }
diff --git a/Source/WebCore/page/Chrome.cpp b/Source/WebCore/page/Chrome.cpp
index 6d0da8f..1d38603 100644
--- a/Source/WebCore/page/Chrome.cpp
+++ b/Source/WebCore/page/Chrome.cpp
@@ -71,14 +71,14 @@
     m_client->chromeDestroyed();
 }
 
-void Chrome::invalidateWindow(const IntRect& updateRect, bool immediate)
+void Chrome::invalidateRootView(const IntRect& updateRect, bool immediate)
 {
-    m_client->invalidateWindow(updateRect, immediate);
+    m_client->invalidateRootView(updateRect, immediate);
 }
 
-void Chrome::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
+void Chrome::invalidateContentsAndRootView(const IntRect& updateRect, bool immediate)
 {
-    m_client->invalidateContentsAndWindow(updateRect, immediate);
+    m_client->invalidateContentsAndRootView(updateRect, immediate);
 }
 
 void Chrome::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
diff --git a/Source/WebCore/page/Chrome.h b/Source/WebCore/page/Chrome.h
index 51c5922..044eb6c 100644
--- a/Source/WebCore/page/Chrome.h
+++ b/Source/WebCore/page/Chrome.h
@@ -69,8 +69,8 @@
 
         // HostWindow methods.
 
-        virtual void invalidateWindow(const IntRect&, bool);
-        virtual void invalidateContentsAndWindow(const IntRect&, bool);
+        virtual void invalidateRootView(const IntRect&, bool) OVERRIDE;
+        virtual void invalidateContentsAndRootView(const IntRect&, bool) OVERRIDE;
         virtual void invalidateContentsForSlowScroll(const IntRect&, bool);
         virtual void scroll(const IntSize&, const IntRect&, const IntRect&);
 #if USE(TILED_BACKING_STORE)
diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h
index 7ccb77a..3aca311 100644
--- a/Source/WebCore/page/ChromeClient.h
+++ b/Source/WebCore/page/ChromeClient.h
@@ -146,8 +146,8 @@
         virtual IntRect windowResizerRect() const = 0;
 
         // Methods used by HostWindow.
-        virtual void invalidateWindow(const IntRect&, bool) = 0;
-        virtual void invalidateContentsAndWindow(const IntRect&, bool) = 0;
+        virtual void invalidateRootView(const IntRect&, bool) = 0;
+        virtual void invalidateContentsAndRootView(const IntRect&, bool) = 0;
         virtual void invalidateContentsForSlowScroll(const IntRect&, bool) = 0;
         virtual void scroll(const IntSize&, const IntRect&, const IntRect&) = 0;
 #if USE(TILED_BACKING_STORE)
diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp
index df2d70c..e353b49 100644
--- a/Source/WebCore/page/Frame.cpp
+++ b/Source/WebCore/page/Frame.cpp
@@ -929,7 +929,7 @@
     unsigned size = paintedArea.size();
     // Request repaint from the system
     for (int n = 0; n < size; ++n)
-        m_page->chrome()->invalidateContentsAndWindow(m_view->contentsToWindow(paintedArea[n]), false);
+        m_page->chrome()->invalidateContentsAndRootView(m_view->contentsToRootView(paintedArea[n]), false);
 }
 
 IntRect Frame::tiledBackingStoreContentsRect()
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index e605c7e..44aad99 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -377,7 +377,7 @@
 {
     if (!parent()) {
         if (hostWindow())
-            hostWindow()->invalidateContentsAndWindow(rect, false /*immediate*/);
+            hostWindow()->invalidateContentsAndRootView(rect, false /*immediate*/);
         return;
     }
 
@@ -1452,7 +1452,7 @@
         if (renderBox->style()->position() != FixedPosition)
             continue;
         IntRect updateRect = renderBox->layer()->repaintRectIncludingDescendants();
-        updateRect = contentsToWindow(updateRect);
+        updateRect = contentsToRootView(updateRect);
         if (!isCompositedContentLayer && clipsRepaints())
             updateRect.intersect(rectToScroll);
         if (!updateRect.isEmpty()) {
@@ -1478,7 +1478,7 @@
             updateRect.unite(scrolledRect);
 #if USE(ACCELERATED_COMPOSITING)
             if (isCompositedContentLayer) {
-                updateRect = windowToContents(updateRect);
+                updateRect = rootViewToContents(updateRect);
                 RenderView* root = rootRenderer(this);
                 ASSERT(root);
                 root->layer()->setBackingNeedsRepaintInRect(updateRect);
@@ -1487,7 +1487,7 @@
 #endif
             if (clipsRepaints())
                 updateRect.intersect(rectToScroll);
-            hostWindow()->invalidateContentsAndWindow(updateRect, false);
+            hostWindow()->invalidateContentsAndRootView(updateRect, false);
         }
         return true;
     }
diff --git a/Source/WebCore/platform/HostWindow.h b/Source/WebCore/platform/HostWindow.h
index ad25185..15c3c71 100644
--- a/Source/WebCore/platform/HostWindow.h
+++ b/Source/WebCore/platform/HostWindow.h
@@ -38,16 +38,16 @@
     HostWindow() { }
     virtual ~HostWindow() { }
 
-    // Requests the host invalidate the window, not the contents.  If immediate is true do so synchronously, otherwise async.
-    virtual void invalidateWindow(const IntRect& updateRect, bool immediate) = 0;
+    // Requests the host invalidate the root view, not the contents. If immediate is true do so synchronously, otherwise async.
+    virtual void invalidateRootView(const IntRect& updateRect, bool immediate) = 0;
 
-    // Requests the host invalidate the contents and the window.  If immediate is true do so synchronously, otherwise async.
-    virtual void invalidateContentsAndWindow(const IntRect& updateRect, bool immediate) = 0;
+    // Requests the host invalidate the contents and the root view. If immediate is true do so synchronously, otherwise async.
+    virtual void invalidateContentsAndRootView(const IntRect& updateRect, bool immediate) = 0;
 
     // Requests the host scroll backingstore by the specified delta, rect to scroll, and clip rect.
     virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) = 0;
 
-    // Requests the host invalidate the contents, not the window.  This is the slow path for scrolling.
+    // Requests the host invalidate the contents, not the root view. This is the slow path for scrolling.
     virtual void invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate) = 0;
 
 #if USE(TILED_BACKING_STORE)
diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp
index 5556394..4f2fe46 100644
--- a/Source/WebCore/platform/ScrollView.cpp
+++ b/Source/WebCore/platform/ScrollView.cpp
@@ -603,7 +603,7 @@
 
 IntRect ScrollView::rectToCopyOnScroll() const
 {
-    IntRect scrollViewRect = convertToContainingWindow(IntRect(0, 0, visibleWidth(), visibleHeight()));
+    IntRect scrollViewRect = convertToRootView(IntRect(0, 0, visibleWidth(), visibleHeight()));
     if (hasOverlayScrollbars()) {
         int verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVerticalScrollbar()) ? verticalScrollbar()->width() : 0;
         int horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHorizontalScrollbar()) ? horizontalScrollbar()->height() : 0;
@@ -626,8 +626,8 @@
     IntRect updateRect = clipRect;
     updateRect.intersect(scrollViewRect);
 
-    // Invalidate the window (not the backing store).
-    hostWindow()->invalidateWindow(updateRect, false /*immediate*/);
+    // Invalidate the root view (not the backing store).
+    hostWindow()->invalidateRootView(updateRect, false /*immediate*/);
 
     if (m_drawPanScrollIcon) {
         // FIXME: the pan icon is broken when accelerated compositing is on, since it will draw under the compositing layers.
@@ -636,7 +636,7 @@
         IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
         IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation, IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
         panScrollIconDirtyRect.intersect(clipRect);
-        hostWindow()->invalidateContentsAndWindow(panScrollIconDirtyRect, false /*immediate*/);
+        hostWindow()->invalidateContentsAndRootView(panScrollIconDirtyRect, false /*immediate*/);
     }
 
     if (canBlitOnScroll()) { // The main frame can just blit the WebView window
@@ -662,15 +662,15 @@
     }
 #endif
     if (!horizontalOverhangRect.isEmpty())
-        hostWindow()->invalidateContentsAndWindow(horizontalOverhangRect, false /*immediate*/);
+        hostWindow()->invalidateContentsAndRootView(horizontalOverhangRect, false /*immediate*/);
     if (!verticalOverhangRect.isEmpty())
-        hostWindow()->invalidateContentsAndWindow(verticalOverhangRect, false /*immediate*/);
+        hostWindow()->invalidateContentsAndRootView(verticalOverhangRect, false /*immediate*/);
 
     // This call will move children with native widgets (plugins) and invalidate them as well.
     frameRectsChanged();
 
     // Now blit the backingstore into the window which should be very fast.
-    hostWindow()->invalidateWindow(IntRect(), true);
+    hostWindow()->invalidateRootView(IntRect(), true);
 }
 
 bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
@@ -929,7 +929,7 @@
     }
 
     if (hostWindow())
-        hostWindow()->invalidateContentsAndWindow(contentsToWindow(paintRect), now /*immediate*/);
+        hostWindow()->invalidateContentsAndRootView(contentsToWindow(paintRect), now /*immediate*/);
 }
 
 IntRect ScrollView::scrollCornerRect() const
@@ -1252,7 +1252,7 @@
         return;
     m_drawPanScrollIcon = true;    
     m_panScrollIconPoint = IntPoint(iconPosition.x() - panIconSizeLength / 2 , iconPosition.y() - panIconSizeLength / 2) ;
-    hostWindow()->invalidateContentsAndWindow(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);
+    hostWindow()->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);
 }
 
 void ScrollView::removePanScrollIcon()
@@ -1260,7 +1260,7 @@
     if (!hostWindow())
         return;
     m_drawPanScrollIcon = false; 
-    hostWindow()->invalidateContentsAndWindow(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);
+    hostWindow()->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);
 }
 
 void ScrollView::setScrollOrigin(const IntPoint& origin, bool updatePositionAtAll, bool updatePositionSynchronously)
diff --git a/Source/WebCore/platform/chromium/FramelessScrollView.cpp b/Source/WebCore/platform/chromium/FramelessScrollView.cpp
index 3fca726..73bec0d 100644
--- a/Source/WebCore/platform/chromium/FramelessScrollView.cpp
+++ b/Source/WebCore/platform/chromium/FramelessScrollView.cpp
@@ -66,7 +66,7 @@
 void FramelessScrollView::invalidateRect(const IntRect& rect)
 {
     if (HostWindow* h = hostWindow())
-        h->invalidateContentsAndWindow(rect, false /*immediate*/);
+        h->invalidateContentsAndRootView(rect, false /*immediate*/);
 }
 
 HostWindow* FramelessScrollView::hostWindow() const
diff --git a/Source/WebCore/svg/graphics/SVGImage.cpp b/Source/WebCore/svg/graphics/SVGImage.cpp
index 7db6df8..b643ee6 100644
--- a/Source/WebCore/svg/graphics/SVGImage.cpp
+++ b/Source/WebCore/svg/graphics/SVGImage.cpp
@@ -73,7 +73,7 @@
         m_image = 0;
     }
 
-    virtual void invalidateContentsAndWindow(const IntRect& r, bool)
+    virtual void invalidateContentsAndRootView(const IntRect& r, bool)
     {
         if (m_image && m_image->imageObserver())
             m_image->imageObserver()->changedInRect(m_image, r);
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index 501cb7e..53232c2 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,21 @@
+2011-11-14  Anders Carlsson  <andersca@apple.com>
+
+        HostWindow invalidation functions should use root view coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=72338
+
+        Reviewed by Dan Bernstein.
+
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::invalidateRootView):
+        (WebKit::ChromeClientImpl::invalidateContentsAndRootView):
+        (WebKit::ChromeClientImpl::invalidateContentsForSlowScroll):
+        * src/ChromeClientImpl.h:
+        * src/WebPopupMenuImpl.cpp:
+        (WebKit::WebPopupMenuImpl::invalidateRootView):
+        (WebKit::WebPopupMenuImpl::invalidateContentsAndRootView):
+        (WebKit::WebPopupMenuImpl::invalidateContentsForSlowScroll):
+        * src/WebPopupMenuImpl.h:
+
 2011-11-15  Pavel Feldman  <pfeldman@google.com>
 
         Web Inspector: move generic code from DevTools.js into the WebCore.
diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
index 39ccc63..ddcb7a1 100644
--- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -506,12 +506,12 @@
 }
 #endif
 
-void ChromeClientImpl::invalidateWindow(const IntRect&, bool)
+void ChromeClientImpl::invalidateRootView(const IntRect&, bool)
 {
     notImplemented();
 }
 
-void ChromeClientImpl::invalidateContentsAndWindow(const IntRect& updateRect, bool /*immediate*/)
+void ChromeClientImpl::invalidateContentsAndRootView(const IntRect& updateRect, bool /*immediate*/)
 {
     if (updateRect.isEmpty())
         return;
@@ -529,7 +529,7 @@
 void ChromeClientImpl::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
 {
     m_webView->hidePopups();
-    invalidateContentsAndWindow(updateRect, immediate);
+    invalidateContentsAndRootView(updateRect, immediate);
 }
 
 #if ENABLE(REQUEST_ANIMATION_FRAME)
diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.h b/Source/WebKit/chromium/src/ChromeClientImpl.h
index 7903c39..0095b9d 100644
--- a/Source/WebKit/chromium/src/ChromeClientImpl.h
+++ b/Source/WebKit/chromium/src/ChromeClientImpl.h
@@ -105,8 +105,8 @@
 #if ENABLE(REGISTER_PROTOCOL_HANDLER)
     virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title);
 #endif
-    virtual void invalidateWindow(const WebCore::IntRect&, bool);
-    virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateRootView(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsAndRootView(const WebCore::IntRect&, bool);
     virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
 #if ENABLE(REQUEST_ANIMATION_FRAME)
     virtual void scheduleAnimation();
diff --git a/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp b/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
index 8812581..c2de045 100644
--- a/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
+++ b/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp
@@ -348,12 +348,12 @@
     notImplemented();
 }
 
-void WebPopupMenuImpl::invalidateWindow(const IntRect&, bool)
+void WebPopupMenuImpl::invalidateRootView(const IntRect&, bool)
 {
     notImplemented();
 }
 
-void WebPopupMenuImpl::invalidateContentsAndWindow(const IntRect& paintRect, bool /*immediate*/)
+void WebPopupMenuImpl::invalidateContentsAndRootView(const IntRect& paintRect, bool /*immediate*/)
 {
     if (paintRect.isEmpty())
         return;
@@ -363,7 +363,7 @@
 
 void WebPopupMenuImpl::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
 {
-    invalidateContentsAndWindow(updateRect, immediate);
+    invalidateContentsAndRootView(updateRect, immediate);
 }
 
 void WebPopupMenuImpl::scheduleAnimation()
diff --git a/Source/WebKit/chromium/src/WebPopupMenuImpl.h b/Source/WebKit/chromium/src/WebPopupMenuImpl.h
index cb1ab82..7ff1311 100644
--- a/Source/WebKit/chromium/src/WebPopupMenuImpl.h
+++ b/Source/WebKit/chromium/src/WebPopupMenuImpl.h
@@ -116,8 +116,8 @@
 
     // WebCore::HostWindow methods:
     virtual void invalidateContents(const WebCore::IntRect&, bool);
-    virtual void invalidateWindow(const WebCore::IntRect&, bool);
-    virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateRootView(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsAndRootView(const WebCore::IntRect&, bool);
     virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
     virtual void scheduleAnimation();
     virtual void scroll(
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog
index b440bd0..254c344 100755
--- a/Source/WebKit/efl/ChangeLog
+++ b/Source/WebKit/efl/ChangeLog
@@ -1,3 +1,16 @@
+2011-11-14  Anders Carlsson  <andersca@apple.com>
+
+        HostWindow invalidation functions should use root view coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=72338
+
+        Reviewed by Dan Bernstein.
+
+        * WebCoreSupport/ChromeClientEfl.cpp:
+        (WebCore::ChromeClientEfl::invalidateRootView):
+        (WebCore::ChromeClientEfl::invalidateContentsAndRootView):
+        (WebCore::ChromeClientEfl::invalidateContentsForSlowScroll):
+        * WebCoreSupport/ChromeClientEfl.h:
+
 2011-11-15  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
 
         [EFL] Use EINA_SAFETY_ON_NULL_RETURN_VAL for NULL checks instead of EINA_SAFETY_ON_FALSE_RETURN_VAL.
diff --git a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
index 608b808..02e8bf6 100644
--- a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
+++ b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
@@ -485,12 +485,12 @@
     notImplemented();
 }
 
-void ChromeClientEfl::invalidateWindow(const IntRect& updateRect, bool immediate)
+void ChromeClientEfl::invalidateRootView(const IntRect& updateRect, bool immediate)
 {
     notImplemented();
 }
 
-void ChromeClientEfl::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
+void ChromeClientEfl::invalidateContentsAndRootView(const IntRect& updateRect, bool immediate)
 {
     if (updateRect.isEmpty())
         return;
@@ -506,7 +506,7 @@
 
 void ChromeClientEfl::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
 {
-    invalidateContentsAndWindow(updateRect, immediate);
+    invalidateContentsAndRootView(updateRect, immediate);
 }
 
 void ChromeClientEfl::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
diff --git a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
index 72c02f3..d2b258a 100644
--- a/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
+++ b/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
@@ -152,8 +152,8 @@
     virtual void cancelGeolocationPermissionForFrame(Frame*, Geolocation*);
 
     virtual void invalidateContents(const IntRect&, bool);
-    virtual void invalidateWindow(const IntRect&, bool);
-    virtual void invalidateContentsAndWindow(const IntRect&, bool);
+    virtual void invalidateRootView(const IntRect&, bool);
+    virtual void invalidateContentsAndRootView(const IntRect&, bool);
     virtual void invalidateContentsForSlowScroll(const IntRect&, bool);
     virtual void scroll(const IntSize&, const IntRect&, const IntRect&);
     virtual void cancelGeolocationPermissionRequestForFrame(Frame*);
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index f86daba..f99488d 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,16 @@
+2011-11-14  Anders Carlsson  <andersca@apple.com>
+
+        HostWindow invalidation functions should use root view coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=72338
+
+        Reviewed by Dan Bernstein.
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::invalidateRootView):
+        (WebKit::ChromeClient::invalidateContentsAndRootView):
+        (WebKit::ChromeClient::invalidateContentsForSlowScroll):
+        * WebCoreSupport/ChromeClientGtk.h:
+
 2011-11-15  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Implement download support in WebKit2
diff --git a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 8d7518b..a2534c6 100644
--- a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -570,11 +570,11 @@
     m_repaintSoonSourceId = 0;
 }
 
-void ChromeClient::invalidateWindow(const IntRect&, bool immediate)
+void ChromeClient::invalidateRootView(const IntRect&, bool immediate)
 {
 }
 
-void ChromeClient::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
+void ChromeClient::invalidateContentsAndRootView(const IntRect& updateRect, bool immediate)
 {
     if (updateRect.isEmpty())
         return;
@@ -584,7 +584,7 @@
 
 void ChromeClient::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
 {
-    invalidateContentsAndWindow(updateRect, immediate);
+    invalidateContentsAndRootView(updateRect, immediate);
     m_adjustmentWatcher.updateAdjustmentsFromScrollbarsLater();
 }
 
diff --git a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
index 250511e..21de491 100644
--- a/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
+++ b/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
@@ -102,8 +102,8 @@
 #if ENABLE(REGISTER_PROTOCOL_HANDLER) 
         virtual void registerProtocolHandler(const WTF::String&, const WTF::String&, const WTF::String&, const WTF::String&); 
 #endif 
-        virtual void invalidateWindow(const IntRect&, bool);
-        virtual void invalidateContentsAndWindow(const IntRect&, bool);
+        virtual void invalidateRootView(const IntRect&, bool);
+        virtual void invalidateContentsAndRootView(const IntRect&, bool);
         virtual void invalidateContentsForSlowScroll(const IntRect&, bool);
         virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
 
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 126650c..4c7a19e 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,16 @@
+2011-11-14  Anders Carlsson  <andersca@apple.com>
+
+        HostWindow invalidation functions should use root view coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=72338
+
+        Reviewed by Dan Bernstein.
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::invalidateRootView):
+        (WebChromeClient::invalidateContentsAndRootView):
+        (WebChromeClient::invalidateContentsForSlowScroll):
+
 2011-11-14  Julien Chaffraix  <jchaffraix@webkit.org>
 
         Add --css-grid-layout to build-webkit and the build systems
diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
index fe6fafa..b6a05d1 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
@@ -88,8 +88,8 @@
 
     virtual WebCore::IntRect windowResizerRect() const OVERRIDE;
 
-    virtual void invalidateWindow(const WebCore::IntRect&, bool) OVERRIDE;
-    virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool) OVERRIDE;
+    virtual void invalidateRootView(const WebCore::IntRect&, bool) OVERRIDE;
+    virtual void invalidateContentsAndRootView(const WebCore::IntRect&, bool) OVERRIDE;
     virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool) OVERRIDE;
     virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect) OVERRIDE;
 
diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
index 86b3679..07868c6 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
@@ -541,7 +541,7 @@
     return enclosingIntRect([[m_webView window] _growBoxRect]);
 }
 
-void WebChromeClient::invalidateWindow(const IntRect&, bool immediate)
+void WebChromeClient::invalidateRootView(const IntRect&, bool immediate)
 {
     if (immediate) {
         [[m_webView window] displayIfNeeded];
@@ -549,13 +549,13 @@
     }
 }
 
-void WebChromeClient::invalidateContentsAndWindow(const IntRect& rect, bool immediate)
+void WebChromeClient::invalidateContentsAndRootView(const IntRect& rect, bool immediate)
 {
 }
 
 void WebChromeClient::invalidateContentsForSlowScroll(const IntRect& rect, bool immediate)
 {
-    invalidateContentsAndWindow(rect, immediate);
+    invalidateContentsAndRootView(rect, immediate);
 }
 
 void WebChromeClient::scroll(const IntSize&, const IntRect&, const IntRect&)
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index 95477d4..0ce380b 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,16 @@
+2011-11-14  Anders Carlsson  <andersca@apple.com>
+
+        HostWindow invalidation functions should use root view coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=72338
+
+        Reviewed by Dan Bernstein.
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::invalidateRootView):
+        (WebCore::ChromeClientQt::invalidateContentsAndRootView):
+        (WebCore::ChromeClientQt::invalidateContentsForSlowScroll):
+        * WebCoreSupport/ChromeClientQt.h:
+
 2011-11-11  Pierre Rossi  <pierre.rossi@gmail.com>
 
         [Qt] Remove the QStyle dependency in Qt's mobile theme
diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 95a407e..5785d0b 100644
--- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -398,7 +398,7 @@
 #endif
 }
 
-void ChromeClientQt::invalidateWindow(const IntRect& windowRect, bool)
+void ChromeClientQt::invalidateRootView(const IntRect& windowRect, bool)
 {
 #if USE(TILED_BACKING_STORE)
     if (platformPageClient()) {
@@ -412,7 +412,7 @@
 #endif
 }
 
-void ChromeClientQt::invalidateContentsAndWindow(const IntRect& windowRect, bool immediate)
+void ChromeClientQt::invalidateContentsAndRootView(const IntRect& windowRect, bool immediate)
 {
     // No double buffer, so only update the QWidget if content changed.
     if (platformPageClient()) {
@@ -429,7 +429,7 @@
 
 void ChromeClientQt::invalidateContentsForSlowScroll(const IntRect& windowRect, bool immediate)
 {
-    invalidateContentsAndWindow(windowRect, immediate);
+    invalidateContentsAndRootView(windowRect, immediate);
 }
 
 void ChromeClientQt::scroll(const IntSize& delta, const IntRect& scrollViewRect, const IntRect&)
diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index 31d6b4b..0a79185 100644
--- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -114,8 +114,8 @@
     virtual KeyboardUIMode keyboardUIMode();
     virtual IntRect windowResizerRect() const;
 
-    virtual void invalidateWindow(const IntRect&, bool);
-    virtual void invalidateContentsAndWindow(const IntRect&, bool);
+    virtual void invalidateRootView(const IntRect&, bool);
+    virtual void invalidateContentsAndRootView(const IntRect&, bool);
     virtual void invalidateContentsForSlowScroll(const IntRect&, bool);
     virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
 #if USE(TILED_BACKING_STORE)
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index f8396dc..37d3737 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,15 @@
+2011-11-14  Anders Carlsson  <andersca@apple.com>
+
+        HostWindow invalidation functions should use root view coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=72338
+
+        Reviewed by Dan Bernstein.
+
+        * WebCoreSupport/WebChromeClient.cpp:
+        (WebChromeClient::invalidateRootView):
+        (WebChromeClient::invalidateContentsAndRootView):
+        * WebCoreSupport/WebChromeClient.h:
+
 2011-11-07  Adam Barth  <abarth@webkit.org>
 
         Move static "policy" state from SecurityOrigin.cpp to SecurityPolicy.cpp
diff --git a/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
index c28be20..bcd6c2c 100644
--- a/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
@@ -460,13 +460,13 @@
     return IntRect();
 }
 
-void WebChromeClient::invalidateWindow(const IntRect& windowRect, bool immediate)
+void WebChromeClient::invalidateRootView(const IntRect& windowRect, bool immediate)
 {
     ASSERT(core(m_webView->topLevelFrame()));
     m_webView->repaint(windowRect, false /*contentChanged*/, immediate, false /*repaintContentOnly*/);
 }
 
-void WebChromeClient::invalidateContentsAndWindow(const IntRect& windowRect, bool immediate)
+void WebChromeClient::invalidateContentsAndRootView(const IntRect& windowRect, bool immediate)
 {
     ASSERT(core(m_webView->topLevelFrame()));
     m_webView->repaint(windowRect, true /*contentChanged*/, immediate /*immediate*/, false /*repaintContentOnly*/);
diff --git a/Source/WebKit/win/WebCoreSupport/WebChromeClient.h b/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
index 1593402..4f957c4 100644
--- a/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit/win/WebCoreSupport/WebChromeClient.h
@@ -94,8 +94,8 @@
     virtual WebCore::KeyboardUIMode keyboardUIMode();
     virtual WebCore::IntRect windowResizerRect() const;
 
-    virtual void invalidateWindow(const WebCore::IntRect&, bool);
-    virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateRootView(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsAndRootView(const WebCore::IntRect&, bool);
     virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
     virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& rectToScroll, const WebCore::IntRect& clipRect);
 
diff --git a/Source/WebKit/wince/ChangeLog b/Source/WebKit/wince/ChangeLog
index 7132209..dbc8d32 100644
--- a/Source/WebKit/wince/ChangeLog
+++ b/Source/WebKit/wince/ChangeLog
@@ -1,3 +1,17 @@
+2011-11-14  Anders Carlsson  <andersca@apple.com>
+
+        HostWindow invalidation functions should use root view coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=72338
+
+        Reviewed by Dan Bernstein.
+
+        * WebCoreSupport/ChromeClientWinCE.cpp:
+        (WebKit::ChromeClientWinCE::invalidateRootView):
+        (WebKit::ChromeClientWinCE::invalidateContentsAndRootView):
+        (WebKit::ChromeClientWinCE::invalidateContentsForSlowScroll):
+        (WebKit::ChromeClientWinCE::scroll):
+        * WebCoreSupport/ChromeClientWinCE.h:
+
 2011-11-04  Patrick Gansterer  <paroga@webkit.org>
 
         [WINCE] Use default LocalizationStrategy
diff --git a/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp b/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
index ee550a4..eb7e317 100644
--- a/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
+++ b/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
@@ -226,12 +226,12 @@
     return IntRect();
 }
 
-void ChromeClientWinCE::invalidateWindow(const IntRect&, bool)
+void ChromeClientWinCE::invalidateRootView(const IntRect&, bool)
 {
     notImplemented();
 }
 
-void ChromeClientWinCE::invalidateContentsAndWindow(const IntRect& updateRect, bool immediate)
+void ChromeClientWinCE::invalidateContentsAndRootView(const IntRect& updateRect, bool immediate)
 {
     RECT rect = updateRect;
     InvalidateRect(m_webView->windowHandle(), &rect, FALSE);
@@ -242,12 +242,12 @@
 
 void ChromeClientWinCE::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate)
 {
-    invalidateContentsAndWindow(updateRect, immediate);
+    invalidateContentsAndRootView(updateRect, immediate);
 }
 
 void ChromeClientWinCE::scroll(const IntSize&, const IntRect& rectToScroll, const IntRect&)
 {
-    invalidateContentsAndWindow(rectToScroll, false);
+    invalidateContentsAndRootView(rectToScroll, false);
 }
 
 IntRect ChromeClientWinCE::windowToScreen(const IntRect& rect) const
diff --git a/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h b/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
index def2084..8207ee9 100644
--- a/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
+++ b/Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
@@ -93,8 +93,8 @@
     virtual WebCore::IntRect windowResizerRect() const;
 
     // Methods used by HostWindow.
-    virtual void invalidateWindow(const WebCore::IntRect&, bool);
-    virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
+    virtual void invalidateRootView(const WebCore::IntRect&, bool);
+    virtual void invalidateContentsAndRootView(const WebCore::IntRect&, bool);
     virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
     virtual void scroll(const WebCore::IntSize&, const WebCore::IntRect&, const WebCore::IntRect&);
     virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
diff --git a/Source/WebKit/wx/ChangeLog b/Source/WebKit/wx/ChangeLog
index 0368630..8ac4a3d 100644
--- a/Source/WebKit/wx/ChangeLog
+++ b/Source/WebKit/wx/ChangeLog
@@ -1,3 +1,16 @@
+2011-11-14  Anders Carlsson  <andersca@apple.com>
+
+        HostWindow invalidation functions should use root view coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=72338
+
+        Reviewed by Dan Bernstein.
+
+        * WebKitSupport/ChromeClientWx.cpp:
+        (WebCore::ChromeClientWx::invalidateRootView):
+        (WebCore::ChromeClientWx::invalidateContentsForSlowScroll):
+        (WebCore::ChromeClientWx::invalidateContentsAndRootView):
+        * WebKitSupport/ChromeClientWx.h:
+
 2011-11-02  Tom Sepez  <tsepez@chromium.org>
 
         XSSAuditor is silent
diff --git a/Source/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/Source/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
index 9142f70..f9e3c7a 100644
--- a/Source/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
+++ b/Source/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
@@ -340,7 +340,7 @@
     return IntRect();
 }
 
-void ChromeClientWx::invalidateWindow(const IntRect& rect, bool immediate)
+void ChromeClientWx::invalidateRootView(const IntRect& rect, bool immediate)
 {
     if (immediate)
         m_webView->Update();
@@ -348,10 +348,10 @@
 
 void ChromeClientWx::invalidateContentsForSlowScroll(const IntRect& rect, bool immediate)
 {
-    invalidateContentsAndWindow(rect, immediate);
+    invalidateContentsAndRootView(rect, immediate);
 }
 
-void ChromeClientWx::invalidateContentsAndWindow(const IntRect& rect, bool immediate)
+void ChromeClientWx::invalidateContentsAndRootView(const IntRect& rect, bool immediate)
 {
     if (!m_webView)
         return;
diff --git a/Source/WebKit/wx/WebKitSupport/ChromeClientWx.h b/Source/WebKit/wx/WebKitSupport/ChromeClientWx.h
index 101e09f..e4cb79a 100644
--- a/Source/WebKit/wx/WebKitSupport/ChromeClientWx.h
+++ b/Source/WebKit/wx/WebKitSupport/ChromeClientWx.h
@@ -103,8 +103,8 @@
     virtual void scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect);
     virtual void updateBackingStore();
     
-    virtual void invalidateWindow(const IntRect&, bool);
-    virtual void invalidateContentsAndWindow(const IntRect&, bool);
+    virtual void invalidateRootView(const IntRect&, bool);
+    virtual void invalidateContentsAndRootView(const IntRect&, bool);
     virtual void invalidateContentsForSlowScroll(const IntRect&, bool);
     virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
 
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index bc63543..b66b9d1 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,15 @@
+2011-11-14  Anders Carlsson  <andersca@apple.com>
+
+        HostWindow invalidation functions should use root view coordinates
+        https://bugs.webkit.org/show_bug.cgi?id=72338
+
+        Reviewed by Dan Bernstein.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::invalidateRootView):
+        (WebKit::WebChromeClient::invalidateContentsAndRootView):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+
 2011-11-15  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [GTK] Implement download support in WebKit2
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index 117360e..9ce75b6 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -370,12 +370,12 @@
     return m_page->windowResizerRect();
 }
 
-void WebChromeClient::invalidateWindow(const IntRect&, bool)
+void WebChromeClient::invalidateRootView(const IntRect&, bool)
 {
     // Do nothing here, there's no concept of invalidating the window in the web process.
 }
 
-void WebChromeClient::invalidateContentsAndWindow(const IntRect& rect, bool)
+void WebChromeClient::invalidateContentsAndRootView(const IntRect& rect, bool)
 {
     if (Document* document = m_page->corePage()->mainFrame()->document()) {
         if (document->printing())
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
index 82c432b..8c16544 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
@@ -108,8 +108,8 @@
     virtual WebCore::IntRect windowResizerRect() const OVERRIDE;
     
     // HostWindow member function overrides.
-    virtual void invalidateWindow(const WebCore::IntRect&, bool) OVERRIDE;
-    virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool) OVERRIDE;
+    virtual void invalidateRootView(const WebCore::IntRect&, bool) OVERRIDE;
+    virtual void invalidateContentsAndRootView(const WebCore::IntRect&, bool) OVERRIDE;
     virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool) OVERRIDE;
     virtual void scroll(const WebCore::IntSize& scrollOffset, const WebCore::IntRect& scrollRect, const WebCore::IntRect& clipRect) OVERRIDE;
 #if USE(TILED_BACKING_STORE)