Intent to Deprecate and Remove: CSS filter should reject negative brightness

134 views
Skip to first unread message

Rob Buis

unread,
Apr 5, 2018, 10:42:22 AM4/5/18
to blin...@chromium.org

Primary eng (and PM) emails
rob....@samsung.org

Summary
CSS filter property should reject negative brightness values.

Motivation
The spec explicitly mentions negative values are not allowed:
https://drafts.fxtf.org/filter-effects/#FilterProperty
https://www.w3.org/TR/filter-effects-1/#funcdef-brightness

Interoperability and Compatibility Risk
Low risk since most implementations reject negative values for brightness already.

Edge: Rejects negative brightness
Firefox: Rejects negative brightness
Safari: Accepts negative brightness

Alternative implementation suggestion for web developers
N/A, negative values have no effect, 0% already darkens completely.

Usage information from UseCounter
Very low usage, maximum is around 0.05%:
https://www.chromestatus.com/metrics/feature/timeline/popularity/2193

Tracking bug
https://bugs.chromium.org/p/chromium/issues/detail?id=776208

Entry on the feature dashboard
No entry. Change is believed to be too small to merit one.

Requesting approval to remove too?
Yes, asking approval to deprecate and remove this feature.

Eric Willigers

unread,
Apr 9, 2018, 10:10:37 AM4/9/18
to blink-dev
non-owner lgtm

PhistucK

unread,
Apr 9, 2018, 10:17:56 AM4/9/18
to Eric Willigers, blink-dev
0.05% is pretty high, plus, Chrome and Safari (the entire mobile ecosystem, basically) support this. Did you search HTTPArchive and see whether the effect is detrimental (unintended (in)visible text/images)?
Can you tell whether this is a JavaScript computation originated value (perhaps unimportant and acceptable) versus a normal CSS declaration in a CSS file?


PhistucK

On Mon, Apr 9, 2018 at 5:10 PM, Eric Willigers <ericwi...@chromium.org> wrote:
non-owner lgtm

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/03428b69-994b-41d3-9b26-e5786430bd4e%40chromium.org.

Rob Buis

unread,
Apr 9, 2018, 1:10:02 PM4/9/18
to blink-dev, ericwi...@chromium.org
Hi,

I could not find anything relevant on HTTPArchive.
The change will be visible to the user, before the change the picture will be all black (similar to 0%) using negative brightness, after the change the picture will be the original (since negative brightness will be invalid, so same as if there was no (sub)filter at all). Hope that helps.
Regards,

Rob.


On Monday, April 9, 2018 at 10:17:56 AM UTC-4, PhistucK wrote:
0.05% is pretty high, plus, Chrome and Safari (the entire mobile ecosystem, basically) support this. Did you search HTTPArchive and see whether the effect is detrimental (unintended (in)visible text/images)?
Can you tell whether this is a JavaScript computation originated value (perhaps unimportant and acceptable) versus a normal CSS declaration in a CSS file?


PhistucK

On Mon, Apr 9, 2018 at 5:10 PM, Eric Willigers <ericwi...@chromium.org> wrote:
non-owner lgtm

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

PhistucK

unread,
Apr 9, 2018, 1:18:36 PM4/9/18
to Rob Buis, blink-dev, Eric Willigers
It can break website design (filter: brightness(-1) blur(...) will be completely invalid), or reveal things that were black before. I think this needs some more investigation, considering the relatively high usage. Maybe get the domains using RAPPOR or similar (ask a Googler).


PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/cc163d4a-c7b2-495e-a520-e8f61045a1d5%40chromium.org.

Eric Willigers

unread,
Apr 11, 2018, 11:20:54 AM4/11/18
to blink-dev, rob....@samsung.com, ericwi...@chromium.org
I did a string search for "brightness(-" and came up with the results below.

If we rejected negative brightness for filter but not -webkit-filter, the top sites would experience no change in behavior.


  -webkit-filter:blur(3px);
  filter:blur(3px)
[I can't locate the negative brightness on this site.]

  -webkit-filter: contrast(50%) brightness(65%);
  -moz-filter: contrast(50%) brightness(65%);
  -o-filter: contrast(50%) brightness(65%);
  filter: contrast(50%) brightness(65%);
[I can't locate the negative brightness on this site.]

  -webkit-filter:grayscale(100%) brightness(-5);
  filter:grayscale(100%) brightness(-5);

  -moz-filter: brightness(-20%) blur(2px);
  -o-filter: brightness(-20%) blur(2px);
  -ms-filter: brightness(-20%) blur(2px);

  -webkit-filter: brightness(-65%);

PhistucK

unread,
Apr 11, 2018, 12:00:21 PM4/11/18
to Eric Willigers, blink-dev, Rob Buis
It does not seem worrisome, even with -webkit-filter.


PhistucK

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

PhistucK

unread,
Apr 11, 2018, 12:02:58 PM4/11/18
to Eric Willigers, blink-dev, Rob Buis
Please, do create a chromestatus.com entry, as it feeds the beta blog post.
Thank you!


PhistucK

Chris Harrelson

unread,
Apr 11, 2018, 2:54:42 PM4/11/18
to PhistucK, Eric, blink-dev, Rob Buis
LGTM1



PhistucK



PhistucK

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABc02_JNDvyk33kNe_27iRM2Bq4nS4AgO5eF0UkgUSLSGoYX6A%40mail.gmail.com.

Alex Russell

unread,
Apr 12, 2018, 1:33:27 PM4/12/18
to blink-dev, phis...@gmail.com, ericwi...@chromium.org, rob....@samsung.com, chri...@chromium.org
Per API OWNERS conversation today, do we know if a negative brightness value in the `-webkit-filter` case actually darkens? And is there a reason the API won't support darkening if so?

oj...@google.com

unread,
Apr 12, 2018, 1:41:56 PM4/12/18
to blink-dev, phis...@gmail.com, ericwi...@chromium.org, rob....@samsung.com, chri...@chromium.org
We did a bit more research and understand now that brightness(0) is fully darkened. So, this makes sense. We did have one question of what happens if you list multiple brightness filters. Does the latest one override the earlier ones or do they merge in some way e.g. brightness(10%) brightness(-10%). In quick testing it seems like it doesn't matter since that will effectively be brightness(0) regardless, right?

In either case, this makes us consistent with edge/firefox and makes the platform more consistent by making contrast and brightness behave the same with respect to negative values.

LGTM2

rob....@chromium.org

unread,
Apr 12, 2018, 7:36:49 PM4/12/18
to blink-dev, ericwi...@chromium.org, rob....@samsung.com
I don't think I can do it as a non-googler. Eric would you be willing to add one?

PhistucK

unread,
Apr 13, 2018, 4:11:06 AM4/13/18
to rob....@chromium.org, blink-dev, Eric Willigers, Rob Buis
You can request edit access using the link at the bottom of chromestatus.com, by the way.


PhistucK

Eric Willigers

unread,
Apr 13, 2018, 4:32:40 AM4/13/18
to rob....@chromium.org, blink-dev, Rob Buis

Chris Harrelson

unread,
Apr 13, 2018, 12:42:31 PM4/13/18
to Eric, rob....@chromium.org, blink-dev, Rob Buis
LGTM3, but I'd like to understand the answer to Ojan's question about whether brightnesses can be added, and whether this constitutes a risk.

On Fri, Apr 13, 2018 at 1:32 AM Eric Willigers <ericwi...@chromium.org> wrote:

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAAyiQQPschCRiBYLdHqjjNqENJpT0xhgkMeVOynh3PS6QZ4pwA%40mail.gmail.com.

Fredrik Söderquist

unread,
Apr 13, 2018, 6:39:52 PM4/13/18
to Ojan Vafai, blink-dev, PhistucK, Eric Willigers, rob....@samsung.com, Chris Harrelson
On Thu, Apr 12, 2018 at 7:41 PM, ojan via blink-dev <blin...@chromium.org> wrote:
We did a bit more research and understand now that brightness(0) is fully darkened. So, this makes sense. We did have one question of what happens if you list multiple brightness filters. Does the latest one override the earlier ones or do they merge in some way e.g. brightness(10%) brightness(-10%). In quick testing it seems like it doesn't matter since that will effectively be brightness(0) regardless, right?

Filter functions are applied in sequence [so you could write it as brightness(brightness(SourceGraphic, 10%), -10%) in a more "functional" form where the input is explicitly specified - SourceGraphic being the original "image" of the element], so this would indeed yield the same output as just brightness(0). So neither overriding nor merging takes place, the filter functions just apply in the order specified.


/fs

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/d1daaaa9-df79-4c52-afeb-d994870ce081%40chromium.org.

Rick Byers

unread,
Apr 19, 2018, 7:28:10 PM4/19/18
to Fredrik Söderquist, Ojan Vafai, blink-dev, PhistucK, Eric Willigers, rob....@samsung.com, Chris Harrelson
Real LGTM3 since Chris's two LGTMs only really count as one 😉

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
Reply all
Reply to author
Forward
0 new messages