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;
@@ -361,9 +363,30 @@ The {{PerformanceLongAnimationFrameTiming/blockingDuration}} attribute's getter The {{PerformanceLongAnimationFrameTiming/scripts}} attribute's getter steps are: 1. Let |scripts| be a [=/list=] « ». + 1. Let |entryWindow| be |this|'s [=relevant global object=]. 1. [=list/For each=] |scriptInfo| in [=this=]'s [=frame timing info=]'s [=frame timing info/scripts=]: + 1. Let |scriptWindow| be |scriptInfo|'s [=script timing info/window=]. 1. Let |scriptEntry| be a new {{PerformanceScriptTiming}} in [=this=]'s [=relevant realm=], - whose [=PerformanceScriptTiming/timing info=] is |scriptInfo|. + whose [=PerformanceScriptTiming/timing info=] is |scriptInfo| and whose [=PerformanceScriptTiming/window attribution=] is the value corresponding to the first matching statement: + + : |scriptWindow| is undefined + :: {{ScriptWindowAttribution/other}} + + : |scriptWindow| is |entryWindow| + :: {{ScriptWindowAttribution/self}} + + : |entryWindow|'s associated {{Document}}'s [=node navigable=]'s [=ancestor navigables=] [=list/contains=] |scriptWindow|'s associated {{Document}}'s [=node navigable=] + :: {{ScriptWindowAttribution/ancestor}} + + : |scriptWindow|'s associated {{Document}}'s [=node navigable=]'s [=ancestor navigables=] [=list/contains=] |entryWindow|'s associated {{Document}}'s [=node navigable=] + :: {{ScriptWindowAttribution/descendant}} + + : |entryWindow|'s associated {{Document}}'s [=node navigable=]'s [=navigable/top-level traversable=] is |scriptWindow|'s associated {{Document}}'s [=node navigable=]'s [=navigable/top-level traversable=] + :: {{ScriptWindowAttribution/same-page}} + + : Otherwise + :: {{ScriptWindowAttribution/other}}. + 1. [=list/Append=] |scriptEntry| to |scripts|. 1. Return |scripts|. @@ -380,6 +403,10 @@ The {{PerformanceLongAnimationFrameTiming/scripts}} attribute's getter steps are "reject-promise" }; + enum ScriptWindowAttribution { + "self", "descendant", "ancestor", "same-page", "other" + }; + [Exposed=Window] interface PerformanceScriptTiming : PerformanceEntry { /* Overloading PerformanceEntry */ @@ -391,12 +418,18 @@ The {{PerformanceLongAnimationFrameTiming/scripts}} attribute's getter steps are readonly attribute ScriptTimingType type; readonly attribute DOMHighResTimeStamp executionStart; readonly attribute DOMString sourceLocation; + readonly attribute DOMHighResTimeStamp pauseDuration; + readonly attribute DOMHighResTimeStamp forcedStyleAndLayoutDuration; + readonly attribute Window? window; + readonly attribute ScriptWindowAttribution windowAttribution; [Default] object toJSON(); };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.
+