Switch Windows to using FrameView::layoutIfNeededRecursive
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Aug 2007 21:49:21 +0000 (21:49 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Aug 2007 21:49:21 +0000 (21:49 +0000)
 WebCore:

         Made FrameView::layoutIfNeededRecursive available to all platforms

         Currently it's only used on Gtk+ and Windows.

         Reviewed by Darin.

         * page/FrameView.cpp: Removed #ifdef.
         * page/FrameView.h: Ditto.

 WebKit/win:

         Switch Windows to using FrameView::layoutIfNeededRecursive

         Reviewed by Darin.

         * WebFrame.cpp: Removed layoutIfNeededRecursive.
         * WebFrame.h: Ditto.
         * WebView.cpp:
         (WebView::updateBackingStore): Call FrameView::layoutIfNeededRecursive.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25177 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/FrameView.cpp
WebCore/page/FrameView.h
WebKit/win/ChangeLog
WebKit/win/WebFrame.cpp
WebKit/win/WebFrame.h
WebKit/win/WebView.cpp

index a77b27ec7e2aa47114094520b775bf2873e04333..a359ad6407d3110d74006c058a428f2d836710c8 100644 (file)
@@ -1,3 +1,14 @@
+2007-08-21  Adam Roben  <aroben@apple.com>
+
+        Made FrameView::layoutIfNeededRecursive available to all platforms
+
+        Currently it's only used on Gtk+ and Windows.
+
+        Reviewed by Darin.
+
+        * page/FrameView.cpp: Removed #ifdef.
+        * page/FrameView.h: Ditto.
+
 2007-08-21  Adele Peterson  <adele@apple.com>
 
         Build fix for release build.
index 5e518a84892d99445edc35cc69bec0b69b81105a..27f39dec50dba654394cba7673c03c111885f572 100644 (file)
@@ -928,7 +928,6 @@ void FrameView::setWasScrolledByUser(bool wasScrolledByUser)
     d->m_wasScrolledByUser = wasScrolledByUser;
 }
 
-#if PLATFORM(GDK)
 void FrameView::layoutIfNeededRecursive()
 {
     // We have to crawl our entire tree looking for any FrameViews that need
@@ -949,6 +948,5 @@ void FrameView::layoutIfNeededRecursive()
         if ((*current)->isFrameView())
             static_cast<FrameView*>(*current)->layoutIfNeededRecursive();
 }
-#endif
 
 }
index 65008e1da164c21fc8185feb4a55bf6dc648dc15..61a4c99203649fed9148a6322293bdda5f68b2d9 100644 (file)
@@ -125,9 +125,7 @@ public:
     bool wasScrolledByUser() const;
     void setWasScrolledByUser(bool);
 
-#if PLATFORM(GDK)
     void layoutIfNeededRecursive();
-#endif
 
 private:
     void init();
index 986e5283a87af549a8b6494b89f5b4f2e497311b..a2a60617935a437108670fc14a9d94ae5bf59cc7 100644 (file)
@@ -1,3 +1,14 @@
+2007-08-21  Adam Roben  <aroben@apple.com>
+
+        Switch Windows to using FrameView::layoutIfNeededRecursive
+
+        Reviewed by Darin.
+
+        * WebFrame.cpp: Removed layoutIfNeededRecursive.
+        * WebFrame.h: Ditto.
+        * WebView.cpp:
+        (WebView::updateBackingStore): Call FrameView::layoutIfNeededRecursive.
+
 2007-08-17  Adam Roben  <aroben@apple.com>
 
         Fix <rdar://5192578> Inspect Element should not appear in context menu in non-debug mode
index e2c5a66140ad2293a79e9ba523bcd59ca351c160..35896928b53a9e370a3ddfaf443fdcc3a9c4874f 100644 (file)
@@ -967,36 +967,6 @@ void WebFrame::initWithWebFrameView(IWebFrameView* /*view*/, IWebView* webView,
     frameView->setContainingWindow(viewWindow);
 }
 
-void WebFrame::layoutIfNeededRecursive(FrameView* frameView)
-{
-    LOCAL_GDI_COUNTER(0, __FUNCTION__);
-
-    // We have to crawl our entire tree looking for any FrameViews that need
-    // layout and make sure they are up to date.
-    // Mac actually tests for intersection with the dirty region and tries not to
-    // update layout for frames that are outside the dirty region.  Not only does this seem
-    // pointless (since those frames will have set a zero timer to layout anyway), but
-    // it is also incorrect, since if two frames overlap, the first could be excluded from the dirty
-    // region but then become included later by the second frame adding rects to the dirty region
-    // when it lays out.
-    if (!frameView) {
-        frameView = d->frameView();
-        if (!frameView)
-            return;
-    }
-
-    // Layout if we need to.
-    if (frameView->needsLayout())
-        frameView->layout();
-
-    // Now lay out any children that need to.
-    HashSet<Widget*>* children = frameView->children();
-    HashSet<Widget*>::iterator end = children->end();
-    for (HashSet<Widget*>::iterator current = children->begin(); current != end; ++current)
-        if ((*current)->isFrameView())
-            layoutIfNeededRecursive(static_cast<FrameView*>(*current));
-}
-
 Frame* WebFrame::impl()
 {
     return d->frame;
index 16292af000afd8fdf115f35ece13c5fc63276050..a725823828216303d2cc6ef2f0f0eb3ad4b89b0e 100644 (file)
@@ -316,7 +316,6 @@ public:
 
     // WebFrame
     void initWithWebFrameView(IWebFrameView*, IWebView*, WebCore::Page*, WebCore::HTMLFrameOwnerElement*);
-    void layoutIfNeededRecursive(WebCore::FrameView* frameView);
     WebCore::Frame* impl();
     void invalidate();
     void receivedData(const char*, int, const WebCore::String&);
index f95f21db24af56e9e616754b9b0baaade291e0a3..119fe863e926a4bddbb0ca0e22b04172060506e2 100644 (file)
@@ -351,7 +351,9 @@ void WebView::updateBackingStore(FrameView* frameView, HDC dc, bool backingStore
 
     if (m_backingStoreBitmap && (m_backingStoreDirtyRegion || backingStoreCompletelyDirty)) {
         // Do a layout first so that everything we render to the backing store is always current.
-        m_mainFrame->layoutIfNeededRecursive(0);
+        if (Frame* coreFrame = core(m_mainFrame))
+            if (FrameView* view = coreFrame->view())
+                view->layoutIfNeededRecursive();
 
         // This emulates the Mac smarts for painting rects intelligently.  This is
         // very important for us, since we double buffer based off dirty rects.