<img>'s naturalWidth,naturalHeight,currentSrc can be inconsistent with what is rendered |
||||
Issue descriptionInvestigation 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)
,
Oct 21 2017
Made the investigation doc public.
,
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'.)
,
Oct 21 2017
> 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)
,
Oct 23 2017
,
Oct 23
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
,
Oct 23
|
||||
►
Sign in to add a comment |
||||
Comment 1 by hirosh...@chromium.org
, Oct 20 2017