Strange diagonal lines in Chrome/Chromium (bug?)

自作多情 提交于 2019-11-27 12:05:56

问题


When I use CSS filters, shadows, transformations, SVG (or similar), my Chrome/Chromium shows a strange diagonal lines:

    filter:drop-shadow(0px 0px 10px #dce810);
    transform:skew(-15deg); 

No error in Firefox (Windows) / Canary Chrome 58. Error on Chrome 56 and Chromium 58 (Windows).

In this pen, ocurrs this error (at end, when switch on title): https://codepen.io/manz/pen/jyYKJo

Does anyone know if it's a known bug or some problem that is solved by disabling any option?


回答1:


It's almost certainly this Chrome/Chromium rasterization bug, which appears to be specific to certain NVidia GPUs:

Issue 691262 Corrupted background with GPU rasterization.




回答2:


As indicated above it is a GPU issue but the temporary workaround works great for me:

div {
    position: relative;
    z-index: 0;
}

div:before {
    content: '';
    display: block;
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    background: inherit;
}



回答3:


I was having the same issue in Chrome but I finally found that cleaning up the svg file solved the issue. I used SVGO https://github.com/svg/svgo.



来源:https://stackoverflow.com/questions/41946156/strange-diagonal-lines-in-chrome-chromium-bug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!