-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly update the ICB when shrinking print contents.
Be more consistent about this. Scaling specified by the print preview UI was taken into account, but scaling caused by internal page scaling (to avoid / reduce inline overflow) was not. The initial containing block isn't used for a lot of things when printing, since each page defines a containing block. However, for out-of-flow positioned boxes and things like vw and vh units, it matters. (cherry picked from commit 1ee4c82) Bug: 1485819 Change-Id: I87b37cd5d1154824ca2a0a7c9567298c2c50fd89 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4889925 Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Morten Stenshorne <mstensho@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1201358} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4934590 Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Auto-Submit: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/branch-heads/5993@{#1257} Cr-Branched-From: 5113507-refs/heads/main@{#1192594}
- Loading branch information
Showing
7 changed files
with
85 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
third_party/blink/web_tests/wpt_internal/printing/icb-scaling-001-print-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> | ||
<style> | ||
@page { | ||
size: 300px 200px; | ||
margin: 0; | ||
} | ||
body { margin: 0; } | ||
</style> | ||
<div style="float:right; width:100px; height:100px; background:green;"></div> |
16 changes: 16 additions & 0 deletions
16
third_party/blink/web_tests/wpt_internal/printing/icb-scaling-001-print.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> | ||
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1485969"> | ||
<link rel="match" href="icb-scaling-001-print-ref.html"> | ||
<style> | ||
@page { | ||
size: 300px 200px; | ||
margin: 0; | ||
} | ||
body { margin: 0; } | ||
</style> | ||
<!-- This test assumes that the printing implementation shrinks the content (and | ||
grows the initial containing block) to avoid overflowing content. --> | ||
<div style="width:450px; height:100px;"> | ||
<div style="position:fixed; width:150px; height:150px; right:0; top:0; background:green;"></div> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
third_party/blink/web_tests/wpt_internal/printing/icb-scaling-002-print-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> | ||
<style> | ||
@page { | ||
size: 300px 600px; | ||
margin: 0; | ||
} | ||
body { margin: 0; } | ||
</style> | ||
<div style="margin-left:100px; margin-top:100px; width:150px; height:300px; background:green;"></div> |
16 changes: 16 additions & 0 deletions
16
third_party/blink/web_tests/wpt_internal/printing/icb-scaling-002-print.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> | ||
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1485969"> | ||
<link rel="match" href="icb-scaling-002-print-ref.html"> | ||
<style> | ||
@page { | ||
size: 300px 600px; | ||
margin: 0; | ||
} | ||
body { margin: 0; } | ||
</style> | ||
<!-- This test assumes that the printing implementation shrinks the content (and | ||
grows the initial containing block) to avoid overflowing content. --> | ||
<div style="width:450px; height:100px;"> | ||
<div style="position:absolute; left:150px; top:150px; width:50%; height:50%; background:green;"></div> | ||
</div> |
10 changes: 10 additions & 0 deletions
10
third_party/blink/web_tests/wpt_internal/printing/icb-scaling-003-print-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> | ||
<style> | ||
@page { | ||
size: 300px 600px; | ||
margin: 0; | ||
} | ||
body { margin: 0; } | ||
</style> | ||
<div style="margin-left:100px; margin-top:100px; width:150px; height:300px; background:green;"></div> |
16 changes: 16 additions & 0 deletions
16
third_party/blink/web_tests/wpt_internal/printing/icb-scaling-003-print.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> | ||
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1485969"> | ||
<link rel="match" href="icb-scaling-003-print-ref.html"> | ||
<style> | ||
@page { | ||
size: 300px 600px; | ||
margin: 0; | ||
} | ||
body { margin: 0; } | ||
</style> | ||
<!-- This test assumes that the printing implementation shrinks the content (and | ||
grows the initial containing block) to avoid overflowing content. --> | ||
<div style="width:450px; height:100px;"> | ||
<div style="position:absolute; left:150px; top:150px; width:50vw; height:50vh; background:green;"></div> | ||
</div> |