[Chromium] Refactor WebFrameImpl::createFrameView() to use Frame:createView
authorfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Nov 2011 17:06:59 +0000 (17:06 +0000)
committerfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Nov 2011 17:06:59 +0000 (17:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=70507

Reviewed by Darin Fisher.

No change in functionality except for fixed layout mode. Fixed layout mode has
not been fully upstreamed yet, so no new tests yet:
https://bugs.webkit.org/show_bug.cgi?id=70562 will address this.

This patch also fixes https://bugs.webkit.org/show_bug.cgi?id=70555
It was decided that fixed layout mode might need to be disabled for some content,
and so this change enables the embedder to decide whether to enable fixed layout on
navigation.

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::createFrameView):

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

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebFrameImpl.cpp

index 9a2dcb169458428674e809bc4557ea219f824c44..01c6389e85845146d5ffb9dcd9512f82069229e0 100644 (file)
@@ -1,3 +1,22 @@
+2011-11-03  Fady Samuel  <fsamuel@chromium.org>
+
+        [Chromium] Refactor WebFrameImpl::createFrameView() to use Frame:createView
+        https://bugs.webkit.org/show_bug.cgi?id=70507
+
+        Reviewed by Darin Fisher.
+
+        No change in functionality except for fixed layout mode. Fixed layout mode has
+        not been fully upstreamed yet, so no new tests yet:
+        https://bugs.webkit.org/show_bug.cgi?id=70562 will address this.
+
+        This patch also fixes https://bugs.webkit.org/show_bug.cgi?id=70555
+        It was decided that fixed layout mode might need to be disabled for some content,
+        and so this change enables the embedder to decide whether to enable fixed layout on
+        navigation.
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::createFrameView):
+
 2011-10-28  Hans Wennborg  <hans@chromium.org>
 
         IndexedDB: Recycle cursor objects when calling continue()
index 0c774c9001ade5a1ef5b72f42bfa3dc6bd610c88..bf23d17ada4625ba582a567d83cfedc92d2a1472 100644 (file)
@@ -2060,54 +2060,12 @@ void WebFrameImpl::createFrameView()
 {
     ASSERT(m_frame); // If m_frame doesn't exist, we probably didn't init properly.
 
-    Page* page = m_frame->page();
-    ASSERT(page);
-    ASSERT(page->mainFrame());
-
-    bool isMainFrame = m_frame == page->mainFrame();
-    bool useFixedLayout = false;
-    IntSize fixedLayoutSize;
-    if (isMainFrame && m_frame->view()) {
-        m_frame->view()->setParentVisible(false);
-        // Save the fixed layout information before destroying the
-        // existing FrameView of this frame.
-        useFixedLayout = m_frame->view()->useFixedLayout();
-        fixedLayoutSize = m_frame->view()->fixedLayoutSize();
-    }
-
-    m_frame->setView(0);
-
     WebViewImpl* webView = viewImpl();
-
-    RefPtr<FrameView> view;
-    if (isMainFrame)
-        view = FrameView::create(m_frame, webView->size());
-    else
-        view = FrameView::create(m_frame);
-
-    m_frame->setView(view);
-
-    if (webView->isTransparent())
-        view->setTransparent(true);
-
-    // FIXME: The Mac code has a comment about this possibly being unnecessary.
-    // See installInFrame in WebCoreFrameBridge.mm
-    if (m_frame->ownerRenderer())
-        m_frame->ownerRenderer()->setWidget(view.get());
-
-    if (HTMLFrameOwnerElement* owner = m_frame->ownerElement())
-        view->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
-
-    if (isMainFrame)
-        view->setParentVisible(true);
+    m_frame->createView(webView->size(), Color::white, webView->isTransparent(),  webView->fixedLayoutSize(), webView->isFixedLayoutModeEnabled());
 
 #if ENABLE(GESTURE_RECOGNIZER)
     webView->resetGestureRecognizer();
 #endif
-
-    // Restore the saved fixed layout information.
-    view->setUseFixedLayout(useFixedLayout);
-    view->setFixedLayoutSize(fixedLayoutSize);
 }
 
 WebFrameImpl* WebFrameImpl::fromFrame(Frame* frame)