mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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.
This commit is contained in:
parent
3475790fc2
commit
a5b43b7df1
5 changed files with 20 additions and 6 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue