Closed Bug 367204 Opened 13 years ago Closed 12 years ago
Embedded SVG clips based on viewport size
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:220.127.116.11) Gecko/20061204 Firefox/18.104.22.168 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:22.214.171.124) Gecko/20061204 Firefox/126.96.36.199 When embedding SVG images in a page, the resulting image clips strangely. The SVG image clips to a rectangle of the same size as a viewport. This starts from the 0,0 coordinates that the SVG element inherits from its positioning on the page. Changing the size of the viewport also changes the size of the SVG image, which makes things worse. Reproducible: Always Steps to Reproduce: 1.Create a page containing embedded SVG graphics. 2.Resize the browser window until the viewport is smaller than the SVG graphic. Actual Results: The SVG graphic is clipped to the viewport size, irrespective of any page context. Expected Results: The SVG graphic should be clipped to the size of its containing block, not the viewport size, which is irrelevant for embedded graphics. If the <svg> element is given a size (either through width/height attributes, CSS or the enclosing block size), that should be the size that the image is constrained to. I discovered this when drawing SVG overlays on Google Maps. Google Maps often uses negative coordinates for images as it scrolls around, however, overlaid SVG images do not draw in negative coordinates. The positive coordinates that they draw to are limited by the size of the viewport.
Shrink the window to demonstrate the bug.
Attachment created. Observe the difference between Firefox and Opera in rendering this page. I just found Bug 288276, the solution to which might address this problem.
Assignee: nobody → general
Component: General → SVG
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk
Fixed by the fix for bug 294086.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Depends on: 294086
Resolution: --- → FIXED
No longer blocks: 394759
You need to log in before you can comment on or make changes to this bug.