mattdesl / dom-css

fast dom CSS styling
MIT License
152 stars 13 forks source link

-webkit-clip-path #6

Open mattdesl opened 9 years ago

mattdesl commented 9 years ago

not auto-prefixing this style

baptistebriel commented 9 years ago

Hello Matt, is there any news on this? I wanted to use clip-path with dom-css, but looks like nothing happens. Cheers!

baptistebriel commented 9 years ago

Oh, just came across this — https://github.com/jquery/jquery/issues/2489 So, this works for webkit browsers.

var str = 'polygon(0 0, 100% 0, 100% ' + val + '%, 0 ' + val + '%)';

css(el, {
  'clipPath': str,
  'webkitClipPath': str
});
mattdesl commented 9 years ago

This is a chrome bug unfortunately. Related: https://code.google.com/p/chromium/issues/detail?id=512502&thanks=512502&ts=1437501499

It also occurs with writingMode and filter. I was considering writing a small patch to fix this in prefix-style ... but it would be obsolete when Chrome fixes the bug. :confused: