diff options
author | Josh Matthews <josh@joshmatthews.net> | 2025-04-19 02:09:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-19 06:09:03 +0000 |
commit | 3ab5b8c4472129798b63cfb40b63ae672763b653 (patch) | |
tree | 1702e217a31111600f411ecedb8b4a21bb8c569e /components/script/dom/websocket.rs | |
parent | c486c6f058ef9ac63e02fd42235e96db64744221 (diff) | |
download | servo-3ab5b8c4472129798b63cfb40b63ae672763b653.tar.gz servo-3ab5b8c4472129798b63cfb40b63ae672763b653.zip |
script: Only register one image callback per CSS image in use. (#36612)
When layout encounters a CSS image, the script thread is responsible for
fetching the image from the image cache. When the image is not yet
available, the script thread creates image cache listeners to perform
actions in response to future updates from the image cache.
In the current implementation, a cache listener would iterate over all
nodes using a particular image and mark them as dirty. However, we
mistakenly added one cache listener per node, leading to n^2 runtime
while performing lots of redundant work. For cases like #36480 with over
1000 elements using the same image, this led to a completely
unresponsive script thread.
Testing: Manual testing on the provided testcase, and a new WPT test
that times out without this PR's changes.
Fixes: #36480
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script/dom/websocket.rs')
0 files changed, 0 insertions, 0 deletions