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

RESOLVED FIXED

Status

()

Core
SVG
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Vladislav, Assigned: Robert Longson)

Tracking

({fonts, testcase})

Trunk
fonts, testcase
Points:
---
Bug Flags:
wanted1.9 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 2 obsolete attachments)

(Reporter)

Description

9 years ago
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
(Reporter)

Updated

9 years ago
Keywords: css2, fonts, xhtml
Version: unspecified → Trunk
(Reporter)

Comment 1

9 years ago
Created attachment 313557 [details]
zooming text in svg

Try to zoom in or out

Comment 2

9 years ago
I can reproduce the bug using a Mac trunk build.
Component: General → SVG
Keywords: css2, xhtml → testcase
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → general
Hardware: PC → All

Updated

9 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 3

9 years ago
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?
(Assignee)

Comment 4

9 years ago
Created attachment 313565 [details] [diff] [review]
WIP patch
(Reporter)

Comment 5

9 years ago
Printing needs also to be fixed.

Updated

9 years ago
Flags: wanted1.9+
(Assignee)

Comment 6

9 years ago
Created attachment 313947 [details] [diff] [review]
patch
Assignee: nobody → longsonr
Attachment #313565 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #313947 - Flags: review?(jwatt)
(Assignee)

Updated

9 years ago
Attachment #313947 - Attachment is obsolete: true
Attachment #313947 - Flags: review?(jwatt)
(Assignee)

Comment 7

9 years ago
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+
(Assignee)

Comment 9

9 years ago
Created attachment 314059 [details] [diff] [review]
review comment addressed
Attachment #313947 - Attachment is obsolete: true
Attachment #314059 - Flags: superreview?(roc)
Attachment #314059 - Flags: superreview?(roc) → superreview+
(Assignee)

Updated

9 years ago
Attachment #314059 - Flags: approval1.9?
(Assignee)

Comment 10

9 years ago
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+

Updated

9 years ago
Flags: blocking1.9?
(Assignee)

Comment 12

9 years ago
checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
(Reporter)

Comment 13

9 years ago
Created attachment 314912 [details]
x-position changes when zooming
Attachment #314912 - Flags: approval1.9?
(Reporter)

Comment 14

9 years ago
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.
(Assignee)

Updated

9 years ago
Attachment #314912 - Flags: approval1.9?
(Assignee)

Comment 15

9 years ago
(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.