Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blank page selector misapplied #1131

Closed
MurakamiShinyu opened this issue Feb 21, 2023 · 1 comment · Fixed by #1281
Closed

blank page selector misapplied #1131

MurakamiShinyu opened this issue Feb 21, 2023 · 1 comment · Fixed by #1281
Labels

Comments

@MurakamiShinyu
Copy link
Member

I found a problem that a blank page selector (@page :blank) is applied to a non-blank page.

Test case:

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <style>
    @page {
      @top-center {
        content: "Normal Page";
      }
      @bottom-center {
        content: counter(page);
      }
    }
    @page :blank {
      color: red;
      @top-center {
        content: "Blank Page";
      }
    }
    nav li a::after {
      content: leader(".") " " target-counter(attr(href), page);
    }
    section {
      break-before: page;
    }
    .recto {
      break-before: recto;
    }
  </style>
</head>
<body>
  <nav>
    <h2>Table of Contents</h2>
    <ol>
      <li><a href="#One">One</a></li>
    </ol>
  </nav>
  <section id="One">
    <h2>One</h2>
    <p>This page is a Normal Page.</p>
  </section>
  <section class="recto">
    <h2>Two</h2>
    <p>This page should be a Normal Page (not a Blank Page).</p>
    <p><code>break-before: recto;</code> is specified but no blank page will be generated.</p>
  </section>
  <section>
    <h2>Three</h2>
    <p>This page is a Normal Page.</p>
  </section>
</body>
</html>

GitHub Gist: https://gist.github.com/MurakamiShinyu/8ba399c0dcfc87c093ffc55e8333102a

Test with Vivliostyle Viewer:
https://vivliostyle.vercel.app/#src=https://gist.github.com/MurakamiShinyu/8ba399c0dcfc87c093ffc55e8333102a

Result screenshot:

Screenshot 2023-02-21 at 15 55 05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant