[Webkit-unassigned] [Bug 156097] Changing canvas height immediately after page load does not relayout canvas

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 26 11:38:49 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=156097

--- Comment #11 from David <david+webkit at limnu.com> ---
(In reply to comment #9)
> I think it is a bug, because it works in contexts other than flexbox.

I'm guessing it's confusing because people have tried to make it easy and convenient to set both the resolution and layout size at the same time using the width and height attributes.

But when you let flexbox handle the layout, then setting the width or height attributes should only affect the resolution, because flexbox has constrained the layout size. It makes sense that setting width doesn't do what you expect when flexbox is involved, and does when flexbox isn't.

If you draw on the canvas after setting the width or height attributes, you will see that the backing store resolution is changing.

Try this, for example, and try changing the width & height.

  setTimeout(function() {
    canvas.height = 200;
    canvas.width = 2000;
    var c=document.getElementById("canvas");
    var ctx=c.getContext("2d");
    ctx.rect(20,20,150,100);
    ctx.stroke();
  }, 0);

So, I still don't think this is a bug. Use the CSS style attributes to change the layout of a canvas.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160426/4ac767e5/attachment.html>


More information about the webkit-unassigned mailing list