Reviewed by Tim Hatcher
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2007 23:00:07 +0000 (23:00 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2007 23:00:07 +0000 (23:00 +0000)
commitb1a60e09c2667ec851f6c5187ddf16c73cbb8e19
treec105219874ae88cc54f0234ab18fdb8a7c6eda57
parent8d60a101bb0d687d11dc0c7232d5ddca628eb1c5
    Reviewed by Tim Hatcher

        - fixed <rdar://problem/5138492> Safari doesn't remember some changes to the PDF scale and display mode

        Some of the user interactions that could change the PDF scale and display mode were not going through
        the proxy mechanism in WebPDFView that updates preferences. Now we also listen to PDFKit notifications
        in order to catch the other cases.

        * WebView/WebPDFView.h:
        new _ignoreScaleAndDisplayModeNotifications and _updatePreferencesTimer ivars

        * WebView/WebPDFView.mm:
        (-[WebPDFView setPDFDocument:]):
        ignore scale and display mode notifications while we're setting up a fresh document
        (-[WebPDFView dealloc]):
        cancel the new timer (which releases it)
        (-[WebPDFView viewDidMoveToWindow]):
        listen for two PDFKit notifications
        (-[WebPDFView viewWillMoveToWindow:]):
        stop listening to the two PDFKit notifications
        (-[WebPDFView _applyPDFDefaults]):
        white space change
        (-[WebPDFView _cancelUpdatePreferencesTimer]):
        invalidate, release, and nil out the timer
        (-[WebPDFView _scaleOrDisplayModeChanged:]):
        update preferences soon, unless deliberately ignoring these notifications
        (-[WebPDFView _updatePreferencesNow]):
        cancel timer, then save data to preferences (code for saving the data was extracted from
        -[PDFPrefUpdatingProxy forwardInvocation:])
        (-[WebPDFView _updatePreferencesSoon]):
        use timer to consolidate multiple calls into one action; formerly we were setting preferences
        multiple times for some atomic user actions
        (-[PDFPrefUpdatingProxy forwardInvocation:]):
        call _updatePreferencesSoon where we used to immediately set preferences

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit/ChangeLog
WebKit/WebView/WebPDFView.h
WebKit/WebView/WebPDFView.mm