-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[filter-effects] drop-shadow can accept color before lengths #231
Comments
Add tests for drop-shadow() with color before lengths. w3c/fxtf-drafts#231 Add tests for filter functions with no arguments supplied.
This should ideally match, in both parsing and serialization, the box-shadow property (modulo the functionality differences). This means parsing should accept color on either side. Serialization is trickier - per spec, color should come last, but it looks like in both Chrome and Firefox, color gets serialized first for box-shadow. The spec should presumably be changed to reflect that ordering? |
@tabatkins Background and borders does not specify a different serialisation order where color comes first for @ewilligers I changed the syntax and length and colour values order can be changed now. That said, the the spec should probably specify the computed value for each filter function individually. A different issue though. |
We should open separate issues for computed values and serialisation. IMO this issue is closed. |
w3c/fxtf-drafts#231 was resolved by allowing this grammar in the spec.
The current spec suggests the color must appear last.
https://drafts.fxtf.org/filter-effects/#funcdef-filter-drop-shadow
drop-shadow() = drop-shadow( <length>{2,3} <color>? )
However, Blink, WebKit and Firefox also accept the color first.
Regardless of the author-supplied order, Blink and WebKit serialize with the color first, and Firefox serializes with the color last.
"drop-shadow(rgb(4, 5, 6) 1px 2px)" becomes "drop-shadow(1px 2px rgb(4, 5, 6))" in Firefox.
"drop-shadow(1px 2px rgb(4, 5, 6))" becomes "drop-shadow(rgb(4, 5, 6) 1px 2px)" in Blink and WebKit.
Only Edge strictly follows the spec here, in requiring color to be last.
We could change the grammar to
drop-shadow() = drop-shadow( [ <length>{2,3} && <color>? ] )
Test PR that should be updated if this proposal is accepted:
web-platform-tests/wpt#7890
The text was updated successfully, but these errors were encountered: