svg element in an element doesn't get layed out properly if width and height are not specified

RESOLVED DUPLICATE of bug 736431

Status

()

RESOLVED DUPLICATE of bug 736431
6 years ago
6 years ago

People

(Reporter: burcsahinoglu, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25

Steps to reproduce:

i have an html page which contains an svg tag containing a number of svg element and also contains an foreignobject tag containing an html tags.


Actual results:

when i didn't specify a width & height attribute to the svg tag, the svg tag and its descendants didn't get laid properly (the size of the svg element was wrong) and certain sub elements were not visible (using the developers tools they showed at 0,0 with 0 size it seems.)
once i set *any* width height (for example 1,1) the elements are laid out properly, the svg element size itself properly, and the element contained also.


Expected results:

the svg element should be able to calculate it proper size without any width or height specified.
Can you attach a testcase? It's hard to speculate about what's correct vs. buggy without something concrete to go off of.

See also bug 736431 comment 5, which may be related to the behavior you're seeing here.
(e.g. here's a data URI of a trivial case of <svg> in <html>, with no explicit height/width specified. It shows up just fine in my nightly Firefox build.)
>  data:text/html,<!DOCTYPE html><html><body><svg><rect fill="green" height="100" width="100"></rect></svg>
(Reporter)

Comment 3

6 years ago
Created attachment 646599 [details]
the zip files contains 2 html files and a folder of resources, the files are identical but for the specification of the width and height.

the files use bootstrap & Facebook javascript sdk, i tried to remove most unnecessary items.
See bug 736431 comment 5
Status: UNCONFIRMED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 736431
You need to log in before you can comment on or make changes to this bug.