Closed Bug 354587 Opened 18 years ago Closed 17 years ago

SVG drawn by javascript incompletely rendered

Categories

(Core :: SVG, defect)

1.8 Branch
x86
Linux
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: steve.horsley, Assigned: tor)

References

()

Details

(Keywords: regression, verified1.8.1.4)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1) Gecko/20060918 Firefox/2.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1) Gecko/20060918 Firefox/2.0

See the URL above. 31 piecharts are drawn by javascript after it requests data from the server. These piecharts are incompletely rendered on the page - less than a quarter of the circles is rendered. Covering and uncovering the window then renders the correct complete image. Even pulling down a menu causes the area underneath to be repainted correctly. Note that when the data is refreshed (this happens every 10 seconds) some more of the pies is rendered, but not all of them.


Reproducible: Always

Steps to Reproduce:
1. Visit the above URL.


Actual Results:  
The SVG piecharts are only partially rendered.

Expected Results:  
The SVG piecharts should be completely rendered.

This page renders fine in Firefox 1.5.

I'm submitting this as a major bug because it may be enough to prevent us upgrading. If we cannot trust it to correctly render dynamically updated status warnings, (pies turning red in our case) we cannot use it. Of course, you may have a different opinion.

I tried to produce a single file that shows the problem, but it seem to only appear when the data is fetched separately from the SVG file. This makes me think it may be some kind of timing issue.
(In reply to comment #0)
> User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1)
> Gecko/20060918 Firefox/2.0
> Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1)
> Gecko/20060918 Firefox/2.0
> 
> See the URL above. 31 piecharts are drawn by javascript after it requests data
> from the server. These piecharts are incompletely rendered on the page - less
> than a quarter of the circles is rendered. Covering and uncovering the window
> then renders the correct complete image. Even pulling down a menu causes the
> area underneath to be repainted correctly. Note that when the data is refreshed
> (this happens every 10 seconds) some more of the pies is rendered, but not all
> of them.
> 
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Visit the above URL.
> 
> 
> Actual Results:  
> The SVG piecharts are only partially rendered.
> 
> Expected Results:  
> The SVG piecharts should be completely rendered.
> 
> This page renders fine in Firefox 1.5.
> 
> I'm submitting this as a major bug because it may be enough to prevent us
> upgrading. If we cannot trust it to correctly render dynamically updated status
> warnings, (pies turning red in our case) we cannot use it. Of course, you may
> have a different opinion.
> 
> I tried to produce a single file that shows the problem, but it seem to only
> appear when the data is fetched separately from the SVG file. This makes me
> think it may be some kind of timing issue.
> 

Additional note:
If I follow the URL link in this bug report instead of entering the URL into the address bar, then the pies render correctly, but clicking reload causes the page to render incompletely. This reinforced my opinion that this is a timing issue.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060927 Minefield/3.0a1

The page needs a resize in BonEcho before it is rendered completely.
In trunk builds however this appears to be fixed.
Assignee: nobody → general
Component: General → SVG
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → 1.8 Branch
Attachment #260722 - Flags: review?(jwatt)
Why use cairo_user_to_device in one case but then cairo_identity_matrix in the other?
(In reply to comment #4)
> Why use cairo_user_to_device in one case but then cairo_identity_matrix in the
> other?

Because we can't use the cairo_indentity_matrix method for strokes, as the stroke width would be interpreted with the wrong transform.

Comment on attachment 260722 [details] [diff] [review]
avoid using cairo_stroke_extents on nonstrokable path

Ah, okay. An explanatory comment in the code would be nice.
Attachment #260722 - Flags: review?(jwatt) → review+
Attached patch add commentSplinter Review
Attachment #260748 - Flags: superreview?(roc)
+    cairo_user_to_device(ctx, &xmin, &ymin);
+    cairo_user_to_device(ctx, &xmax, &ymax);

Isn't this wrong? You can't transform a rectangle by transforming two corners and then using those as the corners of the new rectangle.
(In reply to comment #8)
> +    cairo_user_to_device(ctx, &xmin, &ymin);
> +    cairo_user_to_device(ctx, &xmax, &ymax);
> 
> Isn't this wrong? You can't transform a rectangle by transforming two corners
> and then using those as the corners of the new rectangle.

With a current version cairo this would be incorrect.  However the version in the tree for Firefox 1.5/2.0 is sufficiently old that it still has the bug where it just transforms the two corners, so this code works (and similar code is used elsewhere on the branch).

This leaves us with a couple choices: do fix all instances of this on the branch, or further reinforce our message that --enable-system-cairo is completely unsupported on the branch and should not be used?

Comment on attachment 260722 [details] [diff] [review]
avoid using cairo_stroke_extents on nonstrokable path

Oksay, this is OK for branch then.

What about trunk? If it needs a patch, it needs a different patch to this one.
Attachment #260722 - Flags: superreview+
The trunk has had a similar fix in for over half a year (bug 353276).
Attachment #260748 - Flags: superreview?(roc)
Comment on attachment 260722 [details] [diff] [review]
avoid using cairo_stroke_extents on nonstrokable path

Fixes a regression from 1.5 to 2.0.
Attachment #260722 - Flags: approval1.8.1.4?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Assignee: general → tor
Comment on attachment 260722 [details] [diff] [review]
avoid using cairo_stroke_extents on nonstrokable path

approved for 1.8.1.4, a=dveditz for release-drivers
Attachment #260722 - Flags: approval1.8.1.4? → approval1.8.1.4+
Checked in on MOZILLA_1_8_BRANCH.
Status: NEW → RESOLVED
Closed: 17 years ago
Keywords: fixed1.8.1.4
Resolution: --- → FIXED
verified fixed 1.8.1.4 with Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4pre) Gecko/2007042803 BonEcho/2.0.0.4pre and the test url from comment #0. The SVGs are  rendered correctly. Looks good adding verified keyword
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: