Workaround regressions in Chrome and Safari (#12221 and #11111).