SVG image is only partially visible

VERIFIED FIXED in Firefox 11

Status

()

P3
normal
VERIFIED FIXED
7 years ago
7 years ago

People

(Reporter: bugmail, Assigned: kats)

Tracking

unspecified
Firefox 12
All
Android
Points:
---

Firefox Tracking Flags

(firefox11 verified, firefox12 verified, fennec11+)

Details

(Whiteboard: [MTD])

Attachments

(2 attachments)

(Reporter)

Description

7 years ago
Created attachment 582892 [details]
simple testcase

When loading an SVG image, Fennec at first sizes the initial viewport correctly.
But it then zooms in so the image is only partially visible.
You can zoom further in, but you can't zoom out.
Aurora, Beta and the releases seem to work okay.

Updated

7 years ago
Whiteboard: [MTD]
Assignee: nobody → bugmail.mozilla
Priority: -- → P3
This might be related to the way we get the document size. SVG documents might need to use a different method.

In the old days we used this code:
http://hg.mozilla.org/releases/mobile-1.1/file/b28b396278b1/chrome/content/BrowserView.js#l170

if (cdoc instanceof SVGDocument) {
  let rect = cdoc.rootElement.getBoundingClientRect();
  return [Math.ceil(rect.width), Math.ceil(rect.height)];
}

In the current code, we might need to add a check like this here:
http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js#1310
tracking-fennec: --- → 11+
OS: All → Android
Created attachment 590869 [details] [diff] [review]
Patch

Did the thing from comment #1 but slightly modified so that the page is large enough to display the SVG centered.
Attachment #590869 - Flags: review?(mark.finkle)
Comment on attachment 590869 [details] [diff] [review]
Patch

A little strange but OK. Have you tried loading a few different SVG images using this patch? Wikipedia usually has a bunch.
Attachment #590869 - Flags: review?(mark.finkle) → review+
I tried loading a bunch of sample SVGs I found using google. I'll try some Wikipedia ones too before landing.

Try push: https://tbpl.mozilla.org/?tree=Try&rev=088b95dce8e0
Wikipedia SVGs also seem to render fine.

https://hg.mozilla.org/integration/mozilla-inbound/rev/4c0e02c455fd
status-firefox11: --- → affected
status-firefox12: --- → fixed
Target Milestone: --- → Firefox 12
https://hg.mozilla.org/mozilla-central/rev/4c0e02c455fd
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Comment on attachment 590869 [details] [diff] [review]
Patch

[Approval Request Comment]
Regression caused by (bug #): none
User impact if declined: loading SVG documents sometimes shows them cropped and generally acts weird
Testing completed (on m-c, etc.): on m-c
Risk to taking this patch (and alternatives if risky): mobile only
Attachment #590869 - Flags: approval-mozilla-aurora?

Comment 8

7 years ago
Comment on attachment 590869 [details] [diff] [review]
Patch

[Triage Comment]
Mobile only - approved for Aurora.
Attachment #590869 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Verified fixed on Nightly 13.0a1 (2012-02-02)
                  Aurora  12.0a2 (2012-02-02)
Device: Samsung Galaxy S2 (Android 2.3.4)
Status: RESOLVED → VERIFIED
status-firefox11: fixed → verified
status-firefox12: fixed → verified
You need to log in before you can comment on or make changes to this bug.