haikuwebkit/LayoutTests/printing/page-with-zero-margin-expec...

8 lines
316 B
Plaintext
Raw Permalink Normal View History

Add @page margin support https://bugs.webkit.org/show_bug.cgi?id=196680 <rdar://problem/45217707> Reviewed by Tim Horton. Source/WebCore: This patch adds support for @page margin. This feature is currently behind a runtime flag and is off by default. We resolve the @page margin values in the WebProcess (currently no pseudo class is supported) and transfer them to the UIProcess through computedPagesCallback. UIProcess is responsible for applying these new values on the printer. We also re-compute the available width/height for the current printing context in the WebProcess if needed (see PrintInfo for current printer margins). Tests: printing/page-with-10mm-left-margin.html printing/page-with-zero-margin.html * page/PrintContext.cpp: (WebCore::PrintContext::computedPageMargin): (WebCore::PrintContext::computedPageSize): * page/PrintContext.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::pageAtRuleSupportEnabled const): (WebCore::RuntimeEnabledFeatures::setPageAtRuleSupportEnabled): Source/WebKit: * Shared/PrintInfo.cpp: (WebKit::PrintInfo::encode const): (WebKit::PrintInfo::decode): * Shared/PrintInfo.h: * Shared/WebPreferences.yaml: * Shared/gtk/PrintInfoGtk.cpp: (WebKit::PrintInfo::PrintInfo): * Shared/mac/PrintInfoMac.mm: (WebKit::PrintInfo::PrintInfo): * UIProcess/API/C/WKPage.cpp: (WKPageComputePagesForPrinting): * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetPageAtRuleSupportEnabled): (WKPreferencesGetPageAtRuleSupportEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/GenericCallback.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::computedPagesCallback): * UIProcess/WebPageProxy.h: * UIProcess/WebPageProxy.messages.in: * UIProcess/mac/WKPrintingView.mm: (pageDidComputePageRects): (-[WKPrintingView _askPageToComputePageRects]): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::beginPrinting): (WebKit::WebPage::computePagesForPrinting): (WebKit::WebPage::computePagesForPrintingImpl): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): LayoutTests: * printing/page-with-10mm-left-margin-expected.pdf: Added. * printing/page-with-10mm-left-margin.html: Added. * printing/page-with-zero-margin-expected.pdf: Added. * printing/page-with-zero-margin.html: Added. Canonical link: https://commits.webkit.org/211111@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-04-11 23:33:41 +00:00
layer at (0,0) size 1000x18
RenderView at (0,0) size 1000x18
layer at (0,0) size 1000x18
RenderBlock {HTML} at (0,0) size 1000x18
RenderBody {BODY} at (0,0) size 1000x18
RenderText {#text} at (0,0) size 318x18
text run at (0,0) width 318: "Text should start at the top right edge of the page."