servo/components/layout_2020
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
flow Remove use of some other unstable features 2020-04-15 15:17:52 +02:00
Cargo.toml Update atomic_refcell 2020-03-17 11:15:17 -07:00
cell.rs Implement Default for ArcRefCell 2020-03-17 11:15:17 -07: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
dom_traversal.rs Rename a bunch of style/layout data items 2020-04-06 12:39:52 +02:00
element_data.rs Switch some uses of Arc<AtomicRefCell<T>> over to ArcRefCell<T> 2020-03-17 11:15:17 -07:00
formatting_contexts.rs Propagate text decoration where needed 2020-03-23 11:13:10 +01:00
fragments.rs layout_2020: Use ArcRefCell to track hoisted fragments 2020-03-27 13:02:22 +01:00
geom.rs Less cloning 2020-04-01 01:00:14 +02:00
layout_debug.rs Minor improvements to layout_debug and associated code 2020-02-21 16:34:32 +01:00
lib.rs Remove use of some other unstable features 2020-04-15 15:17:52 +02:00
opaque_node.rs Remove layout_2020::display_list, use WebRender display lists instead 2019-09-07 19:38:44 +02:00
positioned.rs Remove use of some other unstable features 2020-04-15 15:17:52 +02: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
replaced.rs Don't send empty canvases to WebRender 2020-04-03 11:34:04 -04:00
sizing.rs Less cloning 2020-04-01 01:00:14 +02:00
style_ext.rs Less cloning 2020-04-01 01:00:14 +02:00
traversal.rs Remove postorder traversal from layout 2020 during styling 2020-04-06 12:40:05 +02:00
wrapper.rs Replace OpaqueStyleAndLayoutData by StyleAndOpaqueLayoutData 2020-04-06 23:06:13 +02:00