servo/components/layout
bors-servo c9480c8e07
Auto merge of #23661 - julientregoat:i-21289, r=jdm
Refactor ImageCache::find_image_or_metadata -> ImageCache::{get_image, track_image}

<!-- Please describe your changes on the following line: -->
Updated the `ImageCache` trait to replace `find_image_or_metadata` with two new functions `track_image` and `get_image`, as well as a new enum (`ImageCacheResult`).

As a result, I was able to refactor the functions that previously called `find_image_or_metadata` pretty cleanly. For a list of these functions, please see the commit information.

---
<!-- 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
- [x] These changes fix #21289  (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because tests already exist for these components. I ran `cargo test` in `net`, `net_traits`, `layout`, and `script` successfully.

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23661)
<!-- Reviewable:end -->
2020-04-17 15:56:30 -04:00
..
display_list Some servo build fixes. 2020-04-16 18:29:30 +02:00
tests Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
animation.rs Avoid infinitely looping CSS transitions. 2020-04-01 12:13:52 -04:00
block.rs Rustfmt recent changes. 2019-12-16 14:23:56 +01:00
Cargo.toml Update ipc-channel and crossbeam-channel. 2020-02-20 11:15:13 -05:00
construct.rs Add a 'dom lifetime to GetLayoutData 2020-03-26 13:17:46 +01:00
context.rs Refactor ImageCache::find_image_or_metadata API. 2020-04-17 11:58:18 -04:00
data.rs Replace OpaqueStyleAndLayoutData by StyleAndOpaqueLayoutData 2020-04-06 23:06:13 +02:00
flex.rs Servo build fixes. 2019-12-16 14:23:56 +01:00
floats.rs style: Rename MozLength to Size, and MaxLength to MaxSize. 2019-02-12 02:28:00 +01:00
flow.rs Rustfmt recent changes. 2019-12-16 14:23:56 +01:00
flow_list.rs Some further removals 2019-05-30 20:27:19 +02:00
flow_ref.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
fragment.rs Add a 'dom lifetime to GetLayoutData 2020-03-26 13:17:46 +01:00
generated_content.rs Fix Servo build and unify display representation. 2019-08-15 17:11:08 +02:00
incremental.rs Remove LayoutDamageComputation 2019-01-14 16:10:26 +01:00
inline.rs Servo build fixes. 2019-12-16 14:23:56 +01:00
layout_debug.rs Fix deprecation warnings 2019-01-28 11:32:40 +01:00
lib.rs Upgrade to rustc 1.42.0-nightly (3291ae339 2020-01-15) 2020-01-16 08:46:41 +01:00
linked_list.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
list_item.rs Update euclid. 2019-07-23 23:09:55 +02:00
model.rs Servo build fixes. 2019-12-16 14:23:56 +01:00
multicol.rs Servo build fixes. 2019-12-16 14:23:56 +01:00
opaque_node.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
parallel.rs Update rayon to dedupe crossbeam-epoch 2019-07-12 21:01:33 +02:00
persistent_list.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
query.rs Don't go through the layout thread to retrieve a node's primary style 2020-04-07 14:34:47 +02:00
sequential.rs Update euclid. 2019-07-23 23:09:55 +02:00
table.rs style: Miscellaneous Servo build fixes. 2020-02-12 02:43:23 +01:00
table_caption.rs Update euclid. 2019-07-23 23:09:55 +02:00
table_cell.rs Add a 'dom lifetime to GetLayoutData 2020-03-26 13:17:46 +01:00
table_colgroup.rs Servo build fixes. 2019-12-16 14:23:56 +01:00
table_row.rs style: Miscellaneous Servo build fixes. 2020-02-12 02:43:23 +01:00
table_rowgroup.rs Update euclid. 2019-07-23 23:09:55 +02:00
table_wrapper.rs Update euclid. 2019-07-23 23:09:55 +02:00
text.rs layout: Resolve word_spacing ahead of time. 2020-02-12 02:43:23 +01:00
traversal.rs Rename a bunch of style/layout data items 2020-04-06 12:39:52 +02:00
wrapper.rs Replace OpaqueStyleAndLayoutData by StyleAndOpaqueLayoutData 2020-04-06 23:06:13 +02:00