diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-04-23 16:49:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-23 16:49:12 -0400 |
commit | 03b005c7b28fe887ff97e109392ecf2983e6f8c0 (patch) | |
tree | 21b77a9fc29382aafb7779fb253d1a198a592902 /components/script/dom | |
parent | 4c8d29f5a7fb457cee3144b708c9e51142c2779a (diff) | |
parent | fdbec9835cfbde0b09c9f1f8594dce81af73c1ff (diff) | |
download | servo-03b005c7b28fe887ff97e109392ecf2983e6f8c0.tar.gz servo-03b005c7b28fe887ff97e109392ecf2983e6f8c0.zip |
Auto merge of #23178 - tdelacour:ISSUE-21263, r=jdm
Add PerformanceResourceTiming: ResponseEnd
<!-- Please describe your changes on the following line: -->
1. Added `ResponseEnd` to `ResourceAttribute` enum in `net_traits` and added it to the `set_attribute` function on `ResourceFetchTiming`
2. Added `response_end` field to `performanceresourcetiming.rs`
3. In `http_loader.rs`, set ResponseEnd after response body read is complete, or before return due to network error.
I could use a little guidance on testing. After building and running `wpt` tests, I noticed that some tests now "Pass" when they were expected to "Fail". As per the wiki instructions, I've removed those expectations from the `metadata`.
I noticed that there are a handful of other "failing" test expectations associated with `responseEnd`, but those still do not pass. I looked through some similar PRs (`connectEnd`, `redirectStart`, etc) and saw that they also still have a few failing test expectations here and there. Does that mean this is OK for now? How can I better understand which tests we expect to resolve for a given issue? Thanks!
---
<!-- 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 #21263 (GitHub issue number if applicable)
<!-- 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. -->
<!-- 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/23178)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/performanceresourcetiming.rs | 10 | ||||
-rw-r--r-- | components/script/dom/webidls/PerformanceResourceTiming.webidl | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/components/script/dom/performanceresourcetiming.rs b/components/script/dom/performanceresourcetiming.rs index 4fd7c38f1b9..9726f2c04e4 100644 --- a/components/script/dom/performanceresourcetiming.rs +++ b/components/script/dom/performanceresourcetiming.rs @@ -66,7 +66,6 @@ pub struct PerformanceResourceTiming { // TODO(#21260): domain_lookup_end // TODO(#21261): connect_start // TODO(#21262): connect_end -// TODO(#21263): response_end impl PerformanceResourceTiming { pub fn new_inherited( url: ServoUrl, @@ -126,7 +125,7 @@ impl PerformanceResourceTiming { secure_connection_start: 0., request_start: resource_timing.request_start as f64, response_start: resource_timing.response_start as f64, - response_end: 0., + response_end: resource_timing.response_end as f64, } } @@ -175,7 +174,6 @@ impl PerformanceResourceTimingMethods for PerformanceResourceTiming { // https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-requeststart fn RequestStart(&self) -> DOMHighResTimeStamp { - // TODO Finite::wrap(self.request_start) } @@ -186,7 +184,6 @@ impl PerformanceResourceTimingMethods for PerformanceResourceTiming { // https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-responsestart fn ResponseStart(&self) -> DOMHighResTimeStamp { - // TODO Finite::wrap(self.response_start) } @@ -199,4 +196,9 @@ impl PerformanceResourceTimingMethods for PerformanceResourceTiming { fn ConnectEnd(&self) -> DOMHighResTimeStamp { Finite::wrap(self.connect_end) } + + // https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-responseend + fn ResponseEnd(&self) -> DOMHighResTimeStamp { + Finite::wrap(self.response_end) + } } diff --git a/components/script/dom/webidls/PerformanceResourceTiming.webidl b/components/script/dom/webidls/PerformanceResourceTiming.webidl index df4bb747908..9fdd9c845da 100644 --- a/components/script/dom/webidls/PerformanceResourceTiming.webidl +++ b/components/script/dom/webidls/PerformanceResourceTiming.webidl @@ -22,7 +22,7 @@ interface PerformanceResourceTiming : PerformanceEntry { // readonly attribute DOMHighResTimeStamp secureConnectionStart; readonly attribute DOMHighResTimeStamp requestStart; readonly attribute DOMHighResTimeStamp responseStart; - // readonly attribute DOMHighResTimeStamp responseEnd; + readonly attribute DOMHighResTimeStamp responseEnd; /// readonly attribute unsigned long long transferSize; /// readonly attribute unsigned long long encodedBodySize; /// readonly attribute unsigned long long decodedBodySize; |