Skip to content

Commit

Permalink
fix: Chromium's standard CSS zoom support check
Browse files Browse the repository at this point in the history
In previous fix, the checking method for standard CSS zoom support (Chromium 128-) was incomplete and might cause wrong result.
  • Loading branch information
MurakamiShinyu committed Aug 20, 2024
1 parent 5820c81 commit 469c2e8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/core/src/vivliostyle/vgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2995,12 +2995,7 @@ export class Viewport {
if (needScaleRect === null) {
// Check if getBoundingClientRect() result needs to be scaled.
// Note: This is only needed for Chromium older than 128. (Issue #1370)
const savedWidth = contentContainer.style.width;
contentContainer.style.width = "16px";
needScaleRect =
contentContainer.clientWidth ===
contentContainer.getBoundingClientRect().width * this.scaleRatio;
contentContainer.style.width = savedWidth;
needScaleRect = !("currentCSSZoom" in contentContainer);
}
if (needScaleRect) {
Base.setCSSProperty(
Expand Down

0 comments on commit 469c2e8

Please sign in to comment.