New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 777021 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 774718



Sign in to add a comment

<img>'s naturalWidth,naturalHeight,currentSrc can be inconsistent with what is rendered

Project Member Reported by hirosh...@chromium.org, Oct 20 2017

Issue description

Investigation doc:
https://docs.google.com/a/chromium.org/presentation/d/1E53whGnbFJs-OlndfKnkkAmRT-p8nxwvo6wDdwOSFFw/edit?usp=sharing

(I found this while investigating another issue, which turned out unrelated to this. I'm not sure whether this causes real problem, but reporting anyway)

1. Create <img> with src attribute.
2. After img's onload, set img.src to another URL to start loading a new image.
3. After the new image's dimensions are available and before img's onload, img.naturalWidth, img.naturalHeight, and img.currentSrc are set to those of the new image, while the image rendered on the display, img.width and img.height stay unchanged (i.e. set to those of the old image).

Test case:
https://chromium-review.googlesource.com/c/chromium/src/+/731682
(http://127.0.0.1:8000/image_test.html with run-blink-httpd)
 
Blocking: 774718
Made the investigation doc public.

Comment 3 by f...@opera.com, Oct 21 2017

I think this was sort of alluded to in the doc, but if we're currently display the 'current request' and have a 'pending request', then "undisplaying" (display: none) and "redisplaying" the <img> will make us show the 'pending request' (assuming it has not yet been promoted to 'current'.)
> fs@, Comment #3
Thanks, it's clearer explanation!

When I undisplayed/redisplayed the image, then the new image is displayed and width reflects the width of the new image, in Step 3 in Comment #0. (Thus the attributes and the image displayed refer to the 'pending request' consistently; still they should refer to 'current request' IIUC though)

Status: Available (was: Untriaged)
Project Member

Comment 6 by sheriffbot@chromium.org, Oct 23

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment