RESOLVED FIXED Bug 37086
Explicit size of object tag ignored
https://bugs.webkit.org/show_bug.cgi?id=37086
Summary Explicit size of object tag ignored
Jeff Schiller
Reported 2010-04-05 07:46:31 PDT
embed-rect.html: <!DOCTYPE html> <html><body> <p>Text above the rect</p> <object width="400" height="400" type="image/svg+xml" data="huge-rect.svg"/> <p>Text below the rect</p> </body></html> huge-rect.svg: <?xml version="1.0"?> <svg width="4000" height="4000" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <rect width="100" height="100" fill="blue" stroke-width="5" stroke="green"/> </svg> Firefox and Opera properly display the entire rect inside the 400x400 frame of the <object> element. WebKit does not properly change the size of the rendered rect, only displaying the top-left corner in the 400x400 frame. See http://www.w3.org/TR/SVG11/coords.html#ViewportSpace : "The width attribute on the outermost 'svg' element establishes the viewport's width, unless the following conditions are met: * the SVG content is a separately stored resource that is embedded by reference (such as the 'object' element in [XHTML]), or the SVG content is embedded inline within a containing document; * and the referencing element or containing document is styled using CSS [CSS2] or XSL [XSL]; * and there are CSS-compatible positioning properties [ CSS2-POSN] specified on the referencing element (e.g., the 'object' element) or on the containing document's outermost 'svg' element that are sufficient to establish the width of the viewport. Under these conditions, the positioning properties establish the viewport's width." This means that the width/height of the viewport are established by the object's width/height attributes and override the SVG's width/height.
Attachments
Test HTML file (174 bytes, text/html)
2010-04-05 07:46 PDT, Jeff Schiller
no flags
Test SVG file (197 bytes, image/svg+xml)
2010-04-05 07:47 PDT, Jeff Schiller
no flags
Jeff Schiller
Comment 1 2010-04-05 07:46:57 PDT
Created attachment 52534 [details] Test HTML file
Jeff Schiller
Comment 2 2010-04-05 07:47:15 PDT
Created attachment 52535 [details] Test SVG file
Nikolas Zimmermann
Comment 3 2011-05-27 05:41:28 PDT
The patch on bug 10526 fixes this bug.
Nikolas Zimmermann
Comment 4 2011-05-27 11:31:58 PDT
Fixed in r87526.
Note You need to log in before you can comment on or make changes to this bug.