Status

()

Core
Canvas: 2D
RESOLVED WORKSFORME
12 years ago
9 years ago

People

(Reporter: annevk, Unassigned)

Tracking

(Depends on: 1 bug, {testcase})

Trunk
x86
Windows XP
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(5 attachments)

(Reporter)

Description

12 years ago
Feel free to split this bug (and the four testcases I'm about to attach) into different bugs. This is more or less a follow-up to bug 308929. Here are the problems:

1. The pattern is drawn in the wrong location.
2. repeat-x and repeat-y are not supported.
(Reporter)

Comment 1

12 years ago
Created attachment 214291 [details]
image
(Reporter)

Comment 2

12 years ago
Created attachment 214292 [details]
testcase #1
(Reporter)

Comment 3

12 years ago
Created attachment 214293 [details]
testcase #2
(Reporter)

Comment 4

12 years ago
Created attachment 214294 [details]
testcase #3
(Reporter)

Comment 5

12 years ago
Created attachment 214295 [details]
testcase #4
(In reply to comment #3)
> Created an attachment (id=214293) [edit]
> testcase #2

(This is the single no-repeat case)

Why do you say that the circle should be centered in the black bordered square?  You're filling a rectangle from 0,0 to 150,150, with a 50x50 pattern image.  It's in the right place..

repeat-x/repeat-y not being supported is known; I need to write code to emulate it using clipping, but it's a pain.

Now, the circle is ending up corrupted in the tiling for some reason; I'll look into that.
> Now, the circle is ending up corrupted in the tiling for some reason; I'll look
> into that.

Blah, I know why that's happening; the handling of 1-bit images is horked (bits are packed backwards).  I'll fix.
(Reporter)

Comment 8

12 years ago
(In reply to comment #6)
> Why do you say that the circle should be centered in the black bordered
> square? You're filling a rectangle from 0,0 to 150,150, with a 50x50 pattern
> image. It's in the right place..

The specification says: "Patterns are painted so that the first image is centered in the middle of the coordinate space, [...]"

This seems to imply that the image is not in the right place.
(In reply to comment #8)
> (In reply to comment #6)
> > Why do you say that the circle should be centered in the black bordered
> > square? You're filling a rectangle from 0,0 to 150,150, with a 50x50 pattern
> > image. It's in the right place..
> 
> The specification says: "Patterns are painted so that the first image is
> centered in the middle of the coordinate space, [...]"
> 
> This seems to imply that the image is not in the right place.

Ugh.. the spec is bogus in that case.  It should specify that pattern tiling always starts at the origin specified by the current transformation matrix. (Because that's the only thing that makes sense, and it's also what both us and safari have implemented -- safari's pattern tiling is broken for everything but the "repeat" case, though, in 10.4)

(Reporter)

Comment 10

12 years ago
Fine by me. I'm just testing the spec ;-)
vlad: When the spec is bogus, please let me know. Commenting in a bug report is not likely to get my attention (I only noticed it by luck this time).

Anyway, I'll take a look at this...
Ok, spec updated.
(In reply to comment #11)
> vlad: When the spec is bogus, please let me know. Commenting in a bug report is
> not likely to get my attention (I only noticed it by luck this time).
> 
> Anyway, I'll take a look at this...

Yeah, I planned to verify Safari first (by looking at the source, at least) before letting you know :)
Ah, ok. Thanks! :-) Let me know if you find the Safari source disagrees with the new spec wording.
(Reporter)

Comment 15

11 years ago
After thinking about it, does the new spec text still make sense for strokes?
Yes, a stroke is the same thing as a fill -- except that the original path is transformed into a path to be filled according to the stroke parameters (line width, line caps/joins).
(Reporter)

Comment 17

11 years ago
Well for paths it might make more sense to align in the middle, but I don't really care. These testcases are now hosted here:

  http://testsuite.org/html/elements/canvas/getContext/2d/createPattern/

If there are no more bugs I guess this can be resolved.
Depends on: 380207
MORE TESTCASES
   http://www.hixie.ch/tests/adhoc/html/canvas/021.html
   http://www.hixie.ch/tests/adhoc/html/canvas/022.html
   http://www.hixie.ch/tests/adhoc/html/canvas/023.html
   http://www.hixie.ch/tests/adhoc/html/canvas/024.html
   http://www.hixie.ch/tests/adhoc/html/canvas/025.html
   http://www.hixie.ch/tests/adhoc/html/canvas/026.html
   http://www.hixie.ch/tests/adhoc/html/canvas/027.html
   http://www.hixie.ch/tests/adhoc/html/canvas/028.html

These test placement. I didn't see any errors except bug 380207.
There appear to be no bugs in this except repeat-x and repeat-y not being supported properly. Resolving WFM.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.