mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #26407 - mrobinson:animation-restyle-model, r=jdm
Have animations more closely match the HTML spec These two commits do two major things: **Have animations ticks trigger a restyle**: This corrects synchronization issues with animations, where the values used in layout are out of sync with what is returned by `getComputedStyle`. **Tick the animation timer in script according to spec**: This greatly reduces the flakiness of animation and transitions tests. Fixes #13865. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #13865 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
b290ad95c1
76 changed files with 1389 additions and 3701 deletions
|
@ -7,8 +7,7 @@ use immeta::load_from_buf;
|
|||
use ipc_channel::ipc::IpcSender;
|
||||
use net_traits::image::base::{load_from_memory, Image, ImageMetadata};
|
||||
use net_traits::image_cache::{
|
||||
CanRequestImages, CorsStatus, ImageCache, ImageCacheResult, ImageResponder,
|
||||
PendingImageResponse,
|
||||
CorsStatus, ImageCache, ImageCacheResult, ImageResponder, PendingImageResponse,
|
||||
};
|
||||
use net_traits::image_cache::{ImageOrMetadataAvailable, ImageResponse};
|
||||
use net_traits::image_cache::{PendingImageId, UsePlaceholder};
|
||||
|
@ -147,7 +146,6 @@ impl AllPendingLoads {
|
|||
url: ServoUrl,
|
||||
origin: ImmutableOrigin,
|
||||
cors_status: Option<CorsSettings>,
|
||||
can_request: CanRequestImages,
|
||||
) -> CacheResult<'a> {
|
||||
match self
|
||||
.url_to_load_key
|
||||
|
@ -158,10 +156,6 @@ impl AllPendingLoads {
|
|||
CacheResult::Hit(*load_key, self.loads.get_mut(load_key).unwrap())
|
||||
},
|
||||
Vacant(url_entry) => {
|
||||
if can_request == CanRequestImages::No {
|
||||
return CacheResult::Miss(None);
|
||||
}
|
||||
|
||||
let load_key = self.keygen.next();
|
||||
url_entry.insert(load_key);
|
||||
|
||||
|
@ -461,7 +455,6 @@ impl ImageCache for ImageCacheImpl {
|
|||
origin: ImmutableOrigin,
|
||||
cors_setting: Option<CorsSettings>,
|
||||
use_placeholder: UsePlaceholder,
|
||||
can_request: CanRequestImages,
|
||||
) -> ImageCacheResult {
|
||||
let mut store = self.store.lock().unwrap();
|
||||
if let Some(result) = store.get_completed_image_if_available(
|
||||
|
@ -485,12 +478,9 @@ impl ImageCache for ImageCacheImpl {
|
|||
}
|
||||
|
||||
let decoded = {
|
||||
let result = store.pending_loads.get_cached(
|
||||
url.clone(),
|
||||
origin.clone(),
|
||||
cors_setting,
|
||||
can_request,
|
||||
);
|
||||
let result = store
|
||||
.pending_loads
|
||||
.get_cached(url.clone(), origin.clone(), cors_setting);
|
||||
match result {
|
||||
CacheResult::Hit(key, pl) => match (&pl.result, &pl.metadata) {
|
||||
(&Some(Ok(_)), _) => {
|
||||
|
@ -539,7 +529,6 @@ impl ImageCache for ImageCacheImpl {
|
|||
cors_setting: Option<CorsSettings>,
|
||||
sender: IpcSender<PendingImageResponse>,
|
||||
use_placeholder: UsePlaceholder,
|
||||
can_request: CanRequestImages,
|
||||
) -> ImageCacheResult {
|
||||
debug!("Track image for {} ({:?})", url, origin);
|
||||
let cache_result = self.get_cached_image_status(
|
||||
|
@ -547,7 +536,6 @@ impl ImageCache for ImageCacheImpl {
|
|||
origin.clone(),
|
||||
cors_setting,
|
||||
use_placeholder,
|
||||
can_request,
|
||||
);
|
||||
|
||||
match cache_result {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue