diff --git a/index.bs b/index.bs index 19a1a1e..566a6d4 100644 --- a/index.bs +++ b/index.bs @@ -62,6 +62,8 @@ urlPrefix: https://dom.spec.whatwg.org/; spec: DOM; urlPrefix: https://webidl.spec.whatwg.org/; spec: WEBIDL; type: dfn; text: identifier; url: #dfn-identifier; type: dfn; text: attribute; url: #dfn-attribute; +urlPrefix: https://tc39.es/ecma262/multipage/managing-memory.html + type: dfn; text: weakrefderef; url: #sec-weakrefderef; A {{PerformanceScriptTiming}} has an associated [=script timing info=] timing info. +A {{PerformanceScriptTiming}} has an associated {{ScriptWindowAttribution}} window attribution. + The {{PerformanceScriptTiming/entryType}} attribute's getter step is to return "script". The {{PerformanceScriptTiming/type}} attribute's getter step is to return [=this=]'s [=PerformanceScriptTiming/timing info=]'s [=script timing info/type=]. @@ -438,6 +471,12 @@ The {{PerformanceScriptTiming/duration}} attribute's getter step is to return th The {{PerformanceScriptTiming/executionStart}} attribute's getter step is to return 0 if [=this=]'s [=PerformanceScriptTiming/timing info=]'s [=script timing info/execution start time=] is 0; Otherwise the [=relative high resolution time=] given [=this=]'s [=PerformanceScriptTiming/timing info=]'s [=script timing info/execution start time=] and [=this=]'s [=relevant global object=]. +The {{PerformanceScriptTiming/forcedStyleAndLayoutDuration}} attribute's getter step is to return an [=implementation-defined=] value that represents time spent performing style and layout synchronously, e.g. by calling {{Window/getComputedStyle()}} or {{Element/getBoundingClientRect()}}. + + Issue: Find a way to make this interoperable/normative. Perhaps mark those functions in WebIDL as requiring synchronous style/layout? Also move to [=PerformanceScriptTiming/timing info=] once that's resolved. + +The {{PerformanceScriptTiming/pauseDuration}} attribute's getter step is to return [=this=]'s [=PerformanceScriptTiming/timing info=]'s [=script timing info/pause duration=]. + The {{PerformanceScriptTiming/sourceLocation}} attribute's getter steps are: 1. If [=this=]'s [=PerformanceScriptTiming/timing info=]'s [=script timing info/source url=] is the empty string, return the empty string. 1. Let |serializedSourceLocation| be [=this=]'s [=PerformanceScriptTiming/timing info=]'s [=script timing info/source url=]. @@ -447,6 +486,12 @@ The {{PerformanceScriptTiming/sourceLocation}} attribute's getter steps are: set |serializedSourceLocation| to the [=concatenate|concatenation=] of «|serializedSourceLocation|, ":", [=this=]'s [=PerformanceScriptTiming/timing info=]'s [=script timing info/source character position=] ». 1. Return |serializedSourceLocation|. +The {{PerformanceScriptTiming/window}} attribute's getter steps are: + 1. Let |window| be the result of calling [=weakrefderef|deref=] on [=this=]'s [=PerformanceScriptTiming/timing info=]'s [=script timing info/window=]. + 1. If |window| is undefined, then return null; Otherwise return |window|. + +The {{PerformanceScriptTiming/windowAttribution}} attribute's getter step is to return [=this=]'s [=PerformanceScriptTiming/window attribution=]. + Processing model {#sec-processing-model} ======================================== @@ -599,6 +644,9 @@ It has the following [=struct/items=]: : execution start time :: An unsafe {{DOMHighResTimeStamp}}, initially 0. + : pause duration + :: A {{DOMHighResTimeStamp}} representing a number of milliseconds, initially 0. + : invoker name : source url : source function name @@ -609,6 +657,9 @@ It has the following [=struct/items=]: : source character position :: A number, initially -1. + + : window + :: A {{WeakRef}} to a {{Window}}. A {{Document}} has a null or [=frame timing info=] current frame timing info, initially null. @@ -799,6 +850,7 @@ Report Long Animation Frames {#loaf-processing-model} whose [=script timing info/start time=] is the [=unsafe shared current time=], and whose [=script timing info/type=] is |type|. 1. Run |steps| given |scriptTimingInfo| and |frameTimingInfo|. + 1. Set |scriptTimingInfo|'s [=script timing info/window=] to |settings|. 1. Set |frameTimingInfo|'s [=frame timing info/pending script=] to |scriptTimingInfo|. @@ -829,6 +881,19 @@ Report Long Animation Frames {#loaf-processing-model} 1. The user agent may set |scriptTimingInfo|'s [=script timing info/source character position=] to the character position where |callback| was defined. +
+ To report pause duration given a [=duration=] |duration|: + 1. Let |script| be the [=running script=]. + 1. Let |settings| be |script|'s [=script/settings object=]. + 1. If |settings| is not a {{Window}}, then return. + 1. Let |document| be |settings|'s {{Window/document}}. + 1. If |document| is not [=fully active=] or {{Document/hidden}}, then return. + 1. Let |frameTimingInfo| be |document|'s [=relevant frame timing info=]. + 1. If |frameTimingInfo| is null, then return. + 1. If |frameTimingInfo|'s [=frame timing info/pending script=] is null, then return. + 1. Increment |frameTimingInfo|'s [=frame timing info/pending script=]'s [=script timing info/pause duration=] by the milliseconds value of |duration|. +
+ Additions to existing standards {#other-standards} ================================================== @@ -928,7 +993,14 @@ Monkey-patches to the HTML standard {#html-monkey-patches}
Append the following step to perform a microtask checkpoint: [=Flush script entry point=]. +
+ +
+ Add the following steps to pause: + + Prepend the following step: Let |timeBeforePause| be the [=monotonic clock/unsafe current time=]. + Append the following step: [=Report pause duration=] given the [=duration=] between |timeBeforePause| and the [=monotonic clock/unsafe current time=].
Security & privacy considerations {#priv-sec}