Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5f8a1e5df487f5a0026fdf142dc905d2b1698e7d
      
https://github.com/WebKit/WebKit/commit/5f8a1e5df487f5a0026fdf142dc905d2b1698e7d
  Author: Matt Woodrow <[email protected]>
  Date:   2025-12-10 (Wed, 10 Dec 2025)

  Changed paths:
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/html/HTMLCanvasElement.cpp
    M Source/WebCore/html/HTMLImageElement.cpp
    M Source/WebCore/page/LocalFrame.cpp
    M Source/WebCore/page/LocalFrameViewLayoutContext.cpp
    M Source/WebCore/rendering/RenderBlock.cpp
    M Source/WebCore/rendering/RenderBlockFlow.cpp
    M Source/WebCore/rendering/RenderView.cpp
    M Source/WebCore/rendering/TextPaintStyle.cpp
    M Source/WebKitLegacy/mac/WebView/WebHTMLView.mm

  Log Message:
  -----------
  Pagination is not applied when printing a WebView.
https://bugs.webkit.org/show_bug.cgi?id=303713
<rdar://165435554>

Reviewed by Simon Fraser.

300374@main made printing state be tracked by the Frame, but WebHTMLView is
bypassing this and setting it on the Document directly.

Remove the Document state and setter to stop this from being possible.

Changes WebHTMLView to call setPrinting, which handles the state change, the
recursion through child frames, and the forceLayoutForPagination call.

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::printing const):
* Source/WebCore/dom/Document.h:
(WebCore::Document::printing const): Deleted.
(WebCore::Document::setPrinting): Deleted.
* Source/WebCore/html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::paint):
* Source/WebCore/html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::evaluateDynamicMediaQueryDependencies):
* Source/WebCore/page/LocalFrame.cpp:
(WebCore::LocalFrame::setPrinting):
* Source/WebCore/page/LocalFrameViewLayoutContext.cpp:
(WebCore::LocalFrameViewLayoutContext::flushUpdateLayerPositions):
(WebCore::LocalFrameViewLayoutContext::updateCompositingLayersAfterStyleChange):
* Source/WebCore/rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::computeColumnCountAndWidth):
* Source/WebCore/rendering/RenderView.cpp:
(WebCore::RenderView::layout):
(WebCore::RenderView::printing const):
* Source/WebCore/rendering/TextPaintStyle.cpp:
(WebCore::computeTextPaintStyle):
* Source/WebKitLegacy/mac/WebView/WebHTMLView.mm:
(-[WebHTMLView layout]):
(-[WebHTMLView 
_setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]):
(-[WebHTMLView 
layoutToMinimumPageWidth:height:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustingViewSize:]):
 Deleted.

Canonical link: https://commits.webkit.org/304253@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to