Last Comment Bug 407107 - Canvas tests passing on Mac but failing on Windows/Linux
: Canvas tests passing on Mac but failing on Windows/Linux
Status: NEW
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86 Linux
P3 normal with 2 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Milan Sreckovic [:milan]
Depends on:
Blocks: 622842
  Show dependency treegraph
Reported: 2007-12-05 20:44 PST by Boris Zbarsky [:bz] (still a bit busy)
Modified: 2012-05-18 06:47 PDT (History)
5 users (show)
mbeltzner: wanted‑next+
pavlov: blocking1.9-
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Boris Zbarsky [:bz] (still a bit busy) 2007-12-05 20:44:56 PST
The following tests pass on Mac but not Windows/Linux:


Not sure whether they should pass or fail, but the platform difference in behavior seems to be a cairo bug or set of bugs.  We should probably push this upstream, but I'm not sure how to create a simple-ish cairo testcase here.
Comment 1 User image Vladimir Vukicevic [:vlad] [:vladv] 2008-03-14 15:16:07 PDT does:

ctx.lineWidth = 200;
ctx.rect(100, 25, 1000, 0);

and expects this to not draw anything.  In cairo land, a rect is a set of movetos and linetos always, so this is essentially drawing two overlapping horizontal lines and two 0-sized lines for the vertical sides.. thus the stroke() has an effect.  The spec says:

> The rect(x, y, w, h) method must create a new subpath containing just the four points (x, y), (x+w, y), (x+w, y+h), (x, y+h), with those four points connected by straight lines, and must then mark the subpath as closed. It must then create a new subpath with the point (x, y) as the only point in the subpath. 

So, this test is invalid.

rect.selfintersect looks like a valid cairo bug.
Comment 2 User image Boris Zbarsky [:bz] (still a bit busy) 2008-03-14 16:01:12 PDT
> So, this test is invalid.

Like I said, I'm not sure whether passing or failing is the right thing, but doing it differently on Mac and Windows/Linux is wrong, right?  If the test is invalid that means passing is wrong, so the Mac behavior her is wrong?
Comment 3 User image Philip Taylor 2011-10-08 08:41:56 PDT draws a rectangle from (100,25) to (1100,25) and expects it to not draw anything in the visible region (0,0)-(100,50). It should only draw any pixels with x >= 100.

If the height was *not* zero, then the vertical lines of the rectangle and the miters in the corners would get drawn with x < 100 (given the miter limit and line width). But since the height is zero, and "Zero-length line segments must be pruned before stroking a path", there are no vertical lines; the rect() is roughly equivalent to

  moveTo(100, 25);
  lineTo(1100, 25);

so there's no vertical line and the line join miter won't get drawn, so nothing gets drawn at x < 100.

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