FF21: Why no scrollbars on SVG without explicit height?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

FF21: Why no scrollbars on SVG without explicit height?

skissane
Hi

Open this SVG file in Firefox 21.0:

https://sites.google.com/site/skissane/files/cleanblah.svg

The bottom of the image is cut off. And there is no vertical scroll bar.

Since my SVG lacks a height and width declared, my reading of the SVG spec is that both should default to 100% of the container, and thus all of my SVG should be displayed. If I explicitly specify a height, this problem goes away, but per the SVG spec I should not need one. (And, suppose the SVG is being generated programmatically - then calculating the correct height could be a lot of extra code.)

Alternatively, if Firefox is not going to scale it so it all displays, at least provide a vertical scrollbar so I can see it all by scrolling.

Also, the part cut off the bottom is missing even when I zoom out.

Question: Is this a bug in Firefox's SVG handling? Or am I just misunderstanding the SVG spec?

Thanks
Simon Kissane
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FF21: Why no scrollbars on SVG without explicit height?

Robert Longson
On Tuesday, 4 June 2013 04:26:52 UTC+1, [hidden email]  wrote:
>
> Since my SVG lacks a height and width declared, my reading of the SVG spec is that both should default to 100% of the container, and thus all of my SVG should be displayed. If I explicitly specify a height, this problem goes away, but per the SVG spec I should not need one. (And, suppose the SVG is being generated programmatically - then calculating the correct height could be a lot of extra code.)

It's correct that both default to 100% of the container. That just means that 1 pixel of the container = 1 pixel of the drawing per http://www.w3.org/TR/SVG/coords.html#EstablishingANewViewport

Opera implements this logic correctly too in this case.

>
>
>
> Alternatively, if Firefox is not going to scale it so it all displays, at least provide a vertical scrollbar so I can see it all by scrolling.

But the svg element is exactly the size of the viewport, hence no scrollbars.

>
> Question: Is this a bug in Firefox's SVG handling? Or am I just misunderstanding the SVG spec?

I don't think there's a bug here.

Robert
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FF21: Why no scrollbars on SVG without explicit height?

skissane
On Wednesday, June 5, 2013 7:34:28 AM UTC+10, Robert Longson wrote:
>
> It's correct that both default to 100% of the container. That just means that 1 pixel of the container = 1 pixel of the drawing per http://www.w3.org/TR/SVG/coords.html#EstablishingANewViewport
Let me ask a slightly different question then. Is there a way I can create an SVG such that all of the image will be displayed, without clipping any of the image, and without having to explicitly set the viewport width or height? The problem I have, is if the SVG is being automatically generated, there is a lot of extra work to calculate the correct value for the height attribute.

Thanks
Simon
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FF21: Why no scrollbars on SVG without explicit height?

Robert Longson

> Let me ask a slightly different question then. Is there a way I can create an SVG such that all of the image will be displayed, without clipping any of the image, and without having to explicitly set the viewport width or height? The problem I have, is if the SVG is being automatically generated, there is a lot of extra work to calculate the correct value for the height attribute.

Yes, set all the co-ordinates to percentages. This will preclude you from using paths though as they can't have percentage co-ordinates.

Robert.
_______________________________________________
dev-tech-svg mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-svg
Loading...