FlexBox Layout not updated when changing canvas size
Reported by
neil.kro...@gmail.com,
Apr 27 2016
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36 Example URL: https://jsfiddle.net/jmoz3ew1/ Steps to reproduce the problem: 1. Go To https://jsfiddle.net/jmoz3ew1/ What is the expected behavior? The canvas should be very tall. The script sets the height to 1000px. What went wrong? The canvas remains very short (its initial height). Does it occur on multiple sites: N/A Is it a problem with a plugin? N/A Did this work before? N/A Does this work in other browsers? No Safari Chrome version: 50.0.2661.87 Channel: stable OS Version: 10.0 Flash Version: Shockwave Flash 21.0 r0 If you resize the window it updates correctly. This works ok in Edge and FireFox. Safari also has the bug: https://bugs.webkit.org/show_bug.cgi?id=156097 If you load the repro in that bug (https://bugs.webkit.org/attachment.cgi?id=275373), you will see a flash on Chrome where the size is incorrect but it updates soon afterwards. Using the jsfiddle repro does not fix itself right away though.
,
May 2 2016
,
May 2 2016
This is some kind of <canvas> bug, oddly! Not only does this work for <img> but stepping through this code shows this:
blink::HTMLCanvasElement::parseAttribute (this=0x1dbb673637e8, name="height", oldValue="(null)", value="1000")
at ../../third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp:159
159 if (name == widthAttr || name == heightAttr)
(gdb)
160 reset();
(gdb) step
blink::HTMLCanvasElement::reset (this=0x1dbb673637e8)
at ../../third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp:334
334 if (m_ignoreReset)
(gdb) next
337 m_dirtyRect = FloatRect();
(gdb)
340 bool hadImageBuffer = hasImageBuffer();
(gdb)
342 int w = getAttribute(widthAttr).toInt(&ok);
(gdb)
343 if (!ok || w < 0)
(gdb) p w
$1 = 0
(gdb) p ok
$2 = false
(gdb) p getAttribute(widthAttr)
$3 = "(null)"
Maybe in this codepath it should use the value argument to parseAttribute instead of calling getAttribute? But I also don't know why this is not returning the new value. Anyway, over to the canvas people.
,
Jun 1 2016
Moving this nonessential bug to the next milestone. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 29 2016
Hmm, the above still seems suspicious to me but actually this bug will also be fixed by my fix for bug 598212
,
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
,
Jun 30 2016
The user visible part of this is fixed but I'll leave this open in case canvas people want to investigate further about my comment above
,
Jul 5 2016
What was observed is normal the width and height content attributes are allowed to be unspecified (which is indicated by the "!ok" condition), in which case the implementation uses default values for those attributes. In the example of this fiddle, the width is unspecified. We can close this IMO |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by nyerramilli@chromium.org
, Apr 28 2016Components: Blink>Layout>Flexbox
Labels: M-52 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)