Reviewed by Darin Adler.
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Feb 2011 00:28:05 +0000 (00:28 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Feb 2011 00:28:05 +0000 (00:28 +0000)
commit3e58000fcc369054fd586ffc8fc1cee2b10a68da
tree34c4669ee6c1a078628e429082049e6d3b303d69
parentee424bf391937097622814dab89565f3a3c5c250
    Reviewed by Darin Adler.

        https://bugs.webkit.org/show_bug.cgi?id=53823
        Print layout sometimes seen on screen

        <rdar://problem/8948742> REGRESSION (WebKit2) - When I print a page, I visually see it re-layout
        <rdar://problem/8899389> REGRESSION(WebKit2): Wrong content can appear when print dialog is up

        * UIProcess/API/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setAutodisplay): Removed a
        branch that didn't do anything useful.

        * UIProcess/API/mac/WKPrintingView.h:
        * UIProcess/API/mac/WKPrintingView.mm:
        (-[WKPrintingView _suspendAutodisplay]):
        (-[WKPrintingView _delayedResumeAutodisplayTimerFired]):
        (-[WKPrintingView _delayedResumeAutodisplay]):
        (-[WKPrintingView knowsPageRange:]):
        (-[WKPrintingView beginDocument]):
        (-[WKPrintingView endDocument]):
        When page setup changes, or when going from print preview to actual printing, AppKit calls
        -endDocument just to begin it again. Delay resuming autodisplay until the next run loop
        iteration.

        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::invalidateContentsAndWindow):
        (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
        Tightened it up from other side - we should never send pixels to UI process while in
        printing mode. This is not 100% reliable, because relayout doesn't happen immediately,
        and we can still have print layout in screen mode - but it helps.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/API/mac/WKPrintingView.h
Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp