Skip to content

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

@ewilligers

Description

@ewilligers

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions