[Webkit-unassigned] [Bug 157924] New: REGRESSION (r188642): All pages are blank when printing a webpage in iOS Safari

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 19 14:34:32 PDT 2016


            Bug ID: 157924
           Summary: REGRESSION (r188642): All pages are blank when
                    printing a webpage in iOS Safari
    Classification: Unclassified
           Product: WebKit
           Version: Other
          Hardware: iOS
                OS: All
            Status: NEW
          Severity: Blocker
          Priority: P2
         Component: Printing
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: aestes at apple.com

When UIPrintInteractionController asks WKWebView to print a webpage, it does so in several phases. First we're asked to compute the page count, then later we're asked to draw each page into a supplied CGContext in a series of messages.

When WKWebView is asked for the page count, we send a message to the Web process asking it to compute and return the page count synchronously and then immediately start drawing the page for printing. If the drawing has finished by the time we're asked to print the first page, then we can do so without waiting. But if it hasn't then we block by calling Connection::waitForMessage(), passing std::chromo::milliseconds::max() as the relative timeout.

Prior to r188642, Connection::waitForMessage() called std::condition_variable::wait_for(), which takes a relative timeout value. r188642 replaced this with WTF::Condition::waitUntil(), which takes an absolute timeout instead. To convert from relative to absolute, this line was added to Connection::waitForMessage():

    Condition::Clock::time_point absoluteTimeout = Condition::Clock::now() + timeout;

Condition::Clock::now() has a duration in nanoseconds, which causes signed overflow when converted to milliseconds and added to milliseconds::max(). This makes absoluteTimeout end up being less than Condition::Clock::now(), and so instead of waiting indefinitely for the printed data, we timeout immediately and print nothing.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160519/b1472797/attachment-0001.html>

More information about the webkit-unassigned mailing list