Closed Bug 526402 Opened 16 years ago Closed 16 years ago

background: -moz-linear-gradient(0 0, yellow, blue); renders horizontal gradient instead of diagonal

Categories

(Core :: CSS Parsing and Computation, defect, P2)

x86
Windows XP
defect

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta2-fixed

People

(Reporter: aja+bugzilla, Assigned: zwol)

References

()

Details

Attachments

(2 files, 2 obsolete files)

background: -moz-linear-gradient(0 0, yellow, blue); renders horizontal gradient instead of diagonal See 2nd column of "Example 2 - basic corner-to-corner diagonal gradient" at http://a-ja.net/newgrad.html Tests at URL are derived from examples in spec proposal at http://www.xanthir.com/:4bhipd FYI: 0px 0px or 0% 0% both result in diagonal, so perhaps it's unknown/undefined unit type case that's failing
Flags: wanted1.9.2?
Flags: blocking1.9.2?
I think it's just a parsing bug.
Assignee: nobody → zweinberg
(In reply to comment #1) > I think it's just a parsing bug. Perhaps so. No message in error console for it, though, like the other couple of <bg-position> syntax "errors" in this test page.
Attached patch patch (obsolete) — Splinter Review
Yeah, it's a parsing bug. The first bare 0 was being interpreted as an angle, rather than as part of the box position. Two-line patch attached. aja, I'd like to make your example page into reftests. Would that be okay? I'm not gonna be able to do it until later today, though.
Attachment #410267 - Flags: review?(roc)
(In reply to comment #3) > aja, I'd like to make your example page into reftests. Would that be okay? Sure, please do...make use of its content however you wish.
Hmmm. But according to the spec linear-gradient(0 top left, yellow, blue) should also be valid, and this switches to rejecting that. Perhaps we should be changing the spec here, although I'm not sure how.
Actually, the problem is that our code accepts '0' as an angle. The spec says that angles always require a unit identifier. We should fix that bug (and probably add a test to test_units_angle.html .)
And the same for times and frequencies, actually.
Comment on attachment 410267 [details] [diff] [review] patch based on dbaron's comments
Attachment #410267 - Flags: review?(roc) → review-
I have a patch to change things so that we don't accept '0' for those, except for arguments to transform functions, which I'll keep at least for now.
Attached patch patchSplinter Review
Here's a patch that I just pushed to try. (It passes the layout/style mochitests.) Still needs the reftests added, though. Any chance you could do that?
Attachment #410267 - Attachment is obsolete: true
Attachment #410300 - Flags: review?(zweinberg)
(In reply to comment #10) > Here's a patch that I just pushed to try. (It passes the layout/style > mochitests.) Passes full tests on try server on Linux and Mac (still waiting for Windows).
Comment on attachment 410300 [details] [diff] [review] patch Patch looks good to me. Working on reftests now.
Attachment #410300 - Flags: review?(zweinberg) → review+
Attached patch tests (obsolete) — Splinter Review
Here's a patch which adds all of the linear gradient tests from http://a-ja.net/newgrad.html to the reftests. The ones that don't work because of bug 522607 are marked 'fails', as are two tests where we don't generate the exact same gradient for (bottom, blue, yellow) as (top, yellow, blue). I haven't done the radials because they look less interesting and I'm not sure how to map from -moz-radial-gradient to canvas createRadialGradient. I might come back to those later.
Attachment #410399 - Flags: review?(dbaron)
Comment on attachment 410399 [details] [diff] [review] tests Looks good, although the tests that almost pass seem odd.
Attachment #410399 - Flags: review?(dbaron) → review+
(I'm not in a position to land this today given W3C meetings, but you're welcome to.)
I just marked aja-linear-6a.html as "fails-on-mac", to make it stop oranging the mac everythingelse boxes: http://hg.mozilla.org/mozilla-central/rev/826336c03eb6
Filed bug 526708 for the failure dholbert caught.
Attachment #410300 - Flags: approval1.9.2?
Incorporated the bustage fixes that dholbert and I made to trunk. I'd like to land both the patches in this bug, together with bug 513395, on 1.9.2 tomorrow assuming no other problems are found.
Attachment #410399 - Attachment is obsolete: true
Attachment #410442 - Flags: review+
Attachment #410442 - Flags: approval1.9.2?
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [baking for 1.9.2: fallout from 513395]
Flags: wanted1.9.2?
Flags: blocking1.9.2?
Flags: blocking1.9.2+
Attachment #410300 - Flags: approval1.9.2? → approval1.9.2+
Comment on attachment 410442 [details] [diff] [review] tests with bustage fixes a192=beltzner
Attachment #410442 - Flags: approval1.9.2? → approval1.9.2+
Whiteboard: [baking for 1.9.2: fallout from 513395]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: