New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 859085 link

Starred by 2 users

Issue metadata

Status: Unconfirmed
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 705916



Sign in to add a comment

CSS page break styles not fully applied before printing unless print media is manually emulated first

Reported by pier...@nextcapital.com, Jun 29 2018

Issue description

Chrome Version       : 67.0.3396.99 (Official Build) (64-bit)
URLs (if applicable) : n/a
Other browsers tested: n/a
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari:
    Firefox:
       Edge:

What steps will reproduce the problem?
(1) Build a page with page-break-inside styles spplied
(2) Print preview > print to pdf. Manually adjust margins until a text element with "page-break-inside: avoid" CSS is incorrectly split between two pages (eg: top have of letter on one page, bottom half on another.)
(3) Close print previous. Open chrome dev tools.
(4) Rendering > Emulate CSS media > Select 'print'
(5) Open print preview again. Apply the same margins as before.
(6) Observe the page-break-inside CSS is now being applied properly.

What is the expected result?

page-break-inside CSS is applied properly, preventing text from being split between two pages.

What happens instead?

page-break-inside CSS is not fully applied properly, preventing text from being split between two pages.

Please provide any additional information below. Attach a screenshot if
possible.

- I don't know why manually applying `print` media before printing resolves the issue, but it is a working workaround.
- This also affects PDF generation via Chrome Headless. The same workaround of manually emulating print media before printing works.


 
without-manually-applying-print-media-first.pdf
40.5 KB Download
with-applying-print-media-first.pdf
80.9 KB Download
Labels: Needs-Triage-M67
Labels: Needs-Feedback Triaged-ET
@reporter : Could you please provide a sample file, so that it would be really helpful for further triaging.

Thanks.!
No problem. I've attached an example webpage, along with some more screenshots showing the issue for this webpage.

To see the issue, adjust margins to the following in print preview:

- Top: 0.7"
- Left: 0.5"
- Right: 0.5"
- Bottom: 0.6"

I'll check in once Chrome 68 updates later today and see if the issue is still there as well.

I should also note that this is occurring on Mac OS X, but I have also seen it on Linux.

example webpage.zip
1.4 MB Download
before_emulating_media.png
92.8 KB View Download
after_emulating_media.png
80.3 KB View Download
Project Member

Comment 4 by sheriffbot@chromium.org, Jul 24

Cc: swarnasree.mukkala@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Just updated to Chrome 68, and I am still seeing the issue.
Just updated to Chrome 69, and I am still seeing the issue.
Cc: krajshree@chromium.org
Labels: Needs-Feedback
Unable to reproduce the issue on mac 10.13.3 using chrome latest stable #69.0.3497.100 and latest canary #71.0.3575.0 as per comment #3. Observed that page-break-inside CSS is applied properly, preventing text from being split between two pages as expected.
Attached a screen cast for reference.

piercej@ - Could you please check this issue on latest canary #71.0.3575.0 by creating a new profile without any apps and extensions and please let us know if the issue still persists or not.

Thanks...!!
859085.mp4
1.2 MB View Download
I was able to reproduce on a clean installation of Chrome 71. I've attached a video of the issue occurring on Chrome 71.

In case this is a weird GPU driver issue, here are the results of `chrome://gpu`:

Graphics Feature Status
Canvas: Hardware accelerated
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Native GpuMemoryBuffers: Hardware accelerated
Out-of-process Rasterization: Disabled
Hardware Protected Video Decode: Unavailable
Rasterization: Hardware accelerated
Skia Deferred Display List: Disabled
Skia Renderer: Disabled
Surface Control: Disabled
Surface Synchronization: Enabled
Video Decode: Hardware accelerated
Viz Service Display Compositor: Disabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
Driver Bug Workarounds
adjust_src_dst_region_for_blitframebuffer
avoid_stencil_buffers
decode_encode_srgb_for_generatemipmap
disable_2d_canvas_auto_flush
disable_framebuffer_cmaa
dont_use_loops_to_initialize_variables
get_frag_data_info_bug
pack_parameters_workaround_with_pack_buffer
regenerate_struct_names
remove_invariant_and_centroid_for_essl3
scalarize_vec_and_mat_constructor_args
set_zero_level_before_generating_mipmap
unfold_short_circuit_as_ternary_operation
unpack_alignment_workaround_with_unpack_buffer
use_intermediary_for_copy_texture_image
use_unused_standard_shared_blocks
disabled_extension_GL_KHR_blend_equation_advanced
disabled_extension_GL_KHR_blend_equation_advanced_coherent
Problems Detected
Protected video decoding with swap chain is for Windows and Intel only
Disabled Features: protected_video_decode
Unfold short circuit on Mac OS X: 307751
Applied Workarounds: unfold_short_circuit_as_ternary_operation
Always rewrite vec/mat constructors to be consistent: 398694
Applied Workarounds: scalarize_vec_and_mat_constructor_args
Mac drivers handle struct scopes incorrectly: 403957
Applied Workarounds: regenerate_struct_names
glGenerateMipmap fails if the zero texture level is not set on some Mac drivers: 560499
Applied Workarounds: set_zero_level_before_generating_mipmap
Pack parameters work incorrectly with pack buffer bound: 563714
Applied Workarounds: pack_parameters_workaround_with_pack_buffer
Alignment works incorrectly with unpack buffer bound: 563714
Applied Workarounds: unpack_alignment_workaround_with_unpack_buffer
copyTexImage2D fails when reading from IOSurface on multiple GPU types.: 581777
Applied Workarounds: use_intermediary_for_copy_texture_image
Use GL_INTEL_framebuffer_CMAA on ChromeOS: 535198
Applied Workarounds: disable_framebuffer_cmaa
glGetFragData{Location|Index} works incorrectly on Max: 638340
Applied Workarounds: get_frag_data_info_bug
Decode and encode before generateMipmap for srgb format textures on macosx: 634519
Applied Workarounds: decode_encode_srgb_for_generatemipmap
Insert statements to reference all members in unused std140/shared blocks on Mac: 618464
Applied Workarounds: use_unused_standard_shared_blocks
adjust src/dst region if blitting pixels outside read framebuffer on Mac: 644740
Applied Workarounds: adjust_src_dst_region_for_blitframebuffer
Mac driver GL 4.1 requires invariant and centroid to match between shaders: 639760, 641129
Applied Workarounds: remove_invariant_and_centroid_for_essl3
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Applied Workarounds: disable(GL_KHR_blend_equation_advanced), disable(GL_KHR_blend_equation_advanced_coherent)
Certain Apple devices leak stencil buffers: 713854
Applied Workarounds: avoid_stencil_buffers
Shader variable initialization in a loop caused perf regression on Mac Intel.: 809422
Applied Workarounds: dont_use_loops_to_initialize_variables
glFlush error on Mac: 841755
Applied Workarounds: disable_2d_canvas_auto_flush
Viz service display compositor is not enabled by default.
Disabled Features: viz_display_compositor
Skia renderer is not used by default.
Disabled Features: skia_renderer
Skia deferred display list is not used by default.
Disabled Features: skia_deferred_display_list
Version Information
Data exported	2018-10-12T19:30:36.452Z
Chrome version	Chrome/71.0.3578.0
Operating system	Mac OS X 10.13.6
Software rendering list URL	https://chromium.googlesource.com/chromium/src/+/7e93e3362fc959ad993d7ea26da37c9ae09cc794/gpu/config/software_rendering_list.json
Driver bug list URL	https://chromium.googlesource.com/chromium/src/+/7e93e3362fc959ad993d7ea26da37c9ae09cc794/gpu/config/gpu_driver_bug_list.json
ANGLE commit id	f2ed299569c0
2D graphics backend	Skia/71 9c37cd96e4c8158643dbde6fd3eda1b42e267bec-
Command Line	/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary -psn_0_307275 --flag-switches-begin --flag-switches-end
Driver Information
Initialization time	57
In-process GPU	false
Passthrough Command Decoder	false
Sandboxed	true
GPU0	VENDOR = 0x1002, DEVICE= 0x6821 *ACTIVE*
GPU1	VENDOR = 0x8086, DEVICE= 0x0d26
Optimus	false
AMD switchable	true
Driver vendor	ATI
Driver version	1.68.20
Driver date	
GPU CUDA compute capability major version	0
Pixel shader version	4.10
Vertex shader version	4.10
Max. MSAA samples	8
Machine model name	MacBookPro
Machine model version	11.5
GL_VENDOR	ATI Technologies Inc.
GL_RENDERER	AMD Radeon R9 M370X OpenGL Engine
GL_VERSION	4.1 ATI-1.68.20
GL_EXTENSIONS	GL_ARB_blend_func_extended GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5 GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_occlusion_query2 GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_subroutine GL_ARB_shading_language_include GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_vertex_attrib_64bit GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_depth_bounds_test GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_EXT_texture_mirror_clamp GL_EXT_texture_sRGB_decode GL_APPLE_client_storage GL_APPLE_container_object_shareable GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_texture_range GL_ATI_texture_mirror_once GL_NV_texture_barrier
Disabled Extensions	GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent
Disabled WebGL Extensions	
Window system binding vendor	
Window system binding version	
Window system binding extensions	
Direct rendering	Yes
Reset notification strategy	0x0000
GPU process crash count	0
Compositor Information
Tile Update Mode	Zero-copy
Partial Raster	Enabled
GpuMemoryBuffers Status
R_8	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
R_16	Software only
RG_88	Software only
BGR_565	Software only
RGBA_4444	Software only
RGBX_8888	Software only
RGBA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
BGRX_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE
BGRX_1010102	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
RGBX_1010102	Software only
BGRA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
RGBA_F16	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
YVU_420	Software only
YUV_420_BIPLANAR	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
UYVY_422	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
Display(s) Information
Info	Display[69733250] bounds=[0,0 1440x900], workarea=[0,23 1440x823], scale=2, external.
Color space information	{primaries_d50_referred: [[0.6587, 0.3332], [0.3206, 0.6135], [0.1508, 0.0527]], transfer:0.0777*x + 0.0000 if x < 0.0450 else (0.9478*x + 0.0521)**2.4000 + -0.0000, matrix:RGB, range:FULL}
Bits per color component	8
Bits per pixel	24
Info	Display[441024123] bounds=[1440,0 1920x1080], workarea=[1440,23 1920x1057], scale=1, external.
Color space information	{primaries_d50_referred: [[0.6478, 0.3316], [0.3210, 0.5983], [0.1560, 0.0649]], transfer:0.0000*x + 0.0000 if x < 0.0000 else (1.0000*x + 0.0000)**1.9610 + 0.0000, matrix:RGB, range:FULL}
Bits per color component	8
Bits per pixel	24
Video Acceleration Information
Decode h264 baseline	up to 4096x2160 pixels
Decode h264 extended	up to 4096x2160 pixels
Decode h264 main	up to 4096x2160 pixels
Decode h264 high	up to 4096x2160 pixels
Encode h264 baseline	up to 4096x2160 pixels and/or 30.000 fps
Encode h264 main	up to 4096x2160 pixels and/or 30.000 fps
Encode h264 high	up to 4096x2160 pixels and/or 30.000 fps



chrome_71_reproduction.mov
12.1 MB View Download
Project Member

Comment 9 by sheriffbot@chromium.org, Oct 12

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: TE-NeedsTriageHelp
Unable to reproduce the issue on mac 10.13.6 using chrome latest stable #70.0.3538.102 and latest canary #72.0.3610.0 as per comment #3.
Attached screen shot for reference.
Observed that page-break-inside CSS is applied properly, preventing text from being split between two pages as expected.

Also attaching chrome_gpu details for reference. As the issue seems to be related to 	
Internals>Headless and issue doesn't reproduce from TE-end hence, adding label TE-NeedsTriageHelp for further investigation from dev team.

Thanks...!!
859085.png
542 KB View Download
As a point of clarification, we first noticed the issue when using Chrome Headless to generate PDFs. However, the issue appears to affect the overall print functionality (even on non-headless scenarios).

In terms of reproduction, we first noticed the issue when PDF generated using Chrome Headless on servers running Ubuntu were having the issue. We were able to reproduce the issue on MacOS. We have a working workaround in production: manually emulate print media before generating the PDF. We have not had an issue since this workaround was put in place.

We have never attempted to reproduce the issue on Windows.

Sign in to add a comment