-moz-radial-gradient doesn't support explicitly defined size

RESOLVED DUPLICATE of bug 712474

Status

()

Core
CSS Parsing and Computation
RESOLVED DUPLICATE of bug 712474
7 years ago
4 years ago

People

(Reporter: cers, Unassigned)

Tracking

(Depends on: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(7 attachments, 6 obsolete attachments)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b10pre) Gecko/20110120 Firefox/4.0b10pre
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b10pre) Gecko/20110120 Firefox/4.0b10pre

As per the current W3C draft, and the new WebKit implementation of the radial-gradient syntax, the shape and size of the gradient can be defined both using size constants (supported by both Firefox and WebKit) and explicitly "by providing two lengths or percentages. These measure the length of the horizontal and vertical axes of the ellipse, respectively." (W3C)

Reproducible: Always

Steps to Reproduce:
1. Load demo
Actual Results:  
Blank rectangle show, and in the error console:
Warning: Error in parsing value for 'background-image'.  Declaration dropped.

Expected Results:  
Radial gradient displayed.
(Reporter)

Comment 1

7 years ago
Forgot to mention, the specific example uses:
-moz-radial-gradient(center, 5em 40px, white, black);
Yep, Tab added this to the draft a few weeks ago; hopefully we'll be able to do this relatively soon after Firefox 4, though I can't promise anything.
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 3

6 years ago
Created attachment 559021 [details]
testcase

Comment 4

6 years ago
Created attachment 559022 [details]
testcase
Attachment #559021 - Attachment is obsolete: true
Created attachment 570480 [details] [diff] [review]
Implement explicit size in -moz-radial-gradent
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Attachment #570480 - Flags: review?(dbaron)
Created attachment 570481 [details] [diff] [review]
Tests

When I pushed the patch to tryserver, debug builds failed on Mochitest4 becase the log was too large.
https://tbpl.mozilla.org/?tree=Try&rev=a76aaf7fbe4b
> Output exceeded 52428800 bytes, remaining output has been truncated
> program finished with exit code 0
How can I sort out this?
Attachment #570481 - Flags: review?(dbaron)
Did this patch cause an assertion to fire frequently, filling up the log, or cause an infinite loop of output?
(In reply to David Baron [:dbaron] from comment #7)
> Did this patch cause an assertion to fire frequently, filling up the log, or
> cause an infinite loop of output?
The log file size was nearly 50MB even without the patch.
This patch just adds a few test cases to property_database.js. So I think it just happened to over the limit.
Created attachment 570510 [details]
grep 'INFO TEST-START |' <unpatched test result>
Created attachment 570511 [details]
grep 'INFO TEST-START |' <patched test result>

test_transitions_per_property is particularly large which includes property_database.js. (Test cases grow 42784 to 49714)
test_value_cloning also wastes the log size because it outputs large "data:" URIs to the log. It took approximately 20 Mbytes!
Created attachment 570531 [details] [diff] [review]
Reduce test_value_cloning test output

Debug mochitests 4 no longer fail with this patch.
Attachment #570531 - Flags: review?(dbaron)
Comment on attachment 570531 [details] [diff] [review]
Reduce test_value_cloning test output

r=dbaron.  Sorry for the delay getting to this.
Attachment #570531 - Flags: review?(dbaron) → review+
I'm a bit hesitant about implementing the current draft of explicit size -- the addition of this feature to the draft made the syntax unreadable, and as a result the draft has been revised substantially.
Comment on attachment 570480 [details] [diff] [review]
Implement explicit size in -moz-radial-gradent

Oh, I didn't notice radial-gradient syntax has been changed once again.
http://dev.w3.org/csswg/css3-images/#radial-gradients
Clearing the review request.
Attachment #570480 - Flags: review?(dbaron)
Attachment #570481 - Flags: review?(dbaron)
Created attachment 576050 [details] [diff] [review]
Implement explicit size and new syntax in -moz-radial-gradent
Attachment #570480 - Attachment is obsolete: true
Attachment #576050 - Flags: review?(dbaron)
Created attachment 576051 [details] [diff] [review]
Tests
Attachment #570481 - Attachment is obsolete: true
Attachment #576051 - Flags: review?(dbaron)
Comment on attachment 576050 [details] [diff] [review]
Implement explicit size and new syntax in -moz-radial-gradent

The explicit size is only defined in new syntax. OTOH, angle is only supported in legacy syntax. It made the patch a bit complicate.
I wish CSS WG would not play with the gradient syntax any longer...
Created attachment 576416 [details] [diff] [review]
Implement explicit size and new syntax in -moz-radial-gradent

Preserving the syntax type. It will improve the compatibility with existing contents which will not expect that .style/getComputedStyle() will serialize properties with new syntax.
Attachment #576050 - Attachment is obsolete: true
Attachment #576416 - Flags: review?(dbaron)
Attachment #576050 - Flags: review?(dbaron)
Created attachment 576428 [details] [diff] [review]
Implement explicit size and new syntax in -moz-radial-gradent

Sorry, the previous patch didn't compile.
Attachment #576416 - Attachment is obsolete: true
Attachment #576428 - Flags: review?(dbaron)
Attachment #576416 - Flags: review?(dbaron)
https://tbpl.mozilla.org/?tree=Try&rev=73827e2e8148
Created attachment 577037 [details] [diff] [review]
Tests

Unbitrotted
Attachment #576051 - Attachment is obsolete: true
Attachment #577037 - Flags: review?(dbaron)
Attachment #576051 - Flags: review?(dbaron)
Comment on attachment 570531 [details] [diff] [review]
Reduce test_value_cloning test output

https://hg.mozilla.org/integration/mozilla-inbound/rev/44ed0b73a421
Attachment #570531 - Flags: checkin+
https://hg.mozilla.org/mozilla-central/rev/44ed0b73a421
Keywords: dev-doc-needed
So the spec has changed a good bit since you requested review.  I think it might be stable now, though it might also be worth either (a) waiting a little or (b) asking Tab if he thinks it's now ready for implementation.
Attachment #576428 - Flags: review?(dbaron)
Attachment #577037 - Flags: review?(dbaron)
(In reply to David Baron [:dbaron] from comment #25)
> So the spec has changed a good bit since you requested review.  I think it
> might be stable now, though it might also be worth either (a) waiting a
> little or (b) asking Tab if he thinks it's now ready for implementation.
I will not post a new patch until the spec actually becomes CR, at least.
The current grammar can no longer co-exist with the legacy one.
Status: ASSIGNED → NEW
Assignee: VYV03354 → nobody
I opened a new bug for the new syntax at https://bugzilla.mozilla.org/show_bug.cgi?id=712474 (before finding this one)

dbaron, could you decide if it can be considered a duplicate of this bug?
I think this has been fixed by bug 712414. Reopen if you disagree.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Keywords: dev-doc-needed
Resolution: --- → DUPLICATE
Duplicate of bug: 712474
Depends on: 798062

Comment 29

4 years ago
This bug is still not fixed, as demostrated at http://geeksbynature.dk/bugs/moz-radial-gradient/
-moz-radial-fradient has never supported (and would never support) explicit size. You need to use unprefixed radial-gradient to use explicit size.

Comment 31

4 years ago
Here is the same example without the prefix: http://jsfiddle.net/CXTVh/

(for some reason I got a warning for the "center" so I replaced that)
Created attachment 723542 [details]
Using correct unprefixed radial-gradient syntax

Just replacing and copy & pasting will not produce the correct unprefixed syntax.
You must have actually missed http://dev.w3.org/csswg/css3-images/#radial-gradient-syntax even if the source mentions the URL.
You need to log in before you can comment on or make changes to this bug.