Changeset 247291 in webkit


Ignore:
Timestamp:
Jul 9, 2019 6:52:23 PM (5 years ago)
Author:
timothy_horton@apple.com
Message:

Fixed elements appear in the middle of full page screenshots taken when scrolled
https://bugs.webkit.org/show_bug.cgi?id=199649
<rdar://problem/52476226>

Reviewed by Simon Fraser.

Source/WebCore:

  • page/FrameView.h:

Expose a getter for the layout viewport override rect.

Source/WebKit:

  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
Temporarily expand the layout viewport to the size of the snapshotting page,
so that fixed elements sit against the bounds of the page instead of
wherever you're currently scrolled to.

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247282 r247291  
     12019-07-09  Tim Horton  <timothy_horton@apple.com>
     2
     3        Fixed elements appear in the middle of full page screenshots taken when scrolled
     4        https://bugs.webkit.org/show_bug.cgi?id=199649
     5        <rdar://problem/52476226>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * page/FrameView.h:
     10        Expose a getter for the layout viewport override rect.
     11
    1122019-07-09  Alex Christensen  <achristensen@webkit.org>
    213
  • trunk/Source/WebCore/page/FrameView.h

    r246488 r247291  
    261261    // Used with delegated scrolling (i.e. iOS).
    262262    WEBCORE_EXPORT void setLayoutViewportOverrideRect(Optional<LayoutRect>, TriggerLayoutOrNot = TriggerLayoutOrNot::Yes);
     263    Optional<LayoutRect> layoutViewportOverrideRect() const { return m_layoutViewportOverrideRect; }
    263264
    264265    WEBCORE_EXPORT void setVisualViewportOverrideRect(Optional<LayoutRect>);
  • trunk/Source/WebKit/ChangeLog

    r247290 r247291  
     12019-07-09  Tim Horton  <timothy_horton@apple.com>
     2
     3        Fixed elements appear in the middle of full page screenshots taken when scrolled
     4        https://bugs.webkit.org/show_bug.cgi?id=199649
     5        <rdar://problem/52476226>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * WebProcess/WebPage/ios/WebPageIOS.mm:
     10        (WebKit::WebPage::computePagesForPrintingAndDrawToPDF):
     11        Temporarily expand the layout viewport to the size of the snapshotting page,
     12        so that fixed elements sit against the bounds of the page instead of
     13        wherever you're currently scrolled to.
     14
    1152019-07-09  Simon Fraser  <simon.fraser@apple.com>
    216
  • trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

    r247280 r247291  
    36913691        IntSize snapshotSize { FloatSize { printInfo.availablePaperWidth, printInfo.availablePaperHeight } };
    36923692        IntRect snapshotRect { {0, 0}, snapshotSize };
     3693
     3694        auto& frameView = *m_page->mainFrame().view();
     3695        auto originalLayoutViewportOverrideRect = frameView.layoutViewportOverrideRect();
     3696        frameView.setLayoutViewportOverrideRect(LayoutRect(snapshotRect));
     3697
    36933698        auto pdfData = pdfSnapshotAtSize(snapshotRect, snapshotSize, 0);
     3699
     3700        frameView.setLayoutViewportOverrideRect(originalLayoutViewportOverrideRect);
    36943701        send(Messages::WebPageProxy::DrawToPDFCallback(IPC::DataReference(CFDataGetBytePtr(pdfData.get()), CFDataGetLength(pdfData.get())), callbackID));
    36953702        return;
Note: See TracChangeset for help on using the changeset viewer.