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

Issue 598212 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Canvas rendered at wrong height in Flexbox

Reported by neil.kro...@gmail.com, Mar 27 2016

Issue description

Chrome Version       : 49.0.2623.87
Other browsers tested:
     Canary: 51.0.2692.0 canary (64-bit) - Failed randomly
     Safari: 9.1 - Failed randomly on a more complicated repro. Could not repro on files attached.
    Firefox: 47.0a2 (2016-03-26) - OK
         IE: 11 - OK
       Edge: 25.10586.0.0 - Renders differently than the other browsers


What steps will reproduce the problem?
(1) Download test.html, test.js, and fdd78...png
(2) Load test.html


What is the expected result?
The image should be ~800 px tall and stretched to fill the viewport horizontally


What happens instead?
The image is only ~150 px tall.  If you resize the browser, it fixes itself.


Please provide any additional information below. Attach a screenshot if
possible.
The 'incorrect size.png' image shows the wrong size after load.  'correct size (after resizing borwser).png' shows the correct size that happens if you resize the browser.

This only repros if the script contents are in a separate file.  If you put the script inline in the html, it does not repro.

 
test.html
388 bytes View Download
test.js
350 bytes View Download
fdd78afa22e1c49a380c5f326400e9c4.jpg
49.3 KB View Download
incorrect size.png
247 KB View Download
correct size (after resizing browser).png
768 KB View Download
Cc: brajkumar@chromium.org
Components: Blink>Layout>Flexbox
Labels: Needs-Feedback
Unable to reproduce the issue on Windows 7 using chrome stable M49-49.0.2623.110 by following steps mentioned in the above comment. Observed the image is displayed tall and stretched to fill as shown in the correct size snapshot.

neil.kronlage@ - Could you please upgrade your browser to chrome latest stable 49.0.2623.110 and recheck this issue, If issue still persists let us know on which OS platform you are seeing this issue.


598212.JPG
116 KB View Download
Thanks for trying this.  I updated my chrome to 49.0.2623.110 and was still able to repro this issue (not 100% of the time though - seems like it repros more easily on slower computers).  I can repro it on 2 different Windows computers and a Mac. I disabled all extensions to see if they were affecting it and that did not help.   

I copied the files to a server. Please try reproing it here: http://www.colorizephoto.com/issue598212/test.html

You may need to refresh the page a few times.  Selecting 'Disable cache' in Developer Tools -> Network may help too.

Comment 4 by e...@chromium.org, Mar 29 2016

Components: Blink>Canvas
Status: Available (was: Unconfirmed)
Cc: cbiesin...@chromium.org
Hm... the incorrect size, at least in my testing, uses a height of 150px, which is the default canvas height:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp&q=htmlcanvasel&sq=package:chromium&l=80

Maybe this is another case where we don't clear flexbox's main size cache when the canvas gets laid out again...?
Labels: Hotlist-Fixit
Components: -Blink>Layout>Flexbox
Owner: cbiesin...@chromium.org
This is a bug in LayoutHTMLCanvas; we don't mark the canvas as needing layout in this case even though its size changes. Still investigating further...
Project Member

Comment 8 by bugdroid1@chromium.org, Jun 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c43e0bb044f911727bcb340753de1fe03514a2ff

commit c43e0bb044f911727bcb340753de1fe03514a2ff
Author: cbiesinger <cbiesinger@chromium.org>
Date: Wed Jun 29 22:44:06 2016

Canvas objects did not mark themselves for layout when they're a flex item

See comment in patch -- when we're a flex item, we (likely)
have an override size, so updateLogicalHeight has no effect,
so the check if our size has changed has no effect. Skip
that if we have an override size.

TEST=css3/flexbox/canvas-dynamic-change.html
BUG= 607314 , 598212 
R=eae@chromium.org,dgrogan@chromium.org

Review-Url: https://codereview.chromium.org/2111623002
Cr-Commit-Position: refs/heads/master@{#402973}

[add] https://crrev.com/c43e0bb044f911727bcb340753de1fe03514a2ff/third_party/WebKit/LayoutTests/css3/flexbox/canvas-dynamic-change.html
[modify] https://crrev.com/c43e0bb044f911727bcb340753de1fe03514a2ff/third_party/WebKit/Source/core/layout/LayoutHTMLCanvas.cpp

Status: Fixed (was: Available)
Labels: -Needs-Feedback TE-Verified-53.0.2785.8 TE-Verified-M53
Verified the issue on Win 7,Mac 10.11.5 and Ubuntu 14.04 using 53.0.2785.8 by following the steps mentioned in above comment #3 and its working as expected.

Sign in to add a comment