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

Layout problem with Chrome 102 #896

Closed
MurakamiShinyu opened this issue Apr 6, 2022 · 6 comments · Fixed by #939
Closed

Layout problem with Chrome 102 #896

MurakamiShinyu opened this issue Apr 6, 2022 · 6 comments · Fixed by #939
Assignees
Labels

Comments

@MurakamiShinyu
Copy link
Member

MurakamiShinyu commented Apr 6, 2022

I tested Vivliostyle Viewer with Chrome 102 (currently, Google Chrome CanaryBeta) and found layout problems which are not found with Chrome 101 (currently, Google Chrome Beta) and older versions.

Test cases

Test 1:

https://vivliostyle.org/viewer/#src=https://vivliostyle.github.io/vivliostyle_doc/samples/gutenberg/Alice.html&bookMode=true&userStyle=data:,/*%3Cviewer%3E*/%0A@page%20%7B%20size:%20a5;%20%7D%0A/*%3C/viewer%3E*/

(This test is from issue #793)

See page 33.

Result screenshot (Chrome 102):
Screen Shot 2022-04-06 at 10 55 22

The overflowed text "me," is shown at end of page. Note that there is no forced break after the text "me," in the source HTML https://github.com/vivliostyle/vivliostyle_doc/blob/gh-pages/samples/gutenberg/Alice.html#L908.

Test 2

https://vivliostyle.org/viewer/#src=https://jagat-xpub.github.io/cosmology/&userStyle=data:,/*%3Cviewer%3E*/%0A@page%20%7B%20size:%20a5;%20%7D%0A/*%3C/viewer%3E*/

(This test is from issue #758)

Result screenshot (Chrome 102):
Screen Shot 2022-04-06 at 0 26 05

I found that the result changes when display resolution setting window.devicePixelRatio changes. The above result is with window.devicePixelRatio == 1 and the below is with window.devicePixelRatio == 2:

Screen Shot 2022-04-06 at 0 27 07

Test 3

https://vivliostyle.org/viewer/#src=https://www.aozora.gr.jp/cards/000119/files/624_14544.html&userStyle=data:,/*%3Cviewer%3E*/%0A@page%20%7B%20size:%20a5;%20%7D%0A:root,%20body%20%7B%20margin:%200%20!important;%20%7D%0A/*%3C/viewer%3E*/%0A@page%20%7B%0A%20%20outline:%201px%20solid%20silver;%0A%7D

(This test is from issue #816)

Result screenshot (Chrome 102):
Screen Shot 2022-04-06 at 0 19 00

In this case, the text overflow problem is shown in print but not in viewer.

Test 4

https://vivliostyle.org/viewer/#src=https://gist.githack.com/MurakamiShinyu/dd8d656b7a2d27b432551f0753e87356/raw/test-hyphenation.html

(This test is from issue #793)

Result screenshot (Chrome 102):
Screen Shot 2022-04-06 at 11 37 21

In this case, the hyphenation results differ between viewer and print.

@MurakamiShinyu MurakamiShinyu self-assigned this Apr 6, 2022
@MurakamiShinyu MurakamiShinyu added the P2 Priority 2: Required for post-MVP label Apr 17, 2022
@MurakamiShinyu
Copy link
Member Author

Update (Chrome 103)

I tested the latest Google Chrome Canary 103.0.5014.0 and found that the problems on Test 1 and Test 2 did not occur, but the problems on Test 3 and Test 4 still occurred.

@MurakamiShinyu
Copy link
Member Author

The problems on Test 1 and Test 2 are not found in Chrome 103 but still found in Chrome 102 (currently Chrome Beta, and will be same in the Release version), and the problems on Test 3 and Test 4 will not be resolved until the following Chromium issue is fixed:

The problem is that different layout engines (LayoutNG and the legacy one) are used for screen display and printing, and the results do not match.

There were a workaround:

that uses multi-column layout, in Chromium the same legacy layout engine was used both printing and multi-column in screen, but this workaround is no longer effective because the layout engine for multi-column layout is changed to LayoutNG from Chromium 102.

So we should not use Chromium 102 and later version (especially on Vivliostyle CLI) until this Chromium issue is resolved.

MurakamiShinyu added a commit that referenced this issue Jun 12, 2022
- Fix #896

This is a workaround for the Chromium problem that
printing uses legacy layout and causes inconsistent
result with viewing.
@MurakamiShinyu
Copy link
Member Author

I found a workaround for this problem:

@MurakamiShinyu
Copy link
Member Author

Note: From the Chromium issue, https://bugs.chromium.org/p/chromium/issues/detail?id=1121942#c79:

(Is there any estimated timeline on when the printing side of things here will be released?)

We're hoping around Chrome 108. But no promises. :)
If you want to test it out already, run Chrome with --enable-blink-features=LayoutNGPrinting . Feel free to file bugs.

@bfgeek
Copy link

bfgeek commented Sep 29, 2022

Hi @MurakamiShinyu we are tentatively looking at enabling LayoutNGPrinting for M108 by default (still no promises however) - please let us know if you find any issue.

@MurakamiShinyu
Copy link
Member Author

Hi @bfgeek, I have posted the following Chromium issues on LayoutNGPrinting:

Apart from these, LayoutNGPrinting works fine. Thank you!

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.

2 participants