Bug 196680 - Add @page margin support
Summary: Add @page margin support
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-06 13:43 PDT by zalan
Modified: 2019-04-11 18:56 PDT (History)
8 users (show)

See Also:


Attachments
Patch (19.21 KB, patch)
2019-04-06 13:48 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (21.54 KB, patch)
2019-04-06 16:40 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (66.21 KB, patch)
2019-04-11 13:44 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (59.93 KB, patch)
2019-04-11 14:51 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (59.99 KB, patch)
2019-04-11 14:57 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2019-04-06 13:43:10 PDT
@page {
    margin: 5.0mm;
}
Comment 1 zalan 2019-04-06 13:48:53 PDT
Created attachment 366889 [details]
Patch
Comment 2 zalan 2019-04-06 16:40:56 PDT
Created attachment 366893 [details]
Patch
Comment 3 zalan 2019-04-11 13:20:37 PDT
<rdar://problem/45217707>
Comment 4 zalan 2019-04-11 13:44:40 PDT
Created attachment 367238 [details]
Patch
Comment 5 Tim Horton 2019-04-11 13:55:08 PDT
Comment on attachment 367238 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=367238&action=review

> Source/WebKit/Shared/PrintInfo.h:60
> +    // These values are in 'point' unit (and not css pixel).

CSS

> Source/WebKit/Shared/WebPreferences.yaml:1639
> +  webcoreBinding: RuntimeEnabledFeatures

Why is this not just a Setting!

> Source/WebKit/UIProcess/API/C/WKPreferences.cpp:2131
> +
> +void WKPreferencesSetPageAtRuleSupportEnabled(WKPreferencesRef preferencesRef, bool flag)
> +{
> +    toImpl(preferencesRef)->setPageAtRuleSupportEnabled(flag);
> +}
> +
> +bool WKPreferencesGetPageAtRuleSupportEnabled(WKPreferencesRef preferencesRef)
> +{
> +    return toImpl(preferencesRef)->pageAtRuleSupportEnabled();
> +}

No need for new C API

> Source/WebKit/UIProcess/mac/WKPrintingView.mm:329
> +        [printInfo setBottomMargin: computedPageMargin.bottom()];

No spaces after colons!

> Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h:271
> +#define WebKitPageAtRuleSupportEnabledPreferenceKey @"WebKitPageAtRuleSupportEnabled"

No need for WebKitLegacy API
Comment 6 zalan 2019-04-11 14:51:42 PDT
Created attachment 367242 [details]
Patch
Comment 7 zalan 2019-04-11 14:57:07 PDT
Created attachment 367245 [details]
Patch
Comment 8 WebKit Commit Bot 2019-04-11 16:33:48 PDT
Comment on attachment 367245 [details]
Patch

Clearing flags on attachment: 367245

Committed r244202: <https://trac.webkit.org/changeset/244202>
Comment 9 WebKit Commit Bot 2019-04-11 16:33:49 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Ryan Haddad 2019-04-11 17:14:46 PDT
This change broke Windows builds:

c:\cygwin\home\buildbot\worker\win10-release\build\source\webcore\platform\rectedges.h(39): error C2665: 'std::forward': none of the 2 overloads could convert all the argument types

https://build.webkit.org/builders/Apple%20Win%2010%20Release%20%28Build%29/builds/3604
Comment 11 zalan 2019-04-11 18:43:30 PDT
(In reply to Ryan Haddad from comment #10)
> This change broke Windows builds:
> 
> c:\cygwin\home\buildbot\worker\win10-
> release\build\source\webcore\platform\rectedges.h(39): error C2665:
> 'std::forward': none of the 2 overloads could convert all the argument types
> 
> https://build.webkit.org/builders/Apple%20Win%2010%20Release%20%28Build%29/
> builds/3604
Fixing it.
Comment 12 zalan 2019-04-11 18:56:17 PDT
Let's see if https://trac.webkit.org/changeset/244208 fixes it.