Bug 73868 - REGRESSION (r95249): Right side is truncated when printing
Summary: REGRESSION (r95249): Right side is truncated when printing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Printing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Critical
Assignee: Kentaro Hara
URL:
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2011-12-05 14:50 PST by Alexey Proskuryakov
Modified: 2011-12-07 16:25 PST (History)
4 users (show)

See Also:


Attachments
A simplified test case (558 bytes, text/html)
2011-12-06 04:41 PST, Kentaro Hara
no flags Details
WIP patch (47.22 KB, patch)
2011-12-06 05:02 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff
patch for review (601.54 KB, patch)
2011-12-07 00:18 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2011-12-05 14:50:36 PST
Right border is truncated when printing from Safari. I could reproduce this with apple.com and yahoo.com, so probably affects most/all pages.

Steps to reproduce:
1. Open http://www.yahoo.com
2. Cmd+P to open print preview dialog.

Results: right side of the page is truncated in preview dialog.

<rdar://problem/10388115>
Comment 1 Kentaro Hara 2011-12-05 15:21:11 PST
I'll take a look at it.
Comment 2 Kentaro Hara 2011-12-06 04:41:12 PST
Created attachment 118027 [details]
A simplified test case

When the attached html is printed, its right side is truncated.
Comment 3 Kentaro Hara 2011-12-06 05:02:18 PST
Created attachment 118029 [details]
WIP patch
Comment 4 Kentaro Hara 2011-12-06 05:12:13 PST
ap, hyatt: I uploaded a patch but I am not sure how I can write a test for the patch.

We need to test if the right sides of all lines in width-overflow.html are printed without being truncated, but how can we know if the right side is truncated or not? While layoutTestController.setPrinting() tells us the position of a bottom border of a page, it does not tell us the position of a right border (as you can see in width-overflow-expected.png). Any idea?
Comment 5 Kentaro Hara 2011-12-06 22:50:20 PST
(In reply to comment #4)
> ap, hyatt: I uploaded a patch but I am not sure how I can write a test for the patch.
> 
> We need to test if the right sides of all lines in width-overflow.html are printed without being truncated, but how can we know if the right side is truncated or not? While layoutTestController.setPrinting() tells us the position of a bottom border of a page, it does not tell us the position of a right border (as you can see in width-overflow-expected.png). Any idea?

Solved. I found that the right edge of the result of setPrinting() is the right border of the page:-)
Comment 6 Kentaro Hara 2011-12-07 00:18:34 PST
Created attachment 118178 [details]
patch for review
Comment 7 Kentaro Hara 2011-12-07 00:21:08 PST
ap, hyatt: Here are the setPrinting() results with/without my patch.

Without my patch: http://haraken.info/a/width-overflow-expected-before.png
With my patch: http://haraken.info/a/width-overflow-expected-after.png
Comment 8 WebKit Review Bot 2011-12-07 16:25:41 PST
Comment on attachment 118178 [details]
patch for review

Clearing flags on attachment: 118178

Committed r102281: <http://trac.webkit.org/changeset/102281>
Comment 9 WebKit Review Bot 2011-12-07 16:25:49 PST
All reviewed patches have been landed.  Closing bug.