diff --git a/lib/web_ui/test/html/paragraph/general_golden_test.dart b/lib/web_ui/test/html/paragraph/general_golden_test.dart
index cd65600df5043..e3caf19f03b13 100644
--- a/lib/web_ui/test/html/paragraph/general_golden_test.dart
+++ b/lib/web_ui/test/html/paragraph/general_golden_test.dart
@@ -536,7 +536,7 @@ Future testMain() async {
test('foreground style (DOM)', () {
const Rect bounds = Rect.fromLTWH(0, 0, 300, 200);
- final DomCanvas canvas = DomCanvas(domRenderer.createElement('flt-picture'));
+ final DomCanvas canvas = DomCanvas(html.document.createElement('flt-picture'));
testForegroundStyle(canvas);
return takeScreenshot(canvas, bounds, 'canvas_paragraph_foreground_style_dom');
});