Preflight Checklist
Electron Version
39.2.7
What operating system(s) are you using?
Windows
Operating System Version
Windows 11 25H2
What arch are you using?
x64
Last Known Working Electron version
No response
Does the issue also appear in Chromium / Google Chrome?
I don't know how to test
Expected Behavior
Intuitively, setBounds is related to positions and has nothing to do with the favicon. So page-favicon-updated event should not be emitted when calling setBounds with a new bounds on a WebContentsView.
Actual Behavior
Construct a WebContentsView, listen its page-favicon-updated event, add it to the main window, and loadURL for like https://electronjs.org. Then call setBounds with a new bounds on the WebContentsView, page-favicon-updated will be triggered.
This doesn't occur on all websites, but many websites have this problem, including https://github.com.
Usually this won't lead to noticeable problems. But if the user wants to auto resize the WebContentsView when the main window resizes, setBounds will be frequently called and a series of page-favicon-updated event will be emitted, even if the favicon urls array is not changed.
Testcase Gist URL
https://gist.github.com/z0gSh1u/72fe6f155e1f145385461853d7ef2782
Additional Information
Can be reproduced on macOS too.
Preflight Checklist
Electron Version
39.2.7
What operating system(s) are you using?
Windows
Operating System Version
Windows 11 25H2
What arch are you using?
x64
Last Known Working Electron version
No response
Does the issue also appear in Chromium / Google Chrome?
I don't know how to test
Expected Behavior
Intuitively,
setBoundsis related to positions and has nothing to do with the favicon. Sopage-favicon-updatedevent should not be emitted when callingsetBoundswith a newboundson a WebContentsView.Actual Behavior
Construct a WebContentsView, listen its
page-favicon-updatedevent, add it to the main window, andloadURLfor likehttps://electronjs.org. Then callsetBoundswith a newboundson the WebContentsView,page-favicon-updatedwill be triggered.This doesn't occur on all websites, but many websites have this problem, including
https://github.com.Usually this won't lead to noticeable problems. But if the user wants to auto resize the WebContentsView when the main window resizes,
setBoundswill be frequently called and a series ofpage-favicon-updatedevent will be emitted, even if the favicon urls array is not changed.Testcase Gist URL
https://gist.github.com/z0gSh1u/72fe6f155e1f145385461853d7ef2782
Additional Information
Can be reproduced on macOS too.