Re: [csswg-drafts] [css-page] control space before element depending on page position

@frivoal The problem at the moment is that I get this rendering result
 if the heading is a container element (and I use AHFormatter)

![heading-float](https://cloud.githubusercontent.com/assets/11650404/16486344/6836a760-3ec4-11e6-8fe5-08d26b240151.png)

```
<root>
   <content>
        <heading>
                <hcounter>heading 1</hcounter> 
                <hcontent>at start of page</hcontent>
        </heading>
        <body>body 1</body>
        ...
        <heading>
                <hcounter>heading 2</hcounter> 
                <hcontent>after page break (depends on 
rendering)</hcontent>
        </heading>
        <body>body 2</body>
        ...
       <heading>
                <hcounter>heading 3</hcounter> 
                <hcontent>Text</hcontent>
        </heading>
        <body>body 3</body>
        ...
        <heading style="page-break-before: always">
                <hcounter>heading 4</hcounter> 
                <hcontent>after page break (depends on CSS)</hcontent>
        </heading>
        <body>body 4</body>
        ...
   </content>
</root>
```
```
@page {
        background-color:lightblue;
        margin: 1in;
        }
content {
        display: block;
        background-color:lightgreen;
        }
heading {
        display: block;
        page-break-inside:avoid;
        page-break-after:avoid;
    }
heading > hcounter,
heading > hcontent {
        margin-top:1in;
        margin-bottom:1em;
        -ah-margin-break:discard;
        display:block;
        float:left;
        font-weight:bold;
        }
heading > hcounter {
        width:25%;
        }
heading > hcontent {
        width:75%;
        }
body {
        clear: both;
        display: block;
        }
```

How you see, the -ah-margin-break-property works correct for the first
 heading element at page. But the margin before the following heading 
(heading 3, red marked) is also discard. And this shouldn't be.


That there is maybe a problem with the float I deduced from the case 
that the setting work well if my heading is a "normal" (simple) 
element 

![heading-nonfloat](https://cloud.githubusercontent.com/assets/11650404/16486424/f0147df6-3ec4-11e6-8113-ac282028b470.png)

```
<root>
   <content>
        <heading>heading 1 at start of page</heading>
        <body>body 1</body>
        ...     
        <heading>heading 2 after page break (depends on 
rendering)</heading>
        <body>body 2</body>
        ...
        <heading>heading 3</heading>
        <body>body 3</body>
        <heading style="page-break-before: always">heading 4 after 
page break (depends on CSS)</heading>
        <body>body 4</body>
   </content>
</root>
```  
```
@page {
        background-color:lightblue;
        margin: 1in;
        }
content {
        display: block; 
        background-color:lightgreen;
        }
heading {
        display: block;
        margin-top:1in;
        margin-bottom:1em;
        -ah-margin-break:discard;
        font-weight:bold;
        }
body {
        display: block;
        }
```


I think to add a CSS property like -ah-margin-break to CSS spec is a 
solution. If this property is supported by formatters and is rendered 
correct there are no further need instead ...

-- 
GitHub Notification of comment by christin-goetz
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/253#issuecomment-229635379 
using your GitHub account

Received on Thursday, 30 June 2016 11:44:54 UTC