mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Add PerformanceResourceTiming: domainLookupStart
Remove wpt tests for domainLookupStart Set ResourceAttribute::DomainLookupTime Move DomainLookupStart timing before HTTP request initialization Change label of domainLookupStart TAO zero test to PASS Adjust the from_resource_timing method to initialize domain_lookup_start value Restore domainLookupsStart test
This commit is contained in:
parent
84786add22
commit
d84513cc50
6 changed files with 20 additions and 15 deletions
|
@ -378,6 +378,12 @@ fn obtain_response(
|
|||
},
|
||||
}
|
||||
|
||||
context
|
||||
.timing
|
||||
.lock()
|
||||
.unwrap()
|
||||
.set_attribute(ResourceAttribute::DomainLookupStart);
|
||||
|
||||
// TODO(#21261) connect_start: set if a persistent connection is *not* used and the last non-redirected
|
||||
// fetch passes the timing allow check
|
||||
let connect_start = precise_time_ms();
|
||||
|
|
|
@ -441,6 +441,7 @@ pub struct ResourceCorsData {
|
|||
|
||||
#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
|
||||
pub struct ResourceFetchTiming {
|
||||
pub domain_lookup_start: u64,
|
||||
pub timing_type: ResourceTimingType,
|
||||
/// Number of redirects until final resource (currently limited to 20)
|
||||
pub redirect_count: u16,
|
||||
|
@ -462,6 +463,7 @@ pub enum RedirectStartValue {
|
|||
|
||||
pub enum ResourceAttribute {
|
||||
RedirectCount(u16),
|
||||
DomainLookupStart,
|
||||
RequestStart,
|
||||
ResponseStart,
|
||||
RedirectStart(RedirectStartValue),
|
||||
|
@ -483,6 +485,7 @@ impl ResourceFetchTiming {
|
|||
pub fn new(timing_type: ResourceTimingType) -> ResourceFetchTiming {
|
||||
ResourceFetchTiming {
|
||||
timing_type: timing_type,
|
||||
domain_lookup_start: 0,
|
||||
redirect_count: 0,
|
||||
request_start: 0,
|
||||
response_start: 0,
|
||||
|
@ -498,6 +501,7 @@ impl ResourceFetchTiming {
|
|||
// time origin (as described in Performance::now)
|
||||
pub fn set_attribute(&mut self, attribute: ResourceAttribute) {
|
||||
match attribute {
|
||||
ResourceAttribute::DomainLookupStart => self.domain_lookup_start = precise_time_ns(),
|
||||
ResourceAttribute::RedirectCount(count) => self.redirect_count = count,
|
||||
ResourceAttribute::RequestStart => self.request_start = precise_time_ns(),
|
||||
ResourceAttribute::ResponseStart => self.response_start = precise_time_ns(),
|
||||
|
|
|
@ -86,8 +86,8 @@ impl PerformanceResourceTiming {
|
|||
redirect_start: 0.,
|
||||
redirect_end: 0.,
|
||||
fetch_start: fetch_start,
|
||||
domain_lookup_start: 0.,
|
||||
domain_lookup_end: 0.,
|
||||
domain_lookup_start: 0.,
|
||||
connect_start: 0.,
|
||||
connect_end: 0.,
|
||||
secure_connection_start: 0.,
|
||||
|
@ -118,7 +118,7 @@ impl PerformanceResourceTiming {
|
|||
redirect_start: resource_timing.redirect_start as f64,
|
||||
redirect_end: 0.,
|
||||
fetch_start: resource_timing.fetch_start as f64,
|
||||
domain_lookup_start: 0.,
|
||||
domain_lookup_start: resource_timing.domain_lookup_start as f64,
|
||||
domain_lookup_end: 0.,
|
||||
connect_start: resource_timing.connect_start as f64,
|
||||
connect_end: resource_timing.connect_end as f64,
|
||||
|
@ -172,6 +172,11 @@ impl PerformanceResourceTimingMethods for PerformanceResourceTiming {
|
|||
}
|
||||
}
|
||||
|
||||
// https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-domainlookupstart
|
||||
fn DomainLookupStart(&self) -> DOMHighResTimeStamp {
|
||||
Finite::wrap(self.domain_lookup_start)
|
||||
}
|
||||
|
||||
// https://w3c.github.io/resource-timing/#dom-performanceresourcetiming-requeststart
|
||||
fn RequestStart(&self) -> DOMHighResTimeStamp {
|
||||
Finite::wrap(self.request_start)
|
||||
|
|
|
@ -15,7 +15,7 @@ interface PerformanceResourceTiming : PerformanceEntry {
|
|||
readonly attribute DOMHighResTimeStamp redirectStart;
|
||||
// readonly attribute DOMHighResTimeStamp redirectEnd;
|
||||
readonly attribute DOMHighResTimeStamp fetchStart;
|
||||
// readonly attribute DOMHighResTimeStamp domainLookupStart;
|
||||
readonly attribute DOMHighResTimeStamp domainLookupStart;
|
||||
// readonly attribute DOMHighResTimeStamp domainLookupEnd;
|
||||
readonly attribute DOMHighResTimeStamp connectStart;
|
||||
readonly attribute DOMHighResTimeStamp connectEnd;
|
||||
|
|
|
@ -41,15 +41,9 @@
|
|||
[PerformanceResourceTiming interface: resource must inherit property "secureConnectionStart" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[PerformanceResourceTiming interface: resource must inherit property "domainLookupStart" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[PerformanceResourceTiming interface: attribute workerStart]
|
||||
expected: FAIL
|
||||
|
||||
[PerformanceResourceTiming interface: attribute domainLookupStart]
|
||||
expected: FAIL
|
||||
|
||||
[PerformanceResourceTiming interface: resource must inherit property "redirectEnd" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -115,9 +109,6 @@
|
|||
[PerformanceResourceTiming interface: attribute workerStart]
|
||||
expected: FAIL
|
||||
|
||||
[PerformanceResourceTiming interface: attribute domainLookupStart]
|
||||
expected: FAIL
|
||||
|
||||
[PerformanceResourceTiming interface: attribute redirectEnd]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -2,14 +2,13 @@
|
|||
[secureConnectionStart should be 0 in cross-origin request.]
|
||||
expected: FAIL
|
||||
|
||||
[domainLookupStart should be 0 in cross-origin request.]
|
||||
expected: FAIL
|
||||
|
||||
[domainLookupEnd should be 0 in cross-origin request.]
|
||||
expected: FAIL
|
||||
|
||||
[redirectEnd should be 0 in cross-origin request.]
|
||||
expected: FAIL
|
||||
[domainLookupStart should be 0 in cross-origin request.]
|
||||
expected: PASS
|
||||
|
||||
[connectEnd should be 0 in cross-origin request.]
|
||||
expected: FAIL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue