Re: [csswg-drafts] [css-gcpm-3] clarify nature of running elements (#4788)

I filed a similar comment on the [PR](https://github.com/web-platform-tests/wpt/pull/21701) but the discussion should be had here really as it's easier to find.

1. I don't think the [list of properties](https://drafts.csswg.org/css-page-3/#properties-list) specified as being applicable to the @top-center (etc.) rules also limit the properties that can be set in running content, because it doesn't include "display". If display isn't allowed, you can't turn a table into running content. But you can, in Prince, WeasyPrint and our own formatter, which are the only three I've tried: an example:
```html
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <style>
  @page {
     margin: 72px;
     @top-center {
         content: element(heading);
     }
  }
  table {
      position: running(heading);
  } 
  td {
      border: 1px solid red;
  } 
  div {
      break-before: page;
  }
  </style>
 </head>
 <body>
  <table>
   <tr><td>a</td><td>b</td></tr>
   <tr><td>c</td><td>d</td></tr>
  </table>
  <div id="div1">Table in heading</div>
  <div id="div2">Table in heading</div>
 </body>
</html>
```

2. You can easily make an argument for allowing `position:running` from within a `display:none`. We can do it with `string-set`, after all. Why can I set the title in this example?
```html
<head>
 <title>A book about water</title>
 <style>
  title {
    string-set: title content()
  }
</style>
</head>
```
but not this?
```html
<head>
 <span id="title">A book about H<sub>2</sub>0</span>
 <style>
  #title {
    position: running(title);
  }
</style>
</head>
```

Content set from within a `display:none` block doesn't exist on any page, so it's never going to match a "first", "first-except" or "last" value in `string()` or `element()`. But that's apparently not a problem for Strings, so shouldn't be a problem for elements either. This area needs clarification anyway; see https://github.com/w3c/csswg-drafts/issues/4634

----

To sum up: I have no objection to opening `position: running()` up to elements defined in `display: none` blocks, floats, absolutes etc, although I think improving the way "first item on the page" is defined as suggested in https://github.com/w3c/csswg-drafts/issues/4634 is important to remove ambiguity. And I don't think the list of properties needs to be limited in the same way it is for page margin boxes.

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

Received on Thursday, 27 February 2020 19:22:14 UTC