Closed Bug 426980 Opened 16 years ago Closed 16 years ago

When zooming html or mathml text embed in svg as foreignObject, scaling factor seems to be larger, then for normal html, mathml of svg text

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: olunet, Assigned: longsonr)

Details

(Keywords: fonts, testcase)

Attachments

(3 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5

Font size of any text in svg embed as foreignObject, when zoomed is scaled by larger factor, then normal text. Try to zoom
<p>Test</p>
<svg>
<switch>
<foreignObject>
<p>Test</p>
</foreignObject>
</switch>
</svg>

Reproducible: Always

Steps to Reproduce:
1.open a document with text in html and text embed in svg
2.zoon io or out
3.see the result
Actual Results:  
font-size in svg is larger

Expected Results:  
font-size should be magnified in the same way for any text
Keywords: css2, fonts, xhtml
Version: unspecified → Trunk
Attached file zooming text in svg
Try to zoom in or out
I can reproduce the bug using a Mac trunk build.
Component: General → SVG
Keywords: css2, xhtmltestcase
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → general
Hardware: PC → All
Status: UNCONFIRMED → NEW
Ever confirmed: true
We're scaling twice. The foreign object scales its content via GetCanvasTM which scales as the outer svg TM changes. But for foreignObject the content scales itself too.

Not sure how to fix it. I tried simply premultiplying by the inverse scaling in nsSVGForeignObject::PaintSVG. This makes the text zoom OK but it eventually exceeds the foreign object bounding box and gets clipped.

Should the mRect for the covered region of a foreignObject change when you zoom?
Attached patch WIP patch (obsolete) — Splinter Review
Printing needs also to be fixed.
Flags: wanted1.9+
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → longsonr
Attachment #313565 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #313947 - Flags: review?(jwatt)
Attachment #313947 - Attachment is obsolete: true
Attachment #313947 - Flags: review?(jwatt)
Comment on attachment 313947 [details] [diff] [review]
patch

My mistake, nothing wrong with this one as far as I can tell.
Attachment #313947 - Attachment is obsolete: false
Attachment #313947 - Flags: review?(jwatt)
Comment on attachment 313947 [details] [diff] [review]
patch

Can you change the comment to something like:

  // GetCanvasTM includes a device pixel to CSS pixel scaling. Since non-SVG
  // content takes care of this itself, we need to remove this pre-scaling from
  // the matrix returned by GetTMIncludingOffset before painting our children.
Attachment #313947 - Flags: review?(jwatt) → review+
Attachment #313947 - Attachment is obsolete: true
Attachment #314059 - Flags: superreview?(roc)
Attachment #314059 - Flags: superreview?(roc) → superreview+
Attachment #314059 - Flags: approval1.9?
Zooming and foreignObjects been new cool fx 3 features really need to work together properly.
Flags: blocking1.9?
Comment on attachment 314059 [details] [diff] [review]
review comment addressed

a1.9=beltzner
Attachment #314059 - Flags: approval1.9? → approval1.9+
Flags: blocking1.9?
checked in.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Attachment #314912 - Flags: approval1.9?
IMozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008040907 Minefield/3.0pre

In 3.0pre x-position remains the same, but should be shifted.
Attachment #314912 - Flags: approval1.9?
(In reply to comment #14)
> IMozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9pre) Gecko/2008040907
> Minefield/3.0pre
> 
> In 3.0pre x-position remains the same, but should be shifted.
> 

Please raise any additional issue(s) in new bugs.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: