html - Firefox SVG rect size not drawn for size greater than 300,150 -


the following jsfiddle works correctly in chrome not in firefox(at least in 16 , 21) (look size of rect) http://jsfiddle.net/ej5zk/9/

    <svg> <g>     <rect y="0" x="0" width="400"  height="463"  /> </g> </svg> 

actually works incorrectly in chrome , correctly in firefox.

you want set width , height when embedding svg in html

per svg specification

the ‘width’ attribute on outermost svg element establishes viewport's width, unless following conditions met:

  • the svg content separately stored resource embedded reference (such ‘object’ element in xhtml [xhtml]), or svg content embedded inline within containing document;
  • and referencing element or containing document styled using css [css2] or xsl [xsl];
  • and there css-compatible positioning properties ([css2], section 9.3) specified on referencing element (e.g., ‘object’ element) or on containing document's outermost svg element sufficient establish width of viewport.

under these conditions, positioning properties establish viewport's width.

since above conditions true need use style means explicit width since maps style, or css width property. seems other uas ignore above specification requirements.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -