Bug 126591 - vw units don't look at the right viewport in print media
Summary: vw units don't look at the right viewport in print media
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Printing (show other bugs)
Version: WebKit Nightly Build
Hardware: Macintosh OS X 10.11
: P2 Major
Assignee: Benjamin Poulain
URL: http://output.jsbin.com/duyosa/1/quiet
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2014-01-07 12:56 PST by Brad
Modified: 2016-04-11 22:22 PDT (History)
8 users (show)

See Also:


Attachments
Patch (9.38 KB, patch)
2014-07-06 21:10 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brad 2014-01-07 12:56:51 PST
VW units are supposed to be based on the width of the initial containing block (which is divided into 100 VW units). But when printed, the ICB is the page area (the printable area of the piece of paper). Webkit seems to be using the width of the window on the monitor instead as its reference for print VWs. What's more, it does this even when the page is inside an iframe: it uses the width of the outer window instead of the width of the iframe. 1VW should instead be 1/100 of the print area of the page.
Comment 1 Brad 2014-01-07 12:58:06 PST
Correction: 1VW should instead be 1/100 of the WIDTH of the print area of the page.
Comment 2 Benjamin Poulain 2014-07-06 21:10:44 PDT
Created attachment 234476 [details]
Patch
Comment 3 Benjamin Poulain 2014-07-06 21:17:42 PDT
Dave, Antti, Dean, could you please have a look at this first patch? I need to add tests and fix the exports, but I would like some early feedback.

Something I know nothing about is the other type of pagination. I have no idea how the layout works for epub or paginated UIWebView.
Comment 4 Frances de Waal 2015-08-07 05:09:16 PDT
Not sure if this is related, but if font-size is set with vw it will not be printed at all in a webkit browser.
Comment 5 Chris Rebert 2015-09-10 01:29:53 PDT
(In reply to comment #4)
> Not sure if this is related, but if font-size is set with vw it will not be
> printed at all in a webkit browser.

That sounds like https://code.google.com/p/chromium/issues/detail?id=382313
Comment 6 Chris Rebert 2016-04-11 22:22:05 PDT
Still reproduces in recent Nightly.