Skip to content

Commit

Permalink
Synchronize the WebILD definition
Browse files Browse the repository at this point in the history
  • Loading branch information
plehegar committed Sep 25, 2017
1 parent fbfb057 commit 8963e7a
Showing 1 changed file with 70 additions and 39 deletions.
109 changes: 70 additions & 39 deletions navigation-timing/idlharness.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,75 @@ <h1>Navigation Timing IDL tests</h1>
<div id="log"></div>

<pre id='untested_idl' style='display:none'>
typedef double DOMHighResTimeStamp;

[PrimaryGlobal]
interface Window {
[Replaceable]
readonly attribute Performance performance;
};

callback interface EventListener {
void handleEvent(Event event);
[Exposed=(Window,Worker)]
interface Performance {
};

interface Event {
// PhaseType
const unsigned short NONE = 0;
const unsigned short CAPTURING_PHASE = 1;
const unsigned short AT_TARGET = 2;
const unsigned short BUBBLING_PHASE = 3;
readonly attribute DOMString type;
readonly attribute EventTarget? target;
readonly attribute EventTarget? currentTarget;
readonly attribute unsigned short eventPhase;
readonly attribute boolean bubbles;
readonly attribute boolean cancelable;
readonly attribute DOMTimeStamp timeStamp;
void stopPropagation ();
void preventDefault ();
void initEvent (DOMString eventTypeArg, boolean bubblesArg, boolean cancelableArg);
// Introduced in DOM Level 3
void stopImmediatePropagation ();
readonly attribute boolean defaultPrevented;
readonly attribute boolean isTrusted;
[Exposed=(Window,Worker)]
interface PerformanceEntry {
readonly attribute DOMString name;
readonly attribute DOMString entryType;
readonly attribute DOMHighResTimeStamp startTime;
readonly attribute DOMHighResTimeStamp duration;
[Default] object toJSON();
};

[Exposed=(Window,Worker)]
interface PerformanceResourceTiming : PerformanceEntry {
readonly attribute DOMString initiatorType;
readonly attribute DOMString nextHopProtocol;
readonly attribute DOMHighResTimeStamp workerStart;
readonly attribute DOMHighResTimeStamp redirectStart;
readonly attribute DOMHighResTimeStamp redirectEnd;
readonly attribute DOMHighResTimeStamp fetchStart;
readonly attribute DOMHighResTimeStamp domainLookupStart;
readonly attribute DOMHighResTimeStamp domainLookupEnd;
readonly attribute DOMHighResTimeStamp connectStart;
readonly attribute DOMHighResTimeStamp connectEnd;
readonly attribute DOMHighResTimeStamp secureConnectionStart;
readonly attribute DOMHighResTimeStamp requestStart;
readonly attribute DOMHighResTimeStamp responseStart;
readonly attribute DOMHighResTimeStamp responseEnd;
readonly attribute unsigned long long transferSize;
readonly attribute unsigned long long encodedBodySize;
readonly attribute unsigned long long decodedBodySize;
[Default] object toJSON();
};
</pre>

<pre id='idl'>

[Exposed=Window]
interface PerformanceNavigationTiming : PerformanceResourceTiming {
readonly attribute DOMHighResTimeStamp unloadEventStart;
readonly attribute DOMHighResTimeStamp unloadEventEnd;
readonly attribute DOMHighResTimeStamp domInteractive;
readonly attribute DOMHighResTimeStamp domContentLoadedEventStart;
readonly attribute DOMHighResTimeStamp domContentLoadedEventEnd;
readonly attribute DOMHighResTimeStamp domComplete;
readonly attribute DOMHighResTimeStamp loadEventStart;
readonly attribute DOMHighResTimeStamp loadEventEnd;
readonly attribute NavigationType type;
readonly attribute unsigned short redirectCount;
[Default] object toJSON();
};

interface EventTarget {
// Modified in DOM Level 3
void addEventListener (DOMString type, EventListener? listener, optional boolean useCapture = false);
void removeEventListener (DOMString type, EventListener? listener, optional boolean useCapture = false);
boolean dispatchEvent (Event event);
enum NavigationType {
"navigate",
"reload",
"back_forward",
"prerender"
};

</pre>

<pre id='idl'>
[Exposed=Window]
interface PerformanceTiming {
readonly attribute unsigned long long navigationStart;
readonly attribute unsigned long long unloadEventStart;
Expand All @@ -80,25 +108,29 @@ <h1>Navigation Timing IDL tests</h1>
readonly attribute unsigned long long domComplete;
readonly attribute unsigned long long loadEventStart;
readonly attribute unsigned long long loadEventEnd;
[Default] object toJSON();
};


[Exposed=Window]
interface PerformanceNavigation {
const unsigned short TYPE_NAVIGATE = 0;
const unsigned short TYPE_RELOAD = 1;
const unsigned short TYPE_BACK_FORWARD = 2;
const unsigned short TYPE_RESERVED = 255;
readonly attribute unsigned short type;
readonly attribute unsigned short redirectCount;
[Default] object toJSON();
};

interface Performance : EventTarget {

// [Exposed=Window]
partial interface Performance {
[SameObject]
readonly attribute PerformanceTiming timing;
[SameObject]
readonly attribute PerformanceNavigation navigation;
};

partial interface Window {
[Replaceable] readonly attribute Performance performance;
};
</pre>

<script>
Expand All @@ -108,10 +140,9 @@ <h1>Navigation Timing IDL tests</h1>
idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
idl_array.add_idls(document.getElementById("idl").textContent);

idl_array.add_objects({Window: ["window"],
Performance: ["window.performance"],
PerformanceNavigation: ["window.performance.navigation"],
PerformanceTiming: ["window.performance.timing"]});
idl_array.add_objects({PerformanceNavigation: ["window.performance.navigation"],
PerformanceTiming: ["window.performance.timing"],
PerformanceNavigationTiming: ["window.performance.getEntriesByType('navigation')[0]"] });

idl_array.test();
})();
Expand Down

0 comments on commit 8963e7a

Please sign in to comment.