<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>85062</bug_id>
          
          <creation_ts>2012-04-27 07:10:50 -0700</creation_ts>
          <short_desc>Support CSS 3 Paged Media Margin Boxes</short_desc>
          <delta_ts>2025-08-12 05:38:10 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>REOPENED</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=196680</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>15548</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Milian Wolff">milian.wolff</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>amit.man</cc>
    
    <cc>annevk</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>brandroan</cc>
    
    <cc>dahjelle.webkit.org</cc>
    
    <cc>hyatt</cc>
    
    <cc>j.tosovsky</cc>
    
    <cc>karlcow</cc>
    
    <cc>koivisto</cc>
    
    <cc>kripper3</cc>
    
    <cc>manojtm1008</cc>
    
    <cc>marie.hanotte</cc>
    
    <cc>mikelawther</cc>
    
    <cc>monstion</cc>
    
    <cc>nickshanks</cc>
    
    <cc>ntim</cc>
    
    <cc>office</cc>
    
    <cc>sam</cc>
    
    <cc>sebastianzartner</cc>
    
    <cc>shanestephens</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>syoichi</cc>
    
    <cc>tiedye1</cc>
    
    <cc>timing_fluff_0j</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>yummyfish</cc>
    
    <cc>yuri.araujod</cc>
    
    <cc>zalan</cc>
    
    <cc>zzy8200</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>611469</commentid>
    <comment_count>0</comment_count>
    <who name="Milian Wolff">milian.wolff</who>
    <bug_when>2012-04-27 07:10:50 -0700</bug_when>
    <thetext>WebKit is missing support for Paged Media margin boxes: http://www.w3.org/TR/css3-page/#margin-boxes</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>611470</commentid>
    <comment_count>1</comment_count>
    <who name="Milian Wolff">milian.wolff</who>
    <bug_when>2012-04-27 07:11:35 -0700</bug_when>
    <thetext>This blocks bug 15548</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>654222</commentid>
    <comment_count>2</comment_count>
    <who name="Shane Stephens">shanestephens</who>
    <bug_when>2012-06-20 21:31:36 -0700</bug_when>
    <thetext>Paged Media features are currently gated on a refactor being completed by Dave Hyatt (http://lists.webkit.org/pipermail/webkit-dev/2012-May/020668.html).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1082773</commentid>
    <comment_count>3</comment_count>
    <who name="Christopher Pereira">kripper3</who>
    <bug_when>2015-04-04 07:49:16 -0700</bug_when>
    <thetext>What is the status?
This is blocking wkhtmltopdf to support in-doc headers/footers, and other important standard printing options.

See:
- https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2200
- https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2247</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1312355</commentid>
    <comment_count>4</comment_count>
    <who name="Daniel Whitney">tiedye1</who>
    <bug_when>2017-05-24 12:27:08 -0700</bug_when>
    <thetext>+1 Need this, also only thing blocking bug 15548</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1319095</commentid>
    <comment_count>5</comment_count>
    <who name="amit">amit.man</who>
    <bug_when>2017-06-14 05:05:46 -0700</bug_when>
    <thetext>+1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1424478</commentid>
    <comment_count>6</comment_count>
    <who name="Josh D">yummyfish</who>
    <bug_when>2018-05-16 14:08:32 -0700</bug_when>
    <thetext>I know that there is a ton going on for your team. But there&apos;s a real opportunity here for the Open Source community. Right now most reporting solutions are proprietary and don&apos;t follow any standard. But with support of paged media and margin boxes the tools for reporting will flourish. We just need your help to make it a priority. Unfortunately I&apos;m going to convert my project over to a Microsoft reporting solution in order to get it done, but I was really hoping I could use Chrome/Webkit to make this happen and get one more nail into the MS coffin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1437728</commentid>
    <comment_count>7</comment_count>
    <who name="KraakBal">brandroan</who>
    <bug_when>2018-06-29 02:19:54 -0700</bug_when>
    <thetext>Please please please make this work</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1540819</commentid>
    <comment_count>8</comment_count>
    <who name="Yuri">yuri.araujod</who>
    <bug_when>2019-05-31 13:24:31 -0700</bug_when>
    <thetext>Is there any plan for this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1805537</commentid>
    <comment_count>9</comment_count>
    <who name="Manoj">manojtm1008</who>
    <bug_when>2021-10-18 05:17:55 -0700</bug_when>
    <thetext>we would love to have this feature</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1837941</commentid>
    <comment_count>10</comment_count>
    <who name="Fluff">timing_fluff_0j</who>
    <bug_when>2022-02-06 13:17:28 -0800</bug_when>
    <thetext>Please, make it finally happen! It is most needed and long overdue!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883112</commentid>
    <comment_count>11</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-07-13 09:47:04 -0700</bug_when>
    <thetext>&lt;rdar://problem/96957669&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2068486</commentid>
    <comment_count>12</comment_count>
    <who name="">zzy8200</who>
    <bug_when>2024-10-16 11:25:23 -0700</bug_when>
    <thetext>I already see implementation here:
https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/page/PrintContext.cpp

Is there specific reason this feature is still behind a flag?

FloatBoxExtent PrintContext::computedPageMargin(FloatBoxExtent printMargin)
{
    if (!frame() || !frame()-&gt;document())
        return printMargin;

    if (!RuntimeEnabledFeatures::sharedFeatures().pageAtRuleSupportEnabled())
        return printMargin;

    // FIXME: Currently, no pseudo-class is supported.
    auto style = frame()-&gt;document()-&gt;styleScope().resolver().styleForPage(0);

    float pixelToPointScaleFactor = 1 / CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor(CSSUnitType::CSS_PT).value();

    return {
        style-&gt;marginTop().isAuto() ? printMargin.top() : style-&gt;marginTop().value() * pixelToPointScaleFactor,
        style-&gt;marginRight().isAuto() ? printMargin.right() : style-&gt;marginRight().value() * pixelToPointScaleFactor,
        style-&gt;marginBottom().isAuto() ? printMargin.bottom() : style-&gt;marginBottom().value() * pixelToPointScaleFactor,
        style-&gt;marginLeft().isAuto() ? printMargin.left() : style-&gt;marginLeft().value() * pixelToPointScaleFactor
    };
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2135888</commentid>
    <comment_count>13</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2025-08-12 05:20:42 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 265314 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2135892</commentid>
    <comment_count>14</comment_count>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2025-08-12 05:38:10 -0700</bug_when>
    <thetext>Not quite the same as margin descriptors.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>