Firefox XSL Zoom

Bug #515725 reported by daamon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Firefox
Confirmed
Unknown
firefox (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: firefox

Produced on Ubuntu 9.10 using Firefox 3.5.7 (3.5.7+nobinonly-0ubuntu0.9.10.1).
Also produced on Ubuntu 9.10 using Firefox 3.7a1

Steps:
0. Reset Firefox zoom. (View -> Zoom -> Reset)
1. Go to page that uses XSL. Example, http://devedge-temp.mozilla.org/community/rss/index_en.xml
(page should render correctly)
2. Zoom in. (View > Zoom > Zoom In)
3. Reload the page (View > Reload)

The page is not viewed as before (correctly) and scroll bars are missing. This affects both, horizontal and vertical, scroll bars. Zooming out also causes display issues, such as elements of the page repeating.

Temporary Workaround:
1. Reset Firefox Zoom
2. Refresh page
3. Page should be displayed correctly again

Tags: upstream
Revision history for this message
daamon (armomurha) wrote :

Binary package hint: firefox

Produced on Ubuntu 9.10 using Firefox 3.5.7 (3.5.7+nobinonly-0ubuntu0.9.10.1).

Steps:
0. Reset Firefox zoom. (View -> Zoom -> Reset)
1. Go to page that uses XSL. Example, http://devedge-temp.mozilla.org/community/rss/index_en.xml
(page should render correctly)
2. Zoom in. (View > Zoom > Zoom In)
3. Reload the page (View > Reload)

The page is not viewed as before (correctly) and scroll bars are missing. This affects both, horizontal and vertical, scroll bars.

Revision history for this message
In , Draycen DeCator (ddecator) wrote :

This has also been confirmed on Ubuntu 9.10 using Firefox 3.5.7 and Firefox 3.7a1. The bug report can be found here: https://bugs.launchpad.net/firefox/+bug/515725 and is now linked to this bug.

Revision history for this message
Draycen DeCator (ddecator) wrote :

I have also been able to confirm this bug on my machine (Ubuntu 9.10) with Firefox 3.7a1. There also seems to be a bug on Mozilla's Bugzilla page, so I will link the two. I will also update the description with my findings. Thank you for taking the time to file this bug report and helping us to make Ubuntu better.

Changed in firefox (Ubuntu):
status: New → Confirmed
description: updated
Changed in firefox:
status: Unknown → New
description: updated
Revision history for this message
C de-Avillez (hggdh2) wrote :

Marking Triaged/Low, following work from ddecator.

Changed in firefox (Ubuntu):
importance: Undecided → Low
status: Confirmed → Triaged
tags: added: upstream
Revision history for this message
In , Ajschult (ajschult) wrote :

Created attachment 439822
xslt for testcase

With a 20100418 mozilla-central linux build, any xhtml+xslt document only uses part of the window when zoomed out (full page zoom) -- it uses the upper-left hand part corresponding to the scaled-down browser window. The leftover parts of the window on the right and bottom render gray or pull in random video memory.

This regressed in 2008 due to bug 406784.

I also saw this effect with a windows build.

Revision history for this message
In , Ajschult (ajschult) wrote :

Created attachment 439823
testcase

1. Load the testcase
2. Zoom out (ctrl+-)
3. Reload

(right and bottom of the browser window will render poorly)

This doesn't seem to show the bug when trying to pull test.xsl from bugzilla, so you might have to download both and point the xhtml to the local xsl.

Revision history for this message
In , L. David Baron (dbaron) wrote :

Created attachment 439826
testcase

maybe it'll work if I change & to & ?

Revision history for this message
In , L. David Baron (dbaron) wrote :

Created attachment 439831
testcase

... and not cross-site either

Revision history for this message
In , L. David Baron (dbaron) wrote :

I stumbled upon this bug while going through Core bugs (in particular, those with "CSS") that are languishing in Firefox::General.

Marking as duplicate of a later bug that has a testcase...

*** This bug has been marked as a duplicate of bug 560145 ***

Revision history for this message
In , L. David Baron (dbaron) wrote :

This is the sort of bug you get when somebody makes a choice between device pixels and CSS pixels incorrectly.

(I think I commented on a very similar bug somewhere else; this might be a duplicate.)

Revision history for this message
In , L. David Baron (dbaron) wrote :

*** Bug 509398 has been marked as a duplicate of this bug. ***

Revision history for this message
In , L. David Baron (dbaron) wrote :

(In reply to comment #4)
> This is the sort of bug you get when somebody makes a choice between device
> pixels and CSS pixels incorrectly.
>
> (I think I commented on a very similar bug somewhere else; this might be a
> duplicate.)

By that: I mean there's a piece of code somewhere making the wrong choice between calling a function like AppUnitsToCSSPixels and AppUnitsToDevPixels, and the bug will be fixed by finding and fixing that code. (The trick is finding the right one so as not to break anything else. :-)

Changed in firefox:
status: New → Invalid
Revision history for this message
Micah Gersten (micahg) wrote :

New upstream bug.

Changed in firefox:
status: Invalid → Unknown
Changed in firefox:
status: Unknown → Confirmed
Changed in firefox:
importance: Unknown → Medium
Revision history for this message
In , Alexandro Fernandez (alexandro-fernandez) wrote :

I Tried:

2. Zoom out (in a new tab)
1. Load the testcase
(3. Reload not needed)

-> ? Is this maybe a DocumentViewer Initialisation Problem? *
-> ? Where is the transformation result passed to the Viewer? *

* Perhaps the conversion inconsistency can be found via search on http://mxr.mozilla.org/mozilla1.9.2/source/

Revision history for this message
In , Alexandro Fernandez (alexandro-fernandez) wrote :

FF 4b shows up same issue.

Revision history for this message
In , Alexandro Fernandez (alexandro-fernandez) wrote :

Please Help.
Sombody with knowledge. This is a really nasty bug in such good software full of pieces.
I'm no programmer. But if two eyes and a nose.

4. Resize the window and Tum Ta Da avery(important)thing is fine again.

So I guess it must (!) be an Init Problem.

For the ones in deeper Mozilla Code Space
-> ? Could you have a look at:
[nsPresContext.cpp]
line 842| nsPresContext::Init()

http://mxr.mozilla.org/mozilla1.9.2/source/layout/base/nsPresContext.cpp#842

Revision history for this message
In , Alexandro Fernandez (alexandro-fernandez) wrote :

Units I'm loving them :-)
nscoord
AppUnits
DevPixel
CSSPixel
(...)

5. try text zoom only -> no bug

Search for mFullZoom resp. aZoom resulted in not so many matches.

Revision history for this message
In , Alexandro Fernandez (alexandro-fernandez) wrote :

6. try private browsing mode -> no bug (as fullzoom is reseted to 1 on every refresh)

Revision history for this message
In , Alexandro Fernandez (alexandro-fernandez) wrote :

Question is this map right?

  PresShell --holds reference to--> output Doc (presentation in memory)
        |
  is assigned to
        |
       V
 PresContext------------------
        | ________________
        | | mVisibleArea ------is bound to-------> gBrowser (XUL chrome browser)
        | |
        | |
        | |________________
        | ________________

Revision history for this message
In , Alexandro Fernandez (alexandro-fernandez) wrote :

Googling helps, the answer to my question is here:

http://www.mozilla.org/newlayout/doc/

Revision history for this message
Alexandro Fernandez (alexandro-fernandez) wrote :

Suggestion/Workaround (as zooming is not so important on transformed docs):

- Reset zoomlevel to 1 while Parser is transforming Doc.
- After Doc-load complete restore zoomlevel to the original one.

I'm leaving this here, with a final open question to professionals:
How could this be done?

Revision history for this message
In , L. David Baron (dbaron) wrote :

(In reply to comment #10)
> 5. try text zoom only -> no bug
>
> Search for mFullZoom resp. aZoom resulted in not so many matches.

The difference here is that full zoom changes the ratio of CSS pixels to device pixels, while text zoom does not. See comment 6.

Revision history for this message
Alexandro Fernandez (alexandro-fernandez) wrote :

Actually this issue doesn't get out of my mind.

I added the addon "DOM Inspector" to my browser.
This is the structure I get for my local copy of the testcase:

#document
  #transformiix:result
    #text

If I save the testcase file (via file->save page) the resulting file contains this DOM structure.
I cannot see a reason, why the root element of the transformed doc is always <result>.
On initializing PresShell a root frame is created from this element, I think.
Eventually, as Firefox is css driven, this breaks the presentation of the doc. I guess <result> is shrinked down to the minimum size (viewport x zoomfactor) then, because there are no style rules for it.

Revision history for this message
In , Alexandro-fernandez-gmx (alexandro-fernandez-gmx) wrote :

Launchpad

Actually this issue doesn't get out of my mind.

I added the addon "DOM Inspector" to my browser.
This is the structure I get for my local copy of the testcase:

#document
  #transformiix:result
    #text

If I save the testcase file (via file->save page) the resulting file contains this DOM structure.
I cannot see a reason, why the root element of the transformed doc is always <result>.
On initializing PresShell a root frame is created from this element, I think.
Eventually, as Firefox is css driven, this breaks the presentation of the doc. I guess <result> is shrinked down to the minimum size (viewport x zoomfactor) then, because there are no style rules for it.

Revision history for this message
In , Alexandro-fernandez-gmx (alexandro-fernandez-gmx) wrote :

Please delete Comment

Revision history for this message
In , Alexandro-fernandez-gmx (alexandro-fernandez-gmx) wrote :

My Comment 15 was really stupid.(apologize for spaming here)
I didn't grasp, what David Baron said in Comment 6.

For someone like me:
 http://www.quirksmode.org/blog/archives/2010/04/a_pixel_is_not.html
 [About pixels and device pixels (written for webdesigners)]

Revision history for this message
In , Alexandro-fernandez-gmx (alexandro-fernandez-gmx) wrote :

Created attachment 492646
xsl stylesheet for xhtml.testcase

This is the stylesheet for the xhtml.testcase

Revision history for this message
In , Alexandro-fernandez-gmx (alexandro-fernandez-gmx) wrote :

Created attachment 492650
xhtml.testcase

This is a xhtml.testcase showing the bug (plus screenshot of it).

Revision history for this message
In , Alexandro-fernandez-gmx (alexandro-fernandez-gmx) wrote :

Created attachment 492692
xhtml.testcase -> xsl stylesheet

Revision history for this message
In , Alexandro-fernandez-gmx (alexandro-fernandez-gmx) wrote :

Created attachment 492696
xhtml.testcase -> xml document

Revision history for this message
In , Alexandro-fernandez-gmx (alexandro-fernandez-gmx) wrote :

Jonas Sicking said:
"We need a better way of setting up the XSLT result document" [...]
"For example if
we tore down the DocumentViewer and set up a new one we might be able to use
existing functions rather then the current DocumentViewerImpl::SetDOMDocument
hack." (Bug:281022 Date:2005-02-03)

As I understand now, the fast development of Firefox makes it troublesome to update old unknown code to the new firefox design.

So I hope the developers will manage it (I was a little impatient)

Regards

Revision history for this message
In , Alexandro-fernandez-gmx (alexandro-fernandez-gmx) wrote :

@ David Baron:

Could you have a quick look at
line |738ns DocumentViewer.cpp [InitPresentationStuff()] please.
http://mxr.mozilla.org/mozilla1.9.2/source/layout/base/nsDocumentViewer.cpp#738

(If I'm totally in the wrong place, skip this comment)

How are mbounds computed in the init process of the view manager?

Revision history for this message
In , Alexandro-fernandez-gmx (alexandro-fernandez-gmx) wrote :

Additional notes:
If one of the testcases is loaded into an iframe of a zoomed doc -> no bug
So this might be a workaround for now.

Regards

Changed in firefox:
status: Confirmed → Unknown
Changed in firefox:
status: Unknown → Confirmed
Changed in firefox:
importance: Medium → Unknown
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.