From 9eb4214097e4b976a8a9d26280611228f75b65ac Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 16 Apr 2026 19:39:07 +0200 Subject: [PATCH] Make naturalWidth & naturalHeight return non-0 when the image lacks a dimension Unfortunately the more correct behavior was never implemented widely enough and web content started to depend on these properties being non-0. We take special care that dimensions that are missing do not get divided by density so we return the same values for them as CSS (300 by 150). --- source | 49 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/source b/source index 9155017c896..6c544611254 100644 --- a/source +++ b/source @@ -3800,6 +3800,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute