Skip to content

Commit

Permalink
Add support for quotes in @page margin boxes content.
Browse files Browse the repository at this point in the history
Since quotes create an extra level of layout objects, it will no longer
be a simple LayoutBlockFlow (page margin box) with leaf nodes, so that
the existing IsDetachedNonDomRoot() would fail when building the layout
object tree. Therefore change this flag (which is only used when DCHECKs
are enabled) to be set for the entire non-DOM tree, rather than just on
its root.

Bug: 40341678
Change-Id: Ie5e9ca34491b42dcff9ad029aa0fe8fedcce45ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5658437
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Daniil Sakhapov <sakhapov@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1320273}
  • Loading branch information
mstensho authored and chromium-wpt-export-bot committed Jun 27, 2024
1 parent 064b607 commit 719cd95
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
21 changes: 21 additions & 0 deletions css/css-page/margin-boxes/content-002-print-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<meta charset="utf-8">
<style>
@page {
margin: 0;
}
body {
margin: 0;
}
.content::before {
content: open-quote "Trøndere gråter når " open-quote "Vinsjan på kaia" close-quote " blir deklamert" close-quote;
}
</style>
<div style="display:grid; height:100vh; grid-template-rows:4em auto 4em; margin:0 4em;">
<div class="content"></div>
<div></div>
<div>
[Trøndere gråter når {Vinsjan på kaia} blir deklamert]
</div>
</div>
24 changes: 24 additions & 0 deletions css/css-page/margin-boxes/content-002-print.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-page-3/#populating-margin-boxes">
<meta name="assert" content="Test quotes in the content property inside page margin boxes.">
<meta charset="utf-8">
<link rel="match" href="content-002-print-ref.html">
<style>
@page {
margin: 4em;

@top-left {
text-align: left;
vertical-align: top;
content: open-quote "Trøndere gråter når " open-quote "Vinsjan på kaia" close-quote " blir deklamert" close-quote;
}

@bottom-left {
quotes: "[" "]" "{" "}";
text-align: left;
vertical-align: top;
content: open-quote "Trøndere gråter når " open-quote "Vinsjan på kaia" close-quote " blir deklamert" close-quote;
}
}
</style>

0 comments on commit 719cd95

Please sign in to comment.