Closed Bug 1131264 Opened 8 years ago Closed 8 years ago

SVG circle not display


(Core :: SVG, defect)

17 Branch
Windows 8.1
Not set



Tracking Status
firefox35 --- affected
firefox36 --- affected
firefox37 --- affected
firefox38 --- affected
firefox39 --- affected
firefox40 --- affected
firefox45 --- fixed
firefox-esr31 --- affected


(Reporter: lebec.alexis, Assigned: twointofive)




(Keywords: regression)


(3 files, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36

Steps to reproduce:

When a circle in svh have a a large viewBox, a circle does not display !

I use firefox 35.0.1 with Windows 8.1 64b in french.

For example :

<svg viewBox="100 100 10 10"  height="100" width="100" xmlns="">
	<circle stroke-width="0.05" stroke="#ff0000" fill="none" r="1" cx="104" cy="104"/>
    <rect height="2" width="2" y="107" x="107" />
<svg viewBox="10000 10000 10 10"  height="100" width="100" xmlns="">
	<circle stroke-width="0.05" stroke="#ff0000" fill="none" r="1" cx="10004" cy="10004"/>
    <rect height="2" width="2" y="10007" x="10007" />

Actual results:

On the second SVG (with extanded viewbox) , I only see the rectangle, the circle do not display

Expected results:

This 2 SVG shoud display the same circle and rectangle.
Attached image Display error
I try to restart firefox in safe mode and SVG display correctly .

Even if i disable all module svg fail in normal mode !
If i disable "acceleration matérielle graphique" (in french) SVG display correctly!
Regression window(m-i)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/15.0 Firefox/15.0a1 ID:20120521220651
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/15.0 Firefox/15.0a1 ID:20120521222950

Regressed by: Bug 

Regression window(m-i) with force = true
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120104 Firefox/12.0a1 ID:20120104212324
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0a1) Gecko/20120104 Firefox/12.0a1 ID:20120104231823

Regressed by: Bug 711063
Blocks: 715768, 711063
Ever confirmed: true
Keywords: regression
Version: 35 Branch → 17 Branch
Attached patch 1131264.diff (obsolete) — Splinter Review
This is a variation on bug 1143303 (unfortunately I didn't know about it when I wrote the patch for that bug!).

In both cases the issue is with the workaround for trying to draw a circle using D2D's ArcSegment, and in both cases what goes wrong is that startPoint and endPoint wind up too close together for D2D to handle.  In this bug that happens because the large aOrigin coordinates in the computation of startPoint and endPoint drown out the tiny adjustment introduced into endAngle (or startAngle) to try to work around this issue.

A note on the kEpsilon value this time:
if I draw a circle with radius .0063 (about the largest radius circle that fails using the original workaround) and let diff = abs(startPoint.x - endPoint.x) + abs(startPoint.y - endPoint.y), and then
vary endAngle (or startAngle, I forget which) by adjusting the 1.9999 factor in the original workaround, I get that D2D works with a diff of 2.1773e-6 but fails with a diff of 1.979e-6.  So I chose kEpsilon = 1e-5.

With that kEpsilon, the draw-two-half-arcs path gets taken for circles with a radius < ~0.032.
Assignee: nobody → twointofive
Attachment #8631268 - Flags: review?(bas)
It would be nice if the reftests had a stroked circle with a dasharray that would prove that dashing started from the right point on the circle and went in the right direction. We have some existing tests for larger circles in bug 944704 could you add some small circles to those testcases?
Attachment #8631858 - Flags: review?(longsonr) → review+
Blocks: 1093043
Blocks: 820988
Attachment #8631268 - Flags: review?(bas) → review+
Attached patch Patch Part 1 v2Splinter Review
Bitrot update (diff context changed), carrying bas: review+.
Attachment #8631268 - Attachment is obsolete: true
Bug 1131264 - Extend the workaround for drawing D2D circles. r=bas
Bug 1131264, part 2 - Add small circle reftest to stroke-dasharray-02.svg. r=longsonr
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.