cssinjs / css-vendor

Runtime vendor prefixing based on feature detection.
MIT License
67 stars 24 forks source link

Implement old flexbox for supportedProperty #19

Closed cvle closed 7 years ago

cvle commented 7 years ago

This PR does the following:

This PR (and previous PRs) only implements the supportedProperty part and we still need to properly implement the supportedValue counterpart.

44 failing tests left (all IE and Edge related).

cvle commented 7 years ago

I'm still experimenting on how we could support the uc browser...

cvle commented 7 years ago

I think for the UC browser we should utilize browser sniffing and handle it separately as the ability to feature detect is inconsistent. I would keep all UC browser related code separately, so we can delete it once the UC browser becomes 100% feature detectable...

cvle commented 7 years ago

Let's move on for now and deal with UC browser later on..

kof commented 7 years ago

Is UC specific stuff really UC specific or just old spec? So we are not able to feature detect the old spec?

cvle commented 7 years ago

It is really UC specific. So when you feature detect UC you will find support for the new spec and the old spec even though it only supports the old one.

kof commented 7 years ago

It is really UC specific. So when you feature detect UC you will find support for the new spec and the old spec even though it only supports the old one.

In this weird case it seems like we have to do the sniffing.

kof commented 7 years ago

Is there any good simple way to identify UC browser?

cvle commented 7 years ago

Yeah bowser simply does this: /ucbrowser/i.test(ua). Pretty simple.

kof commented 7 years ago

Just wanted to write this.

kof commented 7 years ago

I hope its reliable across all the devices and versions.

kof commented 7 years ago

Btw. what about a more complex feature testing. For e.g. creating an element, positioning it with flex, looking up its calculated position.

cvle commented 7 years ago

You'll slow down all other browsers, just because one browser is behaving weirdly. I don't want to support a misbehaving browser on the cost of others.

cvle commented 7 years ago

And they hopefully fix these issues with the next major release. So this will be a temporary workaround anyway.

kof commented 7 years ago

You'll slow down all other browsers, just because one browser is behaving weirdly. I don't want to support a misbehaving browser on the cost of others.

It depends, could be done once relatively quickly and cached, most probably a matter of < 1ms

cvle commented 7 years ago

Your suggestion would make sense if we need a permanent solution. But once the UC Browser updates its rendering engine we would revert to the solution of this PR as it is faster and more consistent with the rest. I prefer using browser sniffing and just flag the flex props of the new spec as false positives.

cvle commented 7 years ago

I applied changes to the PR

kof commented 7 years ago

merged, looks good!