Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notRestoredReasons to PerformanceNavigationTiming attribute #195

Merged
merged 13 commits into from Mar 4, 2024
11 changes: 11 additions & 0 deletions index.html
Expand Up @@ -372,6 +372,7 @@ <h3>
readonly attribute NavigationTimingType type;
readonly attribute unsigned short redirectCount;
readonly attribute DOMHighResTimeStamp criticalCHRestart;
readonly attribute NotRestoredReasons? notRestoredReasons;
[Default] object toJSON();
};
</pre>
Expand All @@ -393,6 +394,9 @@ <h3>
<p>A <a>PerformanceNavigationTiming</a> has an associated
{{DOMHighResTimeStamp}} <a data-dfn-for="PerformanceNavigationTiming"><dfn>`Critical-CH` restart time</dfn></a>.

<p>A <a>PerformanceNavigationTiming</a> has an associated
{{NotRestoredReasons}} <a data-dfn-for="PerformanceNavigationTiming"><dfn>not restored reasons</dfn></a>.

<p>A {{PerformanceNavigationTiming}} has an associated null or [=service worker timing info=]
<dfn data-dfn-for="PerformanceNavigationTiming">service worker timing</dfn>.
</p>
Expand Down Expand Up @@ -502,6 +506,9 @@ <h3>
the moment the redirection part of the navigation was restarted.
</p>
</div>
<p data-dfn-for='PerformanceNavigationTiming'>
The <dfn>notRestoredReasons</dfn> getter steps are to return |this|'s
<span>not restored reasons</span>.</p>
<p>
The <dfn>toJSON()</dfn> method runs the [=default toJSON steps=] for [=this=].
</p>
Expand Down Expand Up @@ -615,6 +622,10 @@ <h2>Creating a navigation timing entry</h2>
<li>Set |document|'s <span>navigation timing entry</span> to |navigationTimingEntry|.
<li>Set |navigationTimingEntry|'s <a data-for="PerformanceNavigationTiming">`Critical-CH` restart time</a>
to |criticalCHRestart|.
<li>If |document|'s [=Document/not restored reasons=] is not null, then set

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document's or document's state's? I guess those are the same thing, but oddly enough the HTML spec pr talks about them both.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this abstraction below in the HTML spec:

A document's not restored reasons is its node navigable's active session history entry's document state's not restored reasons, if document's node navigable is a top-level traversable; otherwise null.

The abstraction is to avoid having to refer to document's node navigable's active session history's entry's document state multiple times here.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why do we need the null check here. Not restored reasons should be initialized with some value. Either with null or valid reasons object.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I removed the null check.

|navigationTimingEntry|'s [=PerformanceNavigationTiming/not restored reasons=] to the
result of [=creating a NotRestoredReasons object=] given |document|'s
[=Document/not restored reasons=].</li>
<li>add |navigationTimingEntry| to |global|'s
<a data-cite='performance-timeline-2#dfn-performance-entry-buffer'>performance entry buffer</a>.
</ol>
Expand Down