This seems to be related to webkit bug 23113. The only workaround I've found so far is adding a CSS transform: scale(${scale}) (where you'd have to get the current scale using JS) property to a inside foreignObject (an example can be found in marpit-svg-polyfill)