whatwg / compat

Compatibility Standard
https://compat.spec.whatwg.org/
Other
112 stars 39 forks source link

Specify unitless values for -webkit-perspective #100

Open miketaylr opened 6 years ago

miketaylr commented 6 years ago

Bugzilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1362499 Test case: view-source:https://bug1362499.bmoattachments.org/attachment.cgi?id=8871283

Chrome, Safari, and Edge behave the same, with Firefox being the outlier:

screen shot 2018-05-01 at 10 00 00 am

Question: do unitless values work for other -webkit-transform-related props?

miketaylr commented 5 years ago

@foolip is this quirk something Blink feels like it can get rid of?

(@upsuper suggested that in https://bugzilla.mozilla.org/show_bug.cgi?id=1522967#c3)

emilio commented 5 years ago

transform supports unitless zero angles in a few places, but I think that's it.

ewilligers commented 5 years ago

is this quirk something Blink feels like it can get rid of?

I suspect the usage is too high: https://www.chromestatus.com/metrics/feature/timeline/popularity/1671

upsuper commented 5 years ago

Oh this is about perspective property... I was talking about -webkit-transform: perspective().

Anyway, there are several questions regarding the numbers:

If the number currently doesn't take them into account, then there is probably a good chance that the usage being high may not really be a problem for removing it.

upsuper commented 5 years ago

So I investigated several sample urls listed under the statistics, specifically:

I don't find any usage of perspective in the last URL, but others all involve non-zero non-standard-only form, so I'm partially convinced that the high usage is probably a real problem, so we may need to standardize something.

The other thing I noticed is that, there is one site doing something like:

-moz-perspective: 100px;
-moz-transform: rotateY(-3deg);
-webkit-transform: perspective(100) rotateY(-3deg);

If Gecko is going to support quirk in perspective, then this would effectively be equivalent to:

perspective: 100px;
transform: perspective(100px) rotateY(-3deg);

I'm not familiar with CSS Transform, so not sure whether this can become a problem for Gecko.

ewilligers commented 5 years ago
  • Does the number exclude forms like -webkit-perspective: 500; perspective: 500px; (i.e. authors provide a standard version while using quirks for non-standard property at the same time)?

No.

  • Does the number exclude zero, e.g. perspective: 0 (which is a valid <length> per spec)?

Yes.

Oh this is about perspective property... I was talking about -webkit-transform: perspective().

Unitless perspective() in -webkit-transform has much lower usage: https://www.chromestatus.com/metrics/feature/timeline/popularity/1672

Same answers as above: It doesn't exclude valid transform while using quirks for -webkit-transform. It does exclude perspective(0).

I suspect the usage it just high enough that we would be unlikely to remove. That would be question for blink-dev (e.g. if anybody wanted to send an Intent to Deprecate and Remove).

foolip commented 5 years ago

https://www.chromestatus.com/metrics/feature/timeline/popularity/1672 is indeed at a usage level where removal might go well but might also run into a lot of problems.

I looked for pages in httparchive which have hit this counter: https://bigquery.cloud.google.com/savedquery/762219082167:6959d160407546238ce89fb4a04a2d59 (desktop, 4998 matches) https://bigquery.cloud.google.com/savedquery/762219082167:7118fd961bbe4adba2ad3a733bd2e377 (mobile, 6492 matches)

https://gist.github.com/foolip/eef626588ed75727c663e46902ff9fcb is the output of the mobile query. I think that if removing this is desirable, then the best next step would be for someone to try analyzing a random sample of these sites to see if they would break if behavior changed.

birtles commented 2 years ago

https://gist.github.com/foolip/eef626588ed75727c663e46902ff9fcb is the output of the mobile query. I think that if removing this is desirable, then the best next step would be for someone to try analyzing a random sample of these sites to see if they would break if behavior changed.

Here's one site that is broken in Gecko due to this:

http://www.satine.org/research/webkit/snowleopard/snowstack.html

Reported as Gecko bug 1756417