WebCore:
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Oct 2008 06:58:08 +0000 (06:58 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 Oct 2008 06:58:08 +0000 (06:58 +0000)
2008-10-06  David Hyatt  <hyatt@apple.com>

        Enable viewless Mac WebKit to (kinda sorta) paint basic pages (with no frames on them).

        Reviewed by Sam Weinig

        * WebCore.base.exp:
        * WebCore.xcodeproj/project.pbxproj:
        * loader/EmptyClients.h:
        (WebCore::EmptyFrameLoaderClient::hasWebView):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadWithDocumentLoader):
        (WebCore::FrameLoader::transitionToCommitted):
        * loader/FrameLoaderClient.h:
        * page/FocusController.cpp:
        (WebCore::FocusController::setActive):
        * page/FrameView.cpp:
        (WebCore::FrameView::FrameView):
        (WebCore::FrameView::init):
        (WebCore::FrameView::layoutIfNeededRecursive):
        * page/FrameView.h:

WebKit/gtk:

2008-10-06  David Hyatt  <hyatt@apple.com>

        Enable viewless Mac WebKit to paint some basic pages.

        Reviewed by Sam Weinig

        * WebCoreSupport/FrameLoaderClientGtk.cpp:
        (WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
        * WebCoreSupport/FrameLoaderClientGtk.h:

WebKit/mac:

2008-10-06  David Hyatt  <hyatt@apple.com>

        Enable viewless Mac WebKit to paint some basic pages.

        Reviewed by Sam Weinig

        * WebCoreSupport/WebChromeClient.mm:
        (WebChromeClient::windowResizerRect):
        (WebChromeClient::repaint):
        (WebChromeClient::screenToWindow):
        (WebChromeClient::windowToScreen):
        (WebChromeClient::platformWindow):
        * WebCoreSupport/WebFrameLoaderClient.h:
        * WebCoreSupport/WebFrameLoaderClient.mm:
        (WebFrameLoaderClient::forceLayoutForNonHTML):
        (WebFrameLoaderClient::dispatchDidCommitLoad):
        (WebFrameLoaderClient::transitionToCommittedForNewPage):
        (WebFrameLoaderClient::createFrame):
        * WebView/WebFrame.mm:
        (-[WebFrame _drawRect:contentsOnly:]):
        * WebView/WebFrameInternal.h:
        * WebView/WebFrameView.mm:
        * WebView/WebFrameViewInternal.h:
        * WebView/WebHTMLView.mm:
        (-[WebHTMLView drawSingleRect:]):
        (-[WebHTMLView drawRect:]):
        * WebView/WebView.mm:
        (-[WebView isFlipped]):
        (-[WebView _boundsChanged]):
        (-[WebView _mustDrawUnionedRect:singleRects:count:]):
        (-[WebView drawSingleRect:]):
        (-[WebView drawRect:]):
        (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
        (-[WebView initWithFrame:frameName:groupName:]):
        (-[WebView _initWithFrame:frameName:groupName:usesDocumentViews:]):
        (-[WebView initWithCoder:]):
        (-[WebView removeSizeObservers]):
        (-[WebView viewWillMoveToWindow:]):
        (-[WebView viewWillMoveToSuperview:]):
        (-[WebView _usesDocumentViews]):
        * WebView/WebViewInternal.h:

WebKit/qt:

2008-10-06  David Hyatt  <hyatt@apple.com>

        Enable viewless Mac WebKit to paint some basic pages.

        Reviewed by Sam Weinig

        * WebCoreSupport/FrameLoaderClientQt.cpp:
        (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):

WebKit/win:

2008-10-06  David Hyatt  <hyatt@apple.com>

        Enable viewless Mac WebKit to paint some basic pages.

        Reviewed by Sam Weinig

        * WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebFrameLoaderClient::createFrame):
        * WebCoreSupport/WebFrameLoaderClient.h:

WebKit/wx:

2008-10-06  David Hyatt  <hyatt@apple.com>

        Enable viewless Mac WebKit to paint some basic pages.

        Reviewed by Sam Weinig

        * WebKitSupport/FrameLoaderClientWx.cpp:
        * WebKitSupport/FrameLoaderClientWx.h:

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

31 files changed:
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/loader/EmptyClients.h
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoaderClient.h
WebCore/page/FocusController.cpp
WebCore/page/FrameView.cpp
WebCore/page/FrameView.h
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebChromeClient.mm
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/mac/WebView/WebFrame.mm
WebKit/mac/WebView/WebFrameInternal.h
WebKit/mac/WebView/WebFrameView.mm
WebKit/mac/WebView/WebFrameViewInternal.h
WebKit/mac/WebView/WebHTMLView.mm
WebKit/mac/WebView/WebView.mm
WebKit/mac/WebView/WebViewInternal.h
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
WebKit/win/ChangeLog
WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
WebKit/wx/ChangeLog
WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp
WebKit/wx/WebKitSupport/FrameLoaderClientWx.h

index 150ec4b7734147adce6b67c05514358e3d17b004..fbd62e562be6e7c18b348771446bfd5245dbdfc8 100644 (file)
@@ -1,3 +1,25 @@
+2008-10-06  David Hyatt  <hyatt@apple.com>
+
+        Enable viewless Mac WebKit to (kinda sorta) paint basic pages (with no frames on them).
+
+        Reviewed by Sam Weinig
+
+        * WebCore.base.exp:
+        * WebCore.xcodeproj/project.pbxproj:
+        * loader/EmptyClients.h:
+        (WebCore::EmptyFrameLoaderClient::hasWebView):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadWithDocumentLoader):
+        (WebCore::FrameLoader::transitionToCommitted):
+        * loader/FrameLoaderClient.h:
+        * page/FocusController.cpp:
+        (WebCore::FocusController::setActive):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::FrameView):
+        (WebCore::FrameView::init):
+        (WebCore::FrameView::layoutIfNeededRecursive):
+        * page/FrameView.h:
+
 2008-10-06  Dan Bernstein  <mitz@apple.com>
 
         - build fix
index ac08ff2eb1145ec366f6e8902876d3b5dcab20e8..76f22c97bc2bbeabf2a203dbccf9bbc8a6a65c1c 100644 (file)
@@ -613,6 +613,8 @@ __ZN7WebCore9FrameView18updateControlTintsEv
 __ZN7WebCore9FrameView22setBaseBackgroundColorENS_5ColorE
 __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
 __ZN7WebCore9FrameViewC1EPNS_5FrameE
+__ZN7WebCore9HTMLNames8frameTagE
+__ZN7WebCore9HTMLNames9iframeTagE
 __ZN7WebCore9HTMLNames10listingTagE
 __ZN7WebCore9HTMLNames13blockquoteTagE
 __ZN7WebCore9HTMLNames4aTagE
@@ -857,6 +859,8 @@ __ZNK7WebCore9FrameTree4findERKNS_12AtomicStringE
 __ZNK7WebCore9FrameTree5childERKNS_12AtomicStringE
 __ZNK7WebCore9FrameTree6parentEb
 __ZNK7WebCore9FrameView11needsLayoutEv
+__ZN7WebCore9FrameView23layoutIfNeededRecursiveEv
+__ZN7WebCore9FrameViewC1EPNS_5FrameERKNS_7IntSizeE
 __ZNK7WebCore9Selection17isContentEditableEv
 __ZNK7WebCore9Selection19rootEditableElementEv
 __ZNK7WebCore9Selection23isContentRichlyEditableEv
index 57c2bf7ee8b80a4c6743ea6844470d1023cad875..ce5053df78ffe14fb74f5acdc4d4775c03433930 100644 (file)
@@ -81,7 +81,7 @@
                14E8378E09F85D4F00B85AE4 /* JSEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E8378D09F85D4F00B85AE4 /* JSEvent.h */; };
                14EC267F09CA07E000E1EEEC /* EventTargetNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 14EC267D09CA07E000E1EEEC /* EventTargetNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                14EC268009CA07E000E1EEEC /* EventTargetNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14EC267E09CA07E000E1EEEC /* EventTargetNode.cpp */; };
-               14FFE31D0AE1963300136BF5 /* HTMLFrameElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 14FFE31B0AE1963300136BF5 /* HTMLFrameElementBase.h */; };
+               14FFE31D0AE1963300136BF5 /* HTMLFrameElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 14FFE31B0AE1963300136BF5 /* HTMLFrameElementBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
                14FFE31E0AE1963300136BF5 /* HTMLFrameElementBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14FFE31C0AE1963300136BF5 /* HTMLFrameElementBase.cpp */; };
                1A0D57360A5C77FE007EDD4C /* OverflowEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0D57340A5C77FE007EDD4C /* OverflowEvent.cpp */; };
                1A0D57370A5C77FE007EDD4C /* OverflowEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A0D57350A5C77FE007EDD4C /* OverflowEvent.h */; };
                A871DE280A152AC800B12A68 /* HTMLFrameSetElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DE1C0A152AC800B12A68 /* HTMLFrameSetElement.h */; };
                A871DE290A152AC800B12A68 /* HTMLBodyElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DE1D0A152AC800B12A68 /* HTMLBodyElement.cpp */; };
                A871DE2A0A152AC800B12A68 /* HTMLIFrameElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DE1E0A152AC800B12A68 /* HTMLIFrameElement.h */; };
-               A871DE2B0A152AC800B12A68 /* HTMLFrameElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DE1F0A152AC800B12A68 /* HTMLFrameElement.h */; };
+               A871DE2B0A152AC800B12A68 /* HTMLFrameElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DE1F0A152AC800B12A68 /* HTMLFrameElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A871DE2C0A152AC800B12A68 /* HTMLBodyElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DE200A152AC800B12A68 /* HTMLBodyElement.h */; };
                A871DE2D0A152AC800B12A68 /* HTMLHeadElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DE210A152AC800B12A68 /* HTMLHeadElement.h */; };
                A871DE2E0A152AC800B12A68 /* HTMLFrameSetElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DE220A152AC800B12A68 /* HTMLFrameSetElement.cpp */; };
index 61d89e2eef3307fba68e89e36fd9d2f45f2d5c77..5495a95899ea3d98246af725a2b1888c82cf4348 100644 (file)
@@ -134,7 +134,6 @@ public:
     virtual void frameLoaderDestroyed() { }
 
     virtual bool hasWebView() const { return true; } // mainly for assertions
-    virtual bool hasFrameView() const { return true; } // ditto
 
     virtual void makeRepresentation(DocumentLoader*) { }
     virtual void forceLayout() { }
index 09f80b3c6efe3b2abddfa868ea40ac9221783997..b993f692c624f6d23f28fc5091e7f1aba307d7cd 100644 (file)
@@ -2263,7 +2263,7 @@ void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType t
     // Unfortunately the view must be non-nil, this is ultimately due
     // to parser requiring a FrameView.  We should fix this dependency.
 
-    ASSERT(m_client->hasFrameView());
+    ASSERT(m_frame->view());
 
     m_policyLoadType = type;
     RefPtr<FormState> formState = prpFormState;
@@ -2833,7 +2833,7 @@ void FrameLoader::transitionToCommitted(PassRefPtr<CachedPage> cachedPage)
     m_responseMIMEType = dl->responseMIMEType();
 
     // Tell the client we've committed this URL.
-    ASSERT(m_client->hasFrameView());
+    ASSERT(m_frame->view());
 
     if (m_creatingInitialEmptyDocument)
         return;
index 557b65f71092b57297f952a920d9d6271bdc2039..3f3dccd825e195bac75c2e38c77c0cdd12032f7f 100644 (file)
@@ -74,7 +74,6 @@ namespace WebCore {
         virtual void frameLoaderDestroyed() = 0;
         
         virtual bool hasWebView() const = 0; // mainly for assertions
-        virtual bool hasFrameView() const = 0; // ditto
 
         virtual bool hasHTMLView() const { return true; }
 
index d98fc66214e3749a4a31b65321f82ecb8778d4a1..4d0deebf7706ee71836a53a03e789de44d7b04d5 100644 (file)
@@ -296,15 +296,12 @@ void FocusController::setActive(bool active)
 
     m_isActive = active;
 
-    // FIXME: It would be nice to make Mac use this implementation someday.
-    // Right now Mac calls updateControlTints from within WebKit, and moving
-    // the call to here is not simple.
-#if !PLATFORM(MAC) && !PLATFORM(WX)
     if (FrameView* view = m_page->mainFrame()->view()) {
-        view->layoutIfNeededRecursive();
-        view->updateControlTints();
+        if (!view->platformWidget()) {
+            view->layoutIfNeededRecursive();
+            view->updateControlTints();
+        }
     }
-#endif
 
     focusedOrMainFrame()->selection()->pageActivationChanged();
 }
index ea478405f91a0747da2abc05aac2d1d72d77b9c9..d08180d076c009c4008c2278af6b561b3b570720 100644 (file)
@@ -37,6 +37,7 @@
 #include "FrameLoaderClient.h"
 #include "GraphicsContext.h"
 #include "HTMLDocument.h"
+#include "HTMLFrameElement.h"
 #include "HTMLFrameSetElement.h"
 #include "HTMLNames.h"
 #include "OverflowEvent.h"
@@ -169,7 +170,6 @@ FrameView::FrameView(Frame* frame)
     show();
 }
 
-#if !PLATFORM(MAC)
 FrameView::FrameView(Frame* frame, const IntSize& initialSize)
     : m_refCount(1)
     , m_frame(frame)
@@ -179,7 +179,6 @@ FrameView::FrameView(Frame* frame, const IntSize& initialSize)
     Widget::setFrameRect(IntRect(x(), y(), initialSize.width(), initialSize.height()));
     show();
 }
-#endif
 
 FrameView::~FrameView()
 {
@@ -231,6 +230,20 @@ void FrameView::init()
 {
     m_margins = IntSize(-1, -1); // undefined
     m_size = IntSize();
+
+    // Propagate the marginwidth/height and scrolling modes to the view.
+    Element* ownerElement = m_frame && m_frame->document() ? m_frame->document()->ownerElement() : 0;
+    if (ownerElement && (ownerElement->hasTagName(frameTag) || ownerElement->hasTagName(iframeTag))) {
+        HTMLFrameElement* frameElt = static_cast<HTMLFrameElement*>(ownerElement);
+        if (frameElt->scrollingMode() == ScrollbarAlwaysOff)
+            setCanHaveScrollbars(false);
+        int marginWidth = frameElt->getMarginWidth();
+        int marginHeight = frameElt->getMarginHeight();
+        if (marginWidth != -1)
+            setMarginWidth(marginWidth);
+        if (marginHeight != -1)
+            setMarginHeight(marginHeight);
+    }
 }
 
 void FrameView::clear()
@@ -1191,7 +1204,6 @@ void FrameView::setNodeToDraw(Node* node)
     d->m_nodeToDraw = node;
 }
 
-#if PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(QT)
 void FrameView::layoutIfNeededRecursive()
 {
     // We have to crawl our entire tree looking for any FrameViews that need
@@ -1212,6 +1224,5 @@ void FrameView::layoutIfNeededRecursive()
         if ((*current)->isFrameView())
             static_cast<FrameView*>(*current)->layoutIfNeededRecursive();
 }
-#endif
 
 }
index 6c6a36ca66f9b133a985a00f8184d4dc832c589f..08ed0c74b9c3eaab2dd3e15807c54e5bada5bc7c 100644 (file)
@@ -53,12 +53,7 @@ public:
     friend class RenderView;
 
     FrameView(Frame*);
-
-    // On the Mac, FrameViews always get their size from the underlying NSView,
-    // so passing in a size is nonsensical.
-#if !PLATFORM(MAC)
     FrameView(Frame*, const IntSize& initialSize);
-#endif
 
     virtual ~FrameView();
 
@@ -161,11 +156,7 @@ public:
 
     static double currentPaintTimeStamp() { return sCurrentPaintTimeStamp; } // returns 0 if not painting
     
-    // FIXME: This function should be used by all platforms, but currently depends on ScrollView::children,
-    // which not all platforms have. Once FrameView and ScrollView are merged, this #if should be removed.
-#if PLATFORM(WIN) || PLATFORM(GTK) || PLATFORM(QT)
     void layoutIfNeededRecursive();
-#endif
 
 private:
     void init();
index ab53a39956bd3e0793a840a2cc1ab049ccb3ab12..609a47496a4dac0eefa7265dae4beab4653b91fe 100644 (file)
@@ -1,3 +1,13 @@
+2008-10-06  David Hyatt  <hyatt@apple.com>
+
+        Enable viewless Mac WebKit to paint some basic pages.
+        
+        Reviewed by Sam Weinig
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::transitionToCommittedForNewPage):
+        * WebCoreSupport/FrameLoaderClientGtk.h:
+
 2008-10-03  David Hyatt  <hyatt@apple.com>
 
         Fix Gtk bustage from use of containingWindow() over on the WebKit side.  Replace with HostWindow use.
index 52de07573467344c65f31ef4c5ca5399a7d96fc1..82fd3c776da6345c584f25b414b07074d3b8d953 100644 (file)
@@ -400,12 +400,6 @@ bool FrameLoaderClient::hasWebView() const
     return true;
 }
 
-bool FrameLoaderClient::hasFrameView() const
-{
-    notImplemented();
-    return true;
-}
-
 void FrameLoaderClient::dispatchDidFinishLoad()
 {
     g_signal_emit_by_name(m_frame, "load-done", true);
@@ -799,19 +793,6 @@ void FrameLoaderClient::transitionToCommittedForNewPage()
 
     if (!frame->ownerElement())
         return;
-
-    HTMLFrameOwnerElement* ownerElement = frame->ownerElement();
-    if (ownerElement->hasTagName(HTMLNames::frameTag) || ownerElement->hasTagName(HTMLNames::iframeTag)) {
-        HTMLFrameElement* frameElt = static_cast<HTMLFrameElement*>(ownerElement);
-        if (frameElt->scrollingMode() == ScrollbarAlwaysOff)
-            frameView->setCanHaveScrollbars(false);
-        int marginWidth = frameElt->getMarginWidth();
-        int marginHeight = frameElt->getMarginHeight();
-        if (marginWidth != -1)
-            frameView->setMarginWidth(marginWidth);
-        if (marginHeight != -1)
-            frameView->setMarginHeight(marginHeight);
-    }
 }
 
 }
index a38fbd1707fe98c33d48f8eb8d4f5a7824f79a92..60ba67ed6527ff24474b985f52ab2ce35b6d2881 100644 (file)
@@ -47,7 +47,6 @@ namespace WebKit {
         WebKitWebFrame*  webFrame() const { return m_frame; }
 
         virtual bool hasWebView() const;
-        virtual bool hasFrameView() const;
 
         virtual void makeRepresentation(WebCore::DocumentLoader*);
         virtual void forceLayout();
index 4fe6dae20ed87c35eb4a86dac8a2351500a2404a..6631684ef72a304676571a3e5773ce25aa40919d 100644 (file)
@@ -1,3 +1,45 @@
+2008-10-06  David Hyatt  <hyatt@apple.com>
+
+        Enable viewless Mac WebKit to paint some basic pages.
+        
+        Reviewed by Sam Weinig
+
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::windowResizerRect):
+        (WebChromeClient::repaint):
+        (WebChromeClient::screenToWindow):
+        (WebChromeClient::windowToScreen):
+        (WebChromeClient::platformWindow):
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::forceLayoutForNonHTML):
+        (WebFrameLoaderClient::dispatchDidCommitLoad):
+        (WebFrameLoaderClient::transitionToCommittedForNewPage):
+        (WebFrameLoaderClient::createFrame):
+        * WebView/WebFrame.mm:
+        (-[WebFrame _drawRect:contentsOnly:]):
+        * WebView/WebFrameInternal.h:
+        * WebView/WebFrameView.mm:
+        * WebView/WebFrameViewInternal.h:
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView drawSingleRect:]):
+        (-[WebHTMLView drawRect:]):
+        * WebView/WebView.mm:
+        (-[WebView isFlipped]):
+        (-[WebView _boundsChanged]):
+        (-[WebView _mustDrawUnionedRect:singleRects:count:]):
+        (-[WebView drawSingleRect:]):
+        (-[WebView drawRect:]):
+        (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
+        (-[WebView initWithFrame:frameName:groupName:]):
+        (-[WebView _initWithFrame:frameName:groupName:usesDocumentViews:]):
+        (-[WebView initWithCoder:]):
+        (-[WebView removeSizeObservers]):
+        (-[WebView viewWillMoveToWindow:]):
+        (-[WebView viewWillMoveToSuperview:]):
+        (-[WebView _usesDocumentViews]):
+        * WebView/WebViewInternal.h:
+
 2008-10-06  Kevin Decker  <kdecker@apple.com>
 
         Rubber-stamped by Anders Carlsson.
index ce5f548c4440342298e4a19a892aa19867796597..3ef7b46f0a8ac2feccf994d34bc888a98dd89c21 100644 (file)
@@ -400,12 +400,24 @@ bool WebChromeClient::tabsToLinks() const
 
 IntRect WebChromeClient::windowResizerRect() const
 {
-    return enclosingIntRect([[m_webView window] _growBoxRect]);
+    NSRect rect = [[m_webView window] _growBoxRect];
+    if ([m_webView _usesDocumentViews])
+        return enclosingIntRect(rect);
+    return enclosingIntRect([m_webView convertRect:rect fromView:nil]);
 }
 
-// Host window methods are really only needed once we have a viewless Mac Webkit.
-void WebChromeClient::repaint(const IntRect&, bool, bool, bool)
+void WebChromeClient::repaint(const IntRect& rect, bool contentChanged, bool immediate, bool repaintContentOnly)
 {
+    if ([m_webView _usesDocumentViews])
+        return;
+    
+    if (contentChanged)
+        [m_webView setNeedsDisplayInRect:rect];
+    
+    if (immediate) {
+        [[m_webView window] displayIfNeeded];
+        [[m_webView window] flushWindowIfNeeded];
+    }
 }
 
 void WebChromeClient::scroll(const IntSize&, const IntRect&, const IntRect&)
@@ -414,17 +426,27 @@ void WebChromeClient::scroll(const IntSize&, const IntRect&, const IntRect&)
 
 IntPoint WebChromeClient::screenToWindow(const IntPoint& p) const
 {
-    return p;
+    if ([m_webView _usesDocumentViews])
+        return p;
+    NSPoint windowCoord = [[m_webView window] convertScreenToBase:p];
+    return IntPoint([m_webView convertPoint:windowCoord fromView:nil]);
 }
 
 IntRect WebChromeClient::windowToScreen(const IntRect& r) const
 {
-    return r;
+    if ([m_webView _usesDocumentViews])
+        return r;
+    NSRect tempRect = r;
+    tempRect = [m_webView convertRect:tempRect toView:nil];
+    tempRect.origin = [[m_webView window] convertBaseToScreen:tempRect.origin];
+    return enclosingIntRect(tempRect);
 }
 
 PlatformWidget WebChromeClient::platformWindow() const
 {
-    return 0;
+    if ([m_webView _usesDocumentViews])
+        return 0;
+    return m_webView;
 }
 // End host window methods.
 
index 4f2aa57947e3beaf333fc99ee8b181f6414d1380..7cb62fcdcef0e603318139550030f8e4bab20f11 100644 (file)
@@ -60,7 +60,6 @@ public:
 
 private:
     virtual bool hasWebView() const; // mainly for assertions
-    virtual bool hasFrameView() const; // ditto
 
     virtual void makeRepresentation(WebCore::DocumentLoader*);
     virtual bool hasHTMLView() const;
index 7f050267516747ca5194dfc161d9096ee68a829b..b89038c546e512f8a039bcd91d165dd3df777c1c 100644 (file)
@@ -86,6 +86,9 @@
 #import <WebCore/FrameTree.h>
 #import <WebCore/FrameView.h>
 #import <WebCore/HTMLFormElement.h>
+#import <WebCore/HTMLFrameElement.h>
+#import <WebCore/HTMLFrameOwnerElement.h>
+#import <WebCore/HTMLNames.h>
 #import <WebCore/HistoryItem.h>
 #import <WebCore/HitTestResult.h>
 #import <WebCore/IconDatabase.h>
 #endif
 
 using namespace WebCore;
+using namespace HTMLNames;
 
 #if ENABLE(MAC_JAVA_BRIDGE)
 @interface NSView (WebJavaPluginDetails)
@@ -156,11 +160,6 @@ bool WebFrameLoaderClient::hasWebView() const
     return [m_webFrame.get() webView] != nil;
 }
 
-bool WebFrameLoaderClient::hasFrameView() const
-{
-    return m_webFrame->_private->webFrameView != nil;
-}
-
 void WebFrameLoaderClient::makeRepresentation(DocumentLoader* loader)
 {
     [dataSource(loader) _makeRepresentation];
@@ -184,6 +183,8 @@ void WebFrameLoaderClient::forceLayout()
 void WebFrameLoaderClient::forceLayoutForNonHTML()
 {
     WebFrameView *thisView = m_webFrame->_private->webFrameView;
+    if (!thisView) // Viewless mode.
+        return;
     NSView <WebDocumentView> *thisDocumentView = [thisView documentView];
     ASSERT(thisDocumentView != nil);
     
@@ -494,7 +495,7 @@ void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title)
 void WebFrameLoaderClient::dispatchDidCommitLoad()
 {
     // Tell the client we've committed this URL.
-    ASSERT([m_webFrame->_private->webFrameView documentView] != nil);
+    ASSERT([m_webFrame->_private->webFrameView documentView] != nil || ![getWebView(m_webFrame.get()) _usesDocumentViews]);
     
     WebView *webView = getWebView(m_webFrame.get());   
     [webView _didCommitLoadForFrame:m_webFrame.get()];
@@ -950,24 +951,26 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
     WebView *webView = getWebView(m_webFrame.get());
     [webView removePluginInstanceViewsFor:(m_webFrame.get())];
     
-    NSView <WebDocumentView> *documentView = [v _makeDocumentViewForDataSource:ds];
-    if (!documentView)
-        return;
+    BOOL useDocumentViews = [webView _usesDocumentViews];
+    NSView <WebDocumentView> *documentView = nil;
+    if (useDocumentViews) {
+        documentView = [v _makeDocumentViewForDataSource:ds];
+        if (!documentView)
+            return;
+    }
 
     // FIXME: Could we skip some of this work for a top-level view that is not a WebHTMLView?
 
     // If we own the view, delete the old one - otherwise the render m_frame will take care of deleting the view.
     Frame* coreFrame = core(m_webFrame.get());
     coreFrame->setView(0);
-    FrameView* coreView = new FrameView(coreFrame);
+    FrameView* coreView;
+    if (useDocumentViews)
+        coreView = new FrameView(coreFrame);
+    else
+        coreView = new FrameView(coreFrame, IntSize([webView bounds].size));
     coreFrame->setView(coreView);
     coreView->deref(); // FIXME: Eliminate this crazy refcounting!
-    int marginWidth = [v _marginWidth];
-    if (marginWidth >= 0)
-        coreView->setMarginWidth(marginWidth);
-    int marginHeight = [v _marginHeight];
-    if (marginHeight >= 0)
-        coreView->setMarginHeight(marginHeight);
 
     [m_webFrame.get() _updateBackgroundAndUpdatesWhileOffscreen];
 
@@ -976,6 +979,10 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
     // Call setDataSource on the document view after it has been placed in the view hierarchy.
     // This what we for the top-level view, so should do this for views in subframes as well.
     [documentView setDataSource:ds];
+    
+    if (HTMLFrameOwnerElement* owner = coreFrame->ownerElement())
+        coreFrame->view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
+    
 }
 
 RetainPtr<WebFramePolicyListener> WebFrameLoaderClient::setUpPolicyListener(FramePolicyFunction function)
@@ -1082,32 +1089,27 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
     
     ASSERT(m_webFrame);
     
-    WebFrameView *childView = [[WebFrameView alloc] init];
-    [childView _setMarginWidth:marginWidth];
-    [childView _setMarginHeight:marginHeight];
-
-    RefPtr<Frame> newCoreFrame = [WebFrame _createSubframeWithOwnerElement:ownerElement frameName:name frameView:childView];
-    if (newCoreFrame->view())
-        newCoreFrame->view()->setCanHaveScrollbars(allowsScrolling);
-
+    WebFrameView *childView = [getWebView(m_webFrame.get()) _usesDocumentViews] ? [[WebFrameView alloc] init] : nil;
+    
+    RefPtr<Frame> result = [WebFrame _createSubframeWithOwnerElement:ownerElement frameName:name frameView:childView];
     [childView release];
 
-    WebFrame *newFrame = kit(newCoreFrame.get());
+    WebFrame *newFrame = kit(result.get());
 
     if ([newFrame _dataSource])
         [[newFrame _dataSource] _documentLoader]->setOverrideEncoding([[m_webFrame.get() _dataSource] _documentLoader]->overrideEncoding());  
 
     // The creation of the frame may have run arbitrary JavaScript that removed it from the page already.
-    if (!newCoreFrame->page())
+    if (!result->page())
         return 0;
  
-    core(m_webFrame.get())->loader()->loadURLIntoChildFrame(url, referrer, newCoreFrame.get());
+    core(m_webFrame.get())->loader()->loadURLIntoChildFrame(url, referrer, result.get());
 
     // The frame's onload handler may have removed it from the document.
-    if (!newCoreFrame->tree()->parent())
+    if (!result->tree()->parent())
         return 0;
 
-    return newCoreFrame.release();
+    return result.release();
 
     END_BLOCK_OBJC_EXCEPTIONS;
 
index da5e136a227b7afb3e215bcff45a1f25295c3d05..50100121297c9fcbed4806b60e7fa8c9599df88b 100644 (file)
@@ -553,13 +553,18 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
     return [[[NSString alloc] initWithCharactersNoCopy:buf length:length freeWhenDone:YES] autorelease];
 }
 
-- (void)_drawRect:(NSRect)rect
+- (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly
 {
     PlatformGraphicsContext* platformContext = static_cast<PlatformGraphicsContext*>([[NSGraphicsContext currentContext] graphicsPort]);
     ASSERT([[NSGraphicsContext currentContext] isFlipped]);
     GraphicsContext context(platformContext);
     
-    _private->coreFrame->view()->paintContents(&context, enclosingIntRect(rect));
+    if (contentsOnly)
+        _private->coreFrame->view()->paintContents(&context, enclosingIntRect(rect));
+    else {
+        _private->coreFrame->view()->layoutIfNeededRecursive();
+        _private->coreFrame->view()->paint(&context, enclosingIntRect(rect));
+    }
 }
 
 // Used by pagination code called from AppKit when a standalone web page is printed.
index 3436df68ad954629c445c0bbe2b7150ce88e484c..5cf7690fb6117a181365992faf81de27fa172bba 100644 (file)
@@ -139,7 +139,7 @@ WebView *getWebView(WebFrame *webFrame);
 - (WebDataSource *)_dataSource;
 
 - (BOOL)_needsLayout;
-- (void)_drawRect:(NSRect)rect;
+- (void)_drawRect:(NSRect)rect contentsOnly:(BOOL)contentsOnly;
 - (BOOL)_getVisibleRect:(NSRect*)rect;
 - (NSArray*)_computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight;
 
index da29d9dbf18bcd4717d10c57f7356fa463a09517..e9c0aae673ad9645f51c8490e0fe7f31141cb26b 100644 (file)
@@ -90,26 +90,11 @@ enum {
 @public
     WebFrame *webFrame;
     WebDynamicScrollBarsView *frameScrollView;
-    
-    // These margin values are used to temporarily hold the margins of a frame until
-    // we have the appropriate document view type.
-    int marginWidth;
-    int marginHeight;
 }
 @end
 
 @implementation WebFrameViewPrivate
 
-- init
-{
-    [super init];
-    
-    marginWidth = -1;
-    marginHeight = -1;
-    
-    return self;
-}
-
 - (void)dealloc
 {
     [frameScrollView release];
@@ -141,26 +126,6 @@ enum {
     return [_private->webFrame webView];
 }
 
-- (void)_setMarginWidth:(int)w
-{
-    _private->marginWidth = w;
-}
-
-- (int)_marginWidth
-{
-    return _private->marginWidth;
-}
-
-- (void)_setMarginHeight:(int)h
-{
-    _private->marginHeight = h;
-}
-
-- (int)_marginHeight
-{
-    return _private->marginHeight;
-}
-
 - (void)_setDocumentView:(NSView <WebDocumentView> *)view
 {
     WebDynamicScrollBarsView *sv = [self _scrollView];
index 978f24b0cb618bc4b9af735b7c8c780db8f6d523..726b62e3208b0050839972fe0122501e9c1f4518 100644 (file)
 - (void)_setDocumentView:(NSView <WebDocumentView> *)view;
 - (NSView <WebDocumentView> *)_makeDocumentViewForDataSource:(WebDataSource *)dataSource;
 - (void)_setWebFrame:(WebFrame *)webFrame;
-- (int)_marginWidth;
-- (int)_marginHeight;
-- (void)_setMarginWidth:(int)w;
-- (void)_setMarginHeight:(int)h;
 - (float)_verticalPageScrollDistance;
 + (NSMutableDictionary *)_viewTypesAllowImageTypeOmission:(BOOL)allowImageTypeOmission;
 + (Class)_viewClassForMIMEType:(NSString *)MIMEType;
index f60cf667782378ee4a84feeaac1da0a794b2c41d..b6b9d6255418e78ace844bef6dff0fd38a587574 100644 (file)
@@ -2936,7 +2936,7 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
             NSRectFill (rect);
         }
 
-        [[self _frame] _drawRect:rect];
+        [[self _frame] _drawRect:rect contentsOnly:YES];
 
         WebView *webView = [self _webView];
 
@@ -2978,27 +2978,7 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
     double start = CFAbsoluteTimeGetCurrent();
 #endif
 
-    // If count == 0 here, use the rect passed in for drawing. This is a workaround for:
-    // <rdar://problem/3908282> REGRESSION (Mail): No drag image dragging selected text in Blot and Mail
-    // The reason for the workaround is that this method is called explicitly from the code
-    // to generate a drag image, and at that time, getRectsBeingDrawn:count: will return a zero count.
-    const int cRectThreshold = 10;
-    const float cWastedSpaceThreshold = 0.75f;
-    BOOL useUnionedRect = (count <= 1) || (count > cRectThreshold);
-    if (!useUnionedRect) {
-        // Attempt to guess whether or not we should use the unioned rect or the individual rects.
-        // We do this by computing the percentage of "wasted space" in the union.  If that wasted space
-        // is too large, then we will do individual rect painting instead.
-        float unionPixels = (rect.size.width * rect.size.height);
-        float singlePixels = 0;
-        for (int i = 0; i < count; ++i)
-            singlePixels += rects[i].size.width * rects[i].size.height;
-        float wastedSpace = 1 - (singlePixels / unionPixels);
-        if (wastedSpace <= cWastedSpaceThreshold)
-            useUnionedRect = YES;
-    }
-    
-    if (useUnionedRect)
+    if ([[self _webView] _mustDrawUnionedRect:rect singleRects:rects count:count])
         [self drawSingleRect:rect];
     else
         for (int i = 0; i < count; ++i)
index 9139536a84a893126db1eb9f521f4537c7b3657f..bc121fd99a0dd5faafaa186a5a38b9dd789cf286 100644 (file)
@@ -575,29 +575,83 @@ static CFMutableSetRef allWebViewsSet;
 
 @implementation WebView (WebPrivate)
 
-#ifdef DEBUG_WIDGET_DRAWING
-static bool debugWidget = true;
-- (void)drawRect:(NSRect)rect
+- (BOOL)isFlipped 
+{
+    return !_private->useDocumentViews;
+}
+
+- (void)_boundsChanged
+{
+    Frame* frame = core([self mainFrame]);
+    frame->view()->resize([self bounds].size.width, [self bounds].size.height);
+}
+
+- (BOOL)_mustDrawUnionedRect:(NSRect)rect singleRects:(const NSRect *)rects count:(NSInteger)count
+{
+    // If count == 0 here, use the rect passed in for drawing. This is a workaround for:
+    // <rdar://problem/3908282> REGRESSION (Mail): No drag image dragging selected text in Blot and Mail
+    // The reason for the workaround is that this method is called explicitly from the code
+    // to generate a drag image, and at that time, getRectsBeingDrawn:count: will return a zero count.
+    const int cRectThreshold = 10;
+    const float cWastedSpaceThreshold = 0.75f;
+    BOOL useUnionedRect = (count <= 1) || (count > cRectThreshold);
+    if (!useUnionedRect) {
+        // Attempt to guess whether or not we should use the unioned rect or the individual rects.
+        // We do this by computing the percentage of "wasted space" in the union.  If that wasted space
+        // is too large, then we will do individual rect painting instead.
+        float unionPixels = (rect.size.width * rect.size.height);
+        float singlePixels = 0;
+        for (int i = 0; i < count; ++i)
+            singlePixels += rects[i].size.width * rects[i].size.height;
+        float wastedSpace = 1 - (singlePixels / unionPixels);
+        if (wastedSpace <= cWastedSpaceThreshold)
+            useUnionedRect = YES;
+    }
+    return useUnionedRect;
+}
+
+- (void)drawSingleRect:(NSRect)rect
 {
-    [[NSColor blueColor] set];
-    NSRectFill (rect);
+    ASSERT(!_private->useDocumentViews);
     
-    NSRect htmlViewRect = [[[[self mainFrame] frameView] documentView] frame];
+    [NSGraphicsContext saveGraphicsState];
+    NSRectClip(rect);
 
-    if (debugWidget) {
-        while (debugWidget) {
-            sleep (1);
-        }
+    @try {
+        [[self mainFrame] _drawRect:rect contentsOnly:NO];
+
+        WebView *webView = [self _webView];
+        [[webView _UIDelegateForwarder] webView:webView didDrawRect:rect];
+
+        if (WebNodeHighlight *currentHighlight = [webView currentNodeHighlight])
+            [currentHighlight setNeedsUpdateInTargetViewRect:rect];
+
+        [NSGraphicsContext restoreGraphicsState];
+    } @catch (NSException *localException) {
+        [NSGraphicsContext restoreGraphicsState];
+        LOG_ERROR("Exception caught while drawing: %@", localException);
+        [localException raise];
     }
+}
 
-    NSLog (@"%s:   rect:  (%0.f,%0.f) %0.f %0.f, htmlViewRect:  (%0.f,%0.f) %0.f %0.f\n", 
-        __PRETTY_FUNCTION__, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height,
-        htmlViewRect.origin.x, htmlViewRect.origin.y, htmlViewRect.size.width, htmlViewRect.size.height
-    );
+- (void)drawRect:(NSRect)rect
+{
+    if (_private->useDocumentViews)
+        return [super drawRect:rect];
+    
+    ASSERT_MAIN_THREAD();
+
+    const NSRect *rects;
+    NSInteger count;
+    [self getRectsBeingDrawn:&rects count:&count];
 
-    [super drawRect:rect];
+    
+    if ([self _mustDrawUnionedRect:rect singleRects:rects count:count])
+        [self drawSingleRect:rect];
+    else
+        for (int i = 0; i < count; ++i)
+            [self drawSingleRect:rects[i]];
 }
-#endif
 
 + (NSArray *)_supportedMIMETypes
 {
@@ -1926,7 +1980,7 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
     initialized = YES;
 }
 
-- (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName
+- (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews
 {
 #ifndef NDEBUG
     WTF::RefCountedLeakCounter::suppressMessages(webViewIsOpen);
@@ -1941,12 +1995,16 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
     _private->drawsBackground = YES;
     _private->smartInsertDeleteEnabled = YES;
     _private->backgroundColor = [[NSColor whiteColor] retain];
-
-    NSRect f = [self frame];
-    WebFrameView *frameView = [[WebFrameView alloc] initWithFrame: NSMakeRect(0,0,f.size.width,f.size.height)];
-    [frameView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-    [self addSubview:frameView];
-    [frameView release];
+    _private->useDocumentViews = usesDocumentViews;
+
+    WebFrameView *frameView = nil;
+    if (_private->useDocumentViews) {
+        NSRect f = [self frame];
+        frameView = [[WebFrameView alloc] initWithFrame: NSMakeRect(0,0,f.size.width,f.size.height)];
+        [frameView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
+        [self addSubview:frameView];
+        [frameView release];
+    }
 
     WebKitInitializeLoggingChannelsIfNecessary();
     WebCore::InitializeLoggingChannelsIfNecessary();
@@ -2005,7 +2063,12 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
     return [self initWithFrame:f frameName:nil groupName:nil];
 }
 
-- (id)initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName;
+- (id)initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName
+{
+    return [self _initWithFrame:f frameName:frameName groupName:groupName usesDocumentViews:YES];
+}
+
+- (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews
 {
     self = [super initWithFrame:f];
     if (!self)
@@ -2024,7 +2087,7 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
 #endif
 
     _private = [[WebViewPrivate alloc] init];
-    [self _commonInitializationWithFrameName:frameName groupName:groupName];
+    [self _commonInitializationWithFrameName:frameName groupName:groupName usesDocumentViews:usesDocumentViews];
     [self setMaintainsBackForwardList: YES];
     return self;
 }
@@ -2076,7 +2139,7 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
             preferences = nil;
 
         LOG(Encoding, "FrameName = %@, GroupName = %@, useBackForwardList = %d\n", frameName, groupName, (int)useBackForwardList);
-        [result _commonInitializationWithFrameName:frameName groupName:groupName];
+        [result _commonInitializationWithFrameName:frameName groupName:groupName usesDocumentViews:YES];
         [result page]->backForwardList()->setEnabled(useBackForwardList);
         result->_private->allowsUndo = allowsUndo;
         if (preferences)
@@ -2164,6 +2227,16 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
     return _private->shouldCloseWithWindow;
 }
 
+- (void)removeSizeObservers
+{
+    if (!_private->useDocumentViews && [self window]) {
+        [[NSNotificationCenter defaultCenter] removeObserver:self
+            name:NSViewFrameDidChangeNotification object:self];
+        [[NSNotificationCenter defaultCenter] removeObserver:self
+            name:NSViewBoundsDidChangeNotification object:self];
+    }
+}
+
 - (void)viewWillMoveToWindow:(NSWindow *)window
 {
     // Don't do anything if the WebView isn't initialized.
@@ -2186,6 +2259,8 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
         // and over, so do them when we move into a window.
         [window setAcceptsMouseMovedEvents:YES];
         WKSetNSWindowShouldPostEventNotifications(window, YES);
+        
+        [self removeSizeObservers];
     }
 }
 
@@ -2474,6 +2549,16 @@ static void WebKitInitializeApplicationCachePathIfNecessary()
         [self _setZoomMultiplier:1.0f isTextOnly:isTextOnly];
 }
 
+- (void)viewWillMoveToSuperview:(NSView *)newSuperview
+{
+    [self removeSizeObservers];
+}
+
+- (BOOL)_usesDocumentViews
+{
+    return _private->useDocumentViews;
+}
+
 - (void)setApplicationNameForUserAgent:(NSString *)applicationName
 {
     NSString *name = [applicationName copy];
index fd658385c1271d8a56dd6d3495f514b7dd663227..3d3c10c3f4e42ce5f80ea493d14d720edfc93d00 100644 (file)
@@ -140,8 +140,10 @@ typedef WebCore::Page WebCorePage;
 - (BOOL)_canResetZoom:(BOOL)isTextOnly;
 - (IBAction)_resetZoom:(id)sender isTextOnly:(BOOL)isTextOnly;
 
+- (id)_initWithFrame:(NSRect)f frameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews;
 - (BOOL)_usesDocumentViews;
-- (void)_setUsesDocumentViews:(BOOL)useViews;
+
+- (BOOL)_mustDrawUnionedRect:(NSRect)rect singleRects:(const NSRect *)rects count:(NSInteger)count;
 
 + (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame;
 
index 97bc2fa879e4588f91c8587fce60944b6e14fd21..0c093c44bcf6d1c5e66298991f071febbcbc9aee 100644 (file)
@@ -1,3 +1,12 @@
+2008-10-06  David Hyatt  <hyatt@apple.com>
+
+        Enable viewless Mac WebKit to paint some basic pages.
+        
+        Reviewed by Sam Weinig
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::transitionToCommittedForNewPage):
+
 2008-10-03  David Hyatt  <hyatt@apple.com>
 
         Fix scroll method on Qt.  The delta was supposed to use .width()/.height() and not .x()/.y().
index ea2d6cb04a6498093f73ef9a6004313554957945..53e984f3c2e09c5960f40a152a6a6a41bd1cf5f4 100644 (file)
@@ -196,13 +196,6 @@ bool FrameLoaderClientQt::hasWebView() const
     return true;
 }
 
-
-bool FrameLoaderClientQt::hasFrameView() const
-{
-    //notImplemented();
-    return true;
-}
-
 void FrameLoaderClientQt::savePlatformDataToCachedPage(CachedPage*) 
 {
     notImplemented();
@@ -230,17 +223,6 @@ void FrameLoaderClientQt::transitionToCommittedForNewPage()
     else
         frameView = new FrameView(m_frame);
 
-    if (!m_webFrame->d->allowsScrolling)
-        frameView->setCanHaveScrollbars(false);
-    if (m_webFrame->d->marginWidth != -1)
-        frameView->setMarginWidth(m_webFrame->d->marginWidth);
-    if (m_webFrame->d->marginHeight != -1)
-        frameView->setMarginHeight(m_webFrame->d->marginHeight);
-    if (m_webFrame->d->horizontalScrollBarPolicy != Qt::ScrollBarAsNeeded)
-        frameView->setHorizontalScrollbarMode((ScrollbarMode)m_webFrame->d->horizontalScrollBarPolicy);
-    if (m_webFrame->d->verticalScrollBarPolicy != Qt::ScrollBarAsNeeded)
-        frameView->setVerticalScrollbarMode((ScrollbarMode)m_webFrame->d->verticalScrollBarPolicy);
-
     m_frame->setView(frameView);
     // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.
     frameView->deref();
index b60532a36976c439813aab666e80314a4bc954d6..fd1d959ced3fcfbad735d439088db1e418487d49 100644 (file)
@@ -1,3 +1,13 @@
+2008-10-06  David Hyatt  <hyatt@apple.com>
+
+        Enable viewless Mac WebKit to paint some basic pages.
+        
+        Reviewed by Sam Weinig
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::createFrame):
+        * WebCoreSupport/WebFrameLoaderClient.h:
+
 2008-10-03  David Hyatt  <hyatt@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=21340
index 573c2a0b860f8cfca4fb8373ce2d5eb0be7ecd48..17bee476918b53cadf4a928d90ea83b4c9287301 100644 (file)
@@ -86,11 +86,6 @@ bool WebFrameLoaderClient::hasWebView() const
     return m_webFrame->webView();
 }
 
-bool WebFrameLoaderClient::hasFrameView() const
-{
-    return core(m_webFrame)->view();
-}
-
 void WebFrameLoaderClient::forceLayout()
 {
     core(m_webFrame)->forceLayout(true);
@@ -532,20 +527,6 @@ PassRefPtr<Frame> WebFrameLoaderClient::createFrame(const KURL& url, const Strin
     RefPtr<Frame> result = createFrame(url, name, ownerElement, referrer);
     if (!result)
         return 0;
-
-    // Propagate the marginwidth/height and scrolling modes to the view.
-    if (ownerElement->hasTagName(frameTag) || ownerElement->hasTagName(iframeTag)) {
-        HTMLFrameElement* frameElt = static_cast<HTMLFrameElement*>(ownerElement);
-        if (frameElt->scrollingMode() == ScrollbarAlwaysOff)
-            result->view()->setCanHaveScrollbars(false);
-        int marginWidth = frameElt->getMarginWidth();
-        int marginHeight = frameElt->getMarginHeight();
-        if (marginWidth != -1)
-            result->view()->setMarginWidth(marginWidth);
-        if (marginHeight != -1)
-            result->view()->setMarginHeight(marginHeight);
-    }
-
     return result.release();
 }
 
index 11b4880144518dca115e9419e75c5f0daf6c7203..b9fd02723a4b514e4284915f0f96cd611f48ef5a 100644 (file)
@@ -43,7 +43,6 @@ class WebFrame;
 class WebFrameLoaderClient : public WebCore::FrameLoaderClient {
 public:
     virtual bool hasWebView() const;
-    virtual bool hasFrameView() const;
 
     virtual void forceLayout();
 
index 2c727594b2f4c9e435f637eb214ccf0650d5d2bd..df8386d35dd765c2fefba06a02177a18910c1c8f 100644 (file)
@@ -1,3 +1,12 @@
+2008-10-06  David Hyatt  <hyatt@apple.com>
+
+        Enable viewless Mac WebKit to paint some basic pages.
+        
+        Reviewed by Sam Weinig
+
+        * WebKitSupport/FrameLoaderClientWx.cpp:
+        * WebKitSupport/FrameLoaderClientWx.h:
+
 2008-10-03  David Hyatt  <hyatt@apple.com>
 
          Remove addToDirtyRegion.
index 0f3a68cb3020a09a4cf54cfdd1203635366c16ed..716fe6cdbcf5dcd3ee63093ce9a65510f4097fca 100644 (file)
@@ -111,14 +111,6 @@ bool FrameLoaderClientWx::hasWebView() const
     return true;
 }
 
-
-bool FrameLoaderClientWx::hasFrameView() const
-{
-    notImplemented();
-    return true;
-}
-
-
 bool FrameLoaderClientWx::hasBackForwardList() const
 {
     notImplemented();
index b21253295456ec1f13bd030794b49b85cecc15c9..8c144caa70bfa8a8336958b77e4f3a2c1a3735f2 100644 (file)
@@ -60,7 +60,6 @@ namespace WebCore {
         virtual void deref();
 
         virtual bool hasWebView() const; // mainly for assertions
-        virtual bool hasFrameView() const; // ditto
 
         virtual bool hasBackForwardList() const;
         virtual void resetBackForwardList();