Skip to content
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

Closed
ewilligers opened this issue Oct 19, 2017 · 3 comments
Closed

[filter-effects] drop-shadow can accept color before lengths #231

ewilligers opened this issue Oct 19, 2017 · 3 comments

Comments

@ewilligers
Copy link
Contributor

ewilligers commented Oct 19, 2017

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

@ewilligers ewilligers changed the title filter-effects] drop-shadow can accept color before lengths [filter-effects] drop-shadow can accept color before lengths Oct 19, 2017
ewilligers pushed a commit to ewilligers/web-platform-tests that referenced this issue Oct 19, 2017
Add tests for drop-shadow() with color before lengths.
w3c/fxtf-drafts#231

Add tests for filter functions with no arguments supplied.
@tabatkins
Copy link
Member

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?

dirkschulze added a commit that referenced this issue Dec 24, 2017
…us and standard deviation. Relax syntax of drop-shadow. Issues #102 #231
@dirkschulze
Copy link
Contributor

@tabatkins Background and borders does not specify a different serialisation order where color comes first for box-shadow or do I miss something?

@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.

@dirkschulze
Copy link
Contributor

We should open separate issues for computed values and serialisation. IMO this issue is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants