简体   繁体   English

渲染CSS转换过渡时Chromium中的错误

[英]Bug in Chromium with rendering css transformation transition

I found a bug in Chromium. 我在Chromium中发现了一个错误。

It seems that the engine renders transitions in some kind of special layer. 引擎似乎在某种特殊的层中渲染过渡。 Part of content which overflows over border-radius should be hidden, but it is not. 超出边框半径的部分内容应该被隐藏,但事实并非如此。

Look at this example: http://jsbin.com/nijavunoqe/1/edit?html,css,output 看这个例子: http : //jsbin.com/nijavunoqe/1/edit?html,css,output

Hover mouse over color squares. 将鼠标悬停在颜色方块上。 You will notice that while animation corners are visible. 您会注意到,虽然动画角是可见的。 And furthermore it affects neighbour element. 而且它影响邻居元素。 Firefox and IE are ok. Firefox和IE都可以。

So, the question is: Is it possible to find a way around this bug and get it to work as expected? 因此,问题是:是否有可能找到解决此bug的方法并使它按预期工作?

.container
  border: 1px solid red
  width: 200px
  height: 200px
  border-radius: 20px
  overflow: hidden

  margin-bottom: 10px

img
  height: 220px
  width: 220px
  margin-top: -10px
  margin-left: -10px
  cursor: pointer
  transition: width 1s, height 1s, margin-top 1s, margin-left 1s

  &:hover
    height: 240px
    width: 240px
    margin-top: -20px
    margin-left: -20px

You can use this code in the mean time for chrome. 您可以在Chrome的平均时间内使用此代码。 Those transforms are broken as hell I've never even noticed. 这些转换被打破了,我什至从未注意到。

Just note that I changed your .content to img. 请注意,我已将您的.content更改为img。 It didn't work straight off the bat with .container but I'm sure you can tweak it from here. .container不能立即起作用,但是我敢肯定您可以从这里进行调整。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM