aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface/lib.rs
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2020-02-15 23:32:09 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2020-02-15 23:51:26 +0530
commita5b43b7df10cc73d8203f7ee0c3a5e1a1bb1d9f5 (patch)
tree0ba50abb5a5386c66d9ffda1c297e96ee2aa778b /components/script_layout_interface/lib.rs
parent3475790fc23f939560f546901bf3082ebf20508a (diff)
downloadservo-a5b43b7df10cc73d8203f7ee0c3a5e1a1bb1d9f5.tar.gz
servo-a5b43b7df10cc73d8203f7ee0c3a5e1a1bb1d9f5.zip
Take origin from window instead of creating a new one in case of reflow
Everytime a new LayoutContext was created, it created a new origin which caused endless stream of image loads to occur in case of reflow. The reason for this was that the existing image, although cached successfully, was not used because the entry in hashmap did not match because of different(new) origin. This is solved by storing the origin of a window in enum ScriptReflow and used in creating new LayoutContext in case of reflow.
Diffstat (limited to 'components/script_layout_interface/lib.rs')
-rw-r--r--components/script_layout_interface/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script_layout_interface/lib.rs b/components/script_layout_interface/lib.rs
index ad333209033..ef9382378cb 100644
--- a/components/script_layout_interface/lib.rs
+++ b/components/script_layout_interface/lib.rs
@@ -23,7 +23,7 @@ use ipc_channel::ipc::IpcSender;
use libc::c_void;
use net_traits::image_cache::PendingImageId;
use script_traits::UntrustedNodeAddress;
-use servo_url::ServoUrl;
+use servo_url::{ImmutableOrigin, ServoUrl};
use std::ptr::NonNull;
use std::sync::atomic::AtomicIsize;
use style::data::ElementData;
@@ -138,6 +138,7 @@ pub struct PendingImage {
pub state: PendingImageState,
pub node: UntrustedNodeAddress,
pub id: PendingImageId,
+ pub origin: ImmutableOrigin,
}
pub struct HTMLMediaData {