[webkit-dev] Canvas Layout Behaviour after Device Orientation Change

Simon Fraser simon.fraser at apple.com
Thu Oct 18 13:23:46 PDT 2012


The behavior should be exactly the same as it would be for <img style="width:100%; height: 100%">. The fact that it's a canvas should not affect layout behavior.

Simon

On Oct 18, 2012, at 12:21 PM, Pierre-Antoine LaFayette <pierre.lafayette at gmail.com> wrote:

> I'm looking at a layout issue on mobile and would like someone to help clarify what behaviour would be expected. Below I will describe this issue:
> 
> The web page is composed of a 1024x1024 canvas with style="width:100%; height: 100%", does not specify viewport meta tag, rather just uses the platform default (980 in my case).
> 
> Device loads the page in landscape mode, the canvas takes up the entire viewport, and is zoomed out completely (can see the full canvas).
> 
> <<Rotate the device to portrait mode>>
> 
> What would be the expected layout? Should the canvas be zoomed out to fit the width of the device in portrait mode? Should the canvas width be preserved and the canvas be clipped at the device width boundary allowing to scroll to see the rest of the canvas?
> 
> <<Rotate the device to landscape mode>>
> 
> I imagine the layout should now be the same as when loaded initially.
> 
> 
> Any thoughts or opinions on what the correct layout behaviour should be here would be much appreciated. I'm not sure if there is a formal specification for this or if it left as an exercise for the vendor.
> 
> Thanks,
> Pierre
> 
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-dev



More information about the webkit-dev mailing list