New issue
Advanced search Search tips

Issue 862918 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Jul 16
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Compat



Sign in to add a comment

offsetHeight and offsetWidth in CSS grid item wrongly calculated on window resize

Reported by julianso...@gmail.com, Jul 12

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Calculate canvas element width and height through its parent `offsetWidth` and `offsetHeight`, to be both the same size.
2. Update canvas width and height with an `onresize` event listener
3. Canvas' parent dimensions should be automatically set by CSS Grids
4. Resize window

What is the expected behavior?
The canvas and its parent dimensions must correspond to the CSS Grids rules. If a grid item width is set to be 50% its container width, it must be de same proportion, even on window resize. Then item's `offsetWidth` (Javascript) should be 50% of its container width, also 'offsetWidth' must be the same ratio on resize (this is calculated with an event listener and update every time). 

What went wrong?
Canvas width and height (and its parent) calculation is unexpected. On every resize event offsetWidth and offsetHeight increases indefinitely each time, never decreases as it should.

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 67.0.3396.99  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: 

Open file for an example
 
index.html
1.6 KB View Download
Components: Blink>Layout>Grid
Cc: viswa.karala@chromium.org
Labels: Triaged-ET M-69 Needs-Triage-M67 Target-69 FoundIn-69 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on chrome reported version# 67.0.3396.99 and latest chrome# 69.0.3489.0 using Mac 10.12.6, Ubuntu 14.04 and Windows-10. As this issue is seen from M-60(60.0.3112.0), hence considering this issue as Non-Regression and marking it as Untriaged.

Thanks!
Cc: svil...@igalia.com jfernan...@igalia.com r...@igalia.com
Owner: r...@igalia.com
Status: WontFix (was: Untriaged)
The very same thing happens on Firefox, so the issue is in the test itself not in the browser.

The problem is that the example is setting the size of the canvas (width and height),
which is used to recompute the grid columns when there's a resize.

I'm attaching a similar example, where the canvas gets resized properly.
canvas.html
936 bytes View Download
The reason I set the canvas size through HTML properties is that it is necessary. CSS styles change the pixel ratio. Maybe, the problem is the specs.
You can keep the aspect ratio setting "width: 100%" and not setting height (see attachment).

Still there are some discussions on CSSWG regarding aspect ratio issues:
https://github.com/w3c/csswg-drafts/issues/333
canvas-aspect-ratio.html
921 bytes View Download

Sign in to add a comment