Commit 4e770aa5 authored by mitz@apple.com's avatar mitz@apple.com

Reviewed by Jessica Kahn.

        - fix <rdar://problem/5965013> Page 2 does not print correctly

        When printing, _recursiveDisplayRectIfNeededIgnoringOpacity:... and
        _recursiveDisplayAllDirtyWithLockFocus:... can be invoked without
        -viewWillDraw being sent first, which could lead to painting without
        valid layout. The fix is to ensure up-to-date layout in those methods
        when printing.

        * WebView/WebHTMLView.mm:
        (-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
        (-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent daed70e3
2008-05-29 Dan Bernstein <mitz@apple.com>
Reviewed by Jessica Kahn.
- fix <rdar://problem/5965013> Page 2 does not print correctly
When printing, _recursiveDisplayRectIfNeededIgnoringOpacity:... and
_recursiveDisplayAllDirtyWithLockFocus:... can be invoked without
-viewWillDraw being sent first, which could lead to painting without
valid layout. The fix is to ensure up-to-date layout in those methods
when printing.
* WebView/WebHTMLView.mm:
(-[WebHTMLView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]):
(-[WebHTMLView _recursiveDisplayAllDirtyWithLockFocus:visRect:]):
2008-05-28 Anders Carlsson <andersca@apple.com>
Reviewed by Jon.
......
......@@ -1122,12 +1122,15 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
// If the WebHTMLView itself is what we're printing, then we will never have to do this.
BOOL wasInPrintingMode = _private->printing;
BOOL isPrinting = ![NSGraphicsContext currentContextDrawingToScreen];
if (wasInPrintingMode != isPrinting) {
if (isPrinting)
if (isPrinting) {
if (!wasInPrintingMode)
[self _web_setPrintingModeRecursive];
#ifndef BUILDING_ON_TIGER
else
[self _web_clearPrintingModeRecursive];
}
[self _web_layoutIfNeededRecursive];
#endif
} else if (wasInPrintingMode)
[self _web_clearPrintingModeRecursive];
#ifdef BUILDING_ON_TIGER
......@@ -1160,12 +1163,15 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
if (needToSetAsideSubviews) {
// This helps when we print as part of a larger print process.
// If the WebHTMLView itself is what we're printing, then we will never have to do this.
if (wasInPrintingMode != isPrinting) {
if (isPrinting)
if (isPrinting) {
if (!wasInPrintingMode)
[self _web_setPrintingModeRecursive];
#ifndef BUILDING_ON_TIGER
else
[self _web_clearPrintingModeRecursive];
}
[self _web_layoutIfNeededRecursive];
#endif
} else if (wasInPrintingMode)
[self _web_clearPrintingModeRecursive];
#ifdef BUILDING_ON_TIGER
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment