Last Comment Bug 426980 - 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
: When zooming html or mathml text embed in svg as foreignObject, scaling facto...
Status: RESOLVED FIXED
: fonts, testcase
Product: Core
Classification: Components
Component: SVG (show other bugs)
: Trunk
: All All
: -- normal with 1 vote (vote)
: ---
Assigned To: Robert Longson
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-04 01:20 PDT by Vladislav
Modified: 2008-04-10 12:08 PDT (History)
8 users (show)
jwatt: wanted1.9+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
zooming text in svg (1.19 KB, application/xml)
2008-04-04 01:25 PDT, Vladislav
no flags Details
WIP patch (1.44 KB, patch)
2008-04-04 02:59 PDT, Robert Longson
no flags Details | Diff | Splinter Review
patch (2.08 KB, patch)
2008-04-06 10:44 PDT, Robert Longson
jwatt: review+
Details | Diff | Splinter Review
review comment addressed (2.24 KB, patch)
2008-04-07 03:36 PDT, Robert Longson
roc: superreview+
mbeltzner: approval1.9+
Details | Diff | Splinter Review
x-position changes when zooming (10.24 KB, application/xml)
2008-04-10 11:51 PDT, Vladislav
no flags Details

Description Vladislav 2008-04-04 01:20:38 PDT
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
Comment 1 Vladislav 2008-04-04 01:25:17 PDT
Created attachment 313557 [details]
zooming text in svg

Try to zoom in or out
Comment 2 Jesse Ruderman 2008-04-04 01:32:19 PDT
I can reproduce the bug using a Mac trunk build.
Comment 3 Robert Longson 2008-04-04 02:56:31 PDT
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?
Comment 4 Robert Longson 2008-04-04 02:59:01 PDT
Created attachment 313565 [details] [diff] [review]
WIP patch
Comment 5 Vladislav 2008-04-04 06:48:23 PDT
Printing needs also to be fixed.
Comment 6 Robert Longson 2008-04-06 10:44:14 PDT
Created attachment 313947 [details] [diff] [review]
patch
Comment 7 Robert Longson 2008-04-06 10:56:41 PDT
Comment on attachment 313947 [details] [diff] [review]
patch

My mistake, nothing wrong with this one as far as I can tell.
Comment 8 Jonathan Watt [:jwatt] (back in October - email directly if necessary) 2008-04-07 03:29:05 PDT
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.
Comment 9 Robert Longson 2008-04-07 03:36:33 PDT
Created attachment 314059 [details] [diff] [review]
review comment addressed
Comment 10 Robert Longson 2008-04-07 04:29:19 PDT
Zooming and foreignObjects been new cool fx 3 features really need to work together properly.
Comment 11 Mike Beltzner [:beltzner, not reading bugmail] 2008-04-07 14:27:11 PDT
Comment on attachment 314059 [details] [diff] [review]
review comment addressed

a1.9=beltzner
Comment 12 Robert Longson 2008-04-07 16:54:40 PDT
checked in.
Comment 13 Vladislav 2008-04-10 11:51:25 PDT
Created attachment 314912 [details]
x-position changes when zooming
Comment 14 Vladislav 2008-04-10 11:57:21 PDT
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.
Comment 15 Robert Longson 2008-04-10 12:08:44 PDT
(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.


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