I've been struggling with an issue for quite some time now and I can't seem to find a solution.
The problem lies in having an SVG image as a CSS background on the top left corner of a div. Instead of seamlessly merging with the div background, it creates thin borders around the rendered graphics. Interestingly, this issue only occurs on Android stock browser, Chrome for Android, and Firefox for Android, while working perfectly fine on desktop browsers such as Chrome, Firefox, and Opera.
For reference, here is a small test case: http://jsfiddle.net/SDJHA/1/ (the SVG code can be found in the JavaScript frame as a comment)
The CSS code used is as follows:
.cont{ background-color : #7AC943; width : 300px; height : 300px; }
.elementOne{
background-image: url("data:image/svg+xml;utf8,%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%22100px%22%20height%3D%22100px%22%20viewBox%3D%220%200%20100%20100%22%20enable-background%3D%22new%200%200%20100%20100%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%237AC943%22%20points%3D%22100%2C100%20100%2C0%200%2C100%20%22%2F%3E%3C%2Fsvg%3E");
width : 100px; height: 100px;
background-size: 100px 100px;
background-repeat: no-repeat;
background-color : white;
}
The HTML structure should look like this:
<div class="cont"><div class="elementOne"></div></div>
It appears to be a bug related to the android svg rendering engine possibly miscalculating subpixels... I'm not entirely sure.
This issue was identified during testing on both an Asus Transformer and HTC One devices.
If anyone has any advice or insights on how to solve this problem, it would be greatly appreciated!
Thank you!