[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

ap at apple.com ap at apple.com
Mon Feb 21 00:38:20 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit baad5b392864de058a88e15a6c1a564117ef5046
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Feb 2 18:51:57 2011 +0000

            Reviewed by Sam Weinig.
    
            https://bugs.webkit.org/show_bug.cgi?id=53561
            <rdar://problem/8900228> Stepping through print previews in WebKit2 mode steps in and out of
            printing mode a lot
    
            Disable NSView autodisplay, so that -[WKView drawRect:] isn't called (other than when
            resizing the window), so that we don't have to switch modes all the time.
    
            * UIProcess/API/mac/PageClientImpl.h:
            * UIProcess/API/mac/PageClientImpl.mm:
            (WebKit::PageClientImpl::setAutodisplay):
            * UIProcess/PageClient.h:
            * UIProcess/WebPageProxy.cpp:
            (WebKit::WebPageProxy::setAutodisplay):
            * UIProcess/WebPageProxy.h:
            Pipe the call from WKPrintingView down to WKView.
    
            * UIProcess/API/mac/WKPrintingView.mm:
            (-[WKPrintingView beginDocument]): Added. We don't want to autodisplay WKView while printing,
            because layout is changed to print at the time, and drawing to screen requires relayout.
    
            (-[WKPrintingView endDocument]): When not printing, turn autodisplay back on. Also, call
            -[super endDocument] for unknown but definitive good (oops!).
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77386 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index fd78ef0..a9d63da 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,30 @@
+2011-02-01  Alexey Proskuryakov  <ap at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=53561
+        <rdar://problem/8900228> Stepping through print previews in WebKit2 mode steps in and out of
+        printing mode a lot
+
+        Disable NSView autodisplay, so that -[WKView drawRect:] isn't called (other than when
+        resizing the window), so that we don't have to switch modes all the time.
+
+        * UIProcess/API/mac/PageClientImpl.h:
+        * UIProcess/API/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::setAutodisplay):
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setAutodisplay):
+        * UIProcess/WebPageProxy.h:
+        Pipe the call from WKPrintingView down to WKView.
+
+        * UIProcess/API/mac/WKPrintingView.mm:
+        (-[WKPrintingView beginDocument]): Added. We don't want to autodisplay WKView while printing,
+        because layout is changed to print at the time, and drawing to screen requires relayout.
+        
+        (-[WKPrintingView endDocument]): When not printing, turn autodisplay back on. Also, call
+        -[super endDocument] for unknown but definitive good (oops!).
+
 2011-02-02  David Hyatt  <hyatt at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
index f7d46e5..459bd68 100644
--- a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
+++ b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
@@ -93,6 +93,7 @@ private:
 
     virtual void accessibilityChildTokenReceived(const CoreIPC::DataReference&);    
     virtual void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled);
+    virtual void setAutodisplay(bool);
 
     virtual CGContextRef containingWindowGraphicsContext();
 
diff --git a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
index 4208809..bade3a4 100644
--- a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
+++ b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
@@ -365,6 +365,16 @@ void PageClientImpl::setComplexTextInputEnabled(uint64_t pluginComplexTextInputI
     [m_wkView _setComplexTextInputEnabled:complexTextInputEnabled pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier];
 }
 
+void PageClientImpl::setAutodisplay(bool newState)
+{
+    if (!newState && [[m_wkView window] isAutodisplay])
+        [m_wkView displayIfNeeded];
+    else
+        [m_wkView setNeedsDisplay:NO];
+    
+    [[m_wkView window] setAutodisplay:newState];
+}
+
 CGContextRef PageClientImpl::containingWindowGraphicsContext()
 {
     return static_cast<CGContextRef>([[[m_wkView window] graphicsContext] graphicsPort]);
diff --git a/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm b/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm
index 0dbe7cb..4386dec 100644
--- a/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm
+++ b/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm
@@ -505,6 +505,19 @@ static void prepareDataForPrintingOnSecondaryThread(void* untypedContext)
     return NSMakePoint([[_printOperation printInfo] leftMargin], [[_printOperation printInfo] bottomMargin]);
 }
 
+- (void)beginDocument
+{
+    ASSERT(_printOperation == [NSPrintOperation currentOperation]);
+
+    // Forcing preview update gets us here, but page setup hasn't actually changed.
+    if (_isForcingPreviewUpdate)
+        return;
+
+    [super beginDocument];
+
+    _webFrame->page()->setAutodisplay(false);
+}
+
 - (void)endDocument
 {
     ASSERT(_printOperation == [NSPrintOperation currentOperation]);
@@ -525,5 +538,9 @@ static void prepareDataForPrintingOnSecondaryThread(void* untypedContext)
     _expectedPreviewCallbacks.clear();
     _latestExpectedPreviewCallback = 0;
     _expectedPrintCallback = 0;
+
+    _webFrame->page()->setAutodisplay(true);
+
+    [super endDocument];
 }
 @end
diff --git a/Source/WebKit2/UIProcess/PageClient.h b/Source/WebKit2/UIProcess/PageClient.h
index 8a007ca..47d95d8 100644
--- a/Source/WebKit2/UIProcess/PageClient.h
+++ b/Source/WebKit2/UIProcess/PageClient.h
@@ -130,6 +130,7 @@ public:
 
 #if PLATFORM(MAC)
     virtual void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled) = 0;
+    virtual void setAutodisplay(bool) = 0;
 
     virtual CGContextRef containingWindowGraphicsContext() = 0;
 #endif
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 9283a69..3188d3e 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -2507,6 +2507,11 @@ void WebPageProxy::setComplexTextInputEnabled(uint64_t pluginComplexTextInputIde
 {
     m_pageClient->setComplexTextInputEnabled(pluginComplexTextInputIdentifier, complexTextInputEnabled);
 }
+
+void WebPageProxy::setAutodisplay(bool newState)
+{
+    m_pageClient->setAutodisplay(newState);
+}
 #endif
 
 void WebPageProxy::backForwardRemovedItem(uint64_t itemID)
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h
index ce91c76..4646e21 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.h
+++ b/Source/WebKit2/UIProcess/WebPageProxy.h
@@ -292,6 +292,10 @@ public:
     void drawHeader(WebFrameProxy*, const WebCore::FloatRect&);
     void drawFooter(WebFrameProxy*, const WebCore::FloatRect&);
 
+#if PLATFORM(MAC)
+    void setAutodisplay(bool);
+#endif
+
     void receivedPolicyDecision(WebCore::PolicyAction, WebFrameProxy*, uint64_t listenerID);
 
     void backForwardRemovedItem(uint64_t itemID);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list