aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-10-31 22:49:27 -0400
committerGitHub <noreply@github.com>2019-10-31 22:49:27 -0400
commita355f41c9f0e28e47170b0c9ef7c5f2a95496094 (patch)
tree0eca4e12e107a86f3a87da9050c9e90a16753661 /components/script
parent65bcf633eae13b840f7d98805311455337b495a5 (diff)
parent72702b728470c409a9b6082c50e7ad5be98f9728 (diff)
downloadservo-a355f41c9f0e28e47170b0c9ef7c5f2a95496094.tar.gz
servo-a355f41c9f0e28e47170b0c9ef7c5f2a95496094.zip
Auto merge of #24584 - JoshMcguigan:perf-resource-timing-duration, r=jdm
implement PerformanceResourceTiming duration <!-- Please describe your changes on the following line: --> Implements #21255 I wanted to give this a shot, but I'm not sure this is the appropriate implementation. In particular, I'm not sure if adding duration to the webidl interface is correct, because that doesn't seem to align with the web version (linked above the interface)? Also, I'd like to write a test for this method, but I'm not sure where that test should go. My apologies if this is way off target. --- <!-- 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 #21255 (GitHub issue number if applicable) <!-- Either: --> - [ ] 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. -->
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/performanceresourcetiming.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/script/dom/performanceresourcetiming.rs b/components/script/dom/performanceresourcetiming.rs
index 735d13a31f4..586515d4365 100644
--- a/components/script/dom/performanceresourcetiming.rs
+++ b/components/script/dom/performanceresourcetiming.rs
@@ -55,7 +55,6 @@ pub struct PerformanceResourceTiming {
decoded_body_size: u64, //size in octets
}
-// TODO(#21255): duration
// TODO(#21269): next_hop
// TODO(#21264): worker_start
// TODO(#21258): fetch_start
@@ -115,7 +114,7 @@ impl PerformanceResourceTiming {
DOMString::from(url.into_string()),
DOMString::from("resource"),
resource_timing.start_time as f64,
- 0.,
+ resource_timing.response_end as f64 - resource_timing.start_time as f64,
),
initiator_type: initiator_type,
next_hop: next_hop,