Bug 127381

Summary: REGRESSION (r161580): Some PDFs render outside their <img>
Product: WebKit Reporter: Tim Horton <thorton>
Component: PDFAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, commit-queue, mitz, sam, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch simon.fraser: review+, thorton: commit-queue-

Description Tim Horton 2014-01-21 16:22:57 PST
In r161580, I made an adjustment to how we choose the final scale for PDF-in-<img>, to fix unexpected non-uniform scaling due to integer rounding at layout/paint time. Two issues with this:

1. It was happening for all PDFs, even if they had equal scale.
2. It was using the average of the endpoints of the intersection of the possible integer-rounded scale ranges, which is usually greater than the minimum original scale, which means that sometimes the scale we chose would cause the image to be painted outside of the bounds of the <img>.

This broke icons in the Web Inspector on a branch where we have r161580 but the Inspector icons are still PDF (not true on ToT).

<rdar://problem/15872168>
Comment 1 Tim Horton 2014-01-21 16:25:07 PST
Created attachment 221805 [details]
patch
Comment 2 Tim Horton 2014-01-21 17:29:23 PST
Comment on attachment 221805 [details]
patch

Gonna land it by hand.
Comment 3 Tim Horton 2014-01-21 17:30:01 PST
http://trac.webkit.org/changeset/162486