Skip to content

Improvements to Soft Navigation docs - #45324

Merged
chrisdavidmills merged 13 commits into
mdn:mainfrom
tunetheweb:navigationid
Aug 28, 2026
Merged

chrisdavidmills merged 13 commits into
mdn:mainfrom
tunetheweb:navigationid

Conversation

@tunetheweb

Copy link
Copy Markdown
Contributor

Description

This is some tweaks to the docs added in #45053 as @Elchi3 spotted some issues when reviewing the BCD changes.

  • Add's toJSON methods. Note that PerformanceSoftNavigation's toJSON() exists in Chrome's implementation but was missing from the spec (just added in Specify [Default] object toJSON() for PerformanceSoftNavigation and InteractionContentfulPaint WICG/soft-navigations#91) so is not yet in BCD.
  • Removed navigationId from InteractionContentfulPaint and PerformanceSoftNavigation and added it to PerformanceEntry instead as it's an inherited property.
  • Added to more docs.
  • Marked where Performance APIs and properties were experimental.
  • Added to the Performance SVG diagram and rejigged it a bit to correct some things. Not I also added the upcoming PerformanceContainerTiming while in there even though it's not yet documented elsewhere on MDN. Will add that to my todo list.

Motivation

Correct docs.

Additional details

Related issues and pull requests

Related PRs:

@tunetheweb
tunetheweb requested review from a team as code owners August 26, 2026 15:00
@tunetheweb
tunetheweb requested review from hamishwillee and pepelsbey and removed request for a team August 26, 2026 15:00
@github-actions github-actions Bot added Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels Aug 26, 2026
@tunetheweb

Copy link
Copy Markdown
Contributor Author

@chrisdavidmills I know I'm throwing a lot your way at the moment, but if you get a chance could you review since you have the context from #45053

@chrisdavidmills
chrisdavidmills self-requested a review August 26, 2026 16:11
@github-actions

github-actions Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A lot of good work here, @tunetheweb. I've looked through it all, and made some suggestions.

Comment thread files/en-us/web/api/interactioncontentfulpaint/index.md Outdated
Comment thread files/en-us/web/api/interactioncontentfulpaint/index.md Outdated
Comment thread files/en-us/web/api/largestcontentfulpaint/index.md
Comment thread files/en-us/web/api/performance_api/index.md Outdated
Comment thread files/en-us/web/api/performanceentry/navigationid/index.md Outdated
Comment thread files/en-us/web/api/performanceentry/index.md
Comment thread files/en-us/web/api/performanceentry/index.md Outdated
Comment thread files/en-us/web/api/performancesoftnavigation/index.md Outdated
Comment thread files/jsondata/InterfaceData.json

@chrisdavidmills chrisdavidmills left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@tunetheweb sorry to be a pain, but...

## Instance methods

This interface overrides the following {{domxref("PerformanceEntry")}} method to include the additional properties:
This interface overrides the following {{domxref("PerformanceEntry")}} method to include the additional properties added in this interface:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm sorry about this, but after reading this again, it struck me that I am confused as to what this is trying to day. Can you clarify?

So we are saying that the interface this page covers overrides the toJSON() method to include the properties listed in the "Instance properties" section of this page? What does it mean for a method to include properties? Am I misunderstanding what this is saying?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So if it just inherited toJSON() from PerformanceEntry then when you called it, it would only include the properties from PerformanceEntry (name, entryType, startTime, duration) and not the additional properties that InteractionContentfulPaint adds on top (interactionId, largestContentfulPaint, paintTime, presentationTime).

So instead of just inheriting toJSON(), it overrides toJSON() to it's own version of that method to ensure the new versions are included (it's basically the same function though — one that iterates through all properties and outputs them in JSON format). This is why it counts as a method on InteractionContentfulPaint and gets it's own page on MDN — because it is a method specific to InteractionContentfulPaint and not just inherited from PerformanceEntry.

Does that make sense?

Can you think about better wording to make this clearer? Maybe this?

Suggested change
This interface overrides the following {{domxref("PerformanceEntry")}} method to include the additional properties added in this interface:
This interface overrides the {{domxref("PerformanceEntry.toJSON()")}} method to include the additional properties, added in this interface, in the JSON output:

If that's clearer than can update them all to say that. Or can you suggest better wording?

@chrisdavidmills chrisdavidmills Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, I get it — so it includes its own toJSON(), which replaces the PerformanceEntry version of toJSON(). Its own toJSON() outputs JSON that reflects its object structure, not the object structure of PerformanceEntry.

I kinda took that as read, and didn't even think about it until I started reading this wording, which made me feel a bit confused.

I would write something like:

The <interface-name> interface overrides the {{domxref("PerformanceEntry.toJSON()")}} method with its own custom version that outputs JSON reflecting its own object structure.

But I would also include it in the method description, rather than as a separate sentence.

Does that work for you?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I went with this in 3295a8e:

Overrides the PerformanceEntry.toJSON() method to return a JSON representation of the <interface-name> object.

WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool, this works fine. I will go through the interface pages, check them, and then get this thing merged.

@hamishwillee

Copy link
Copy Markdown
Collaborator

Chris seems to be on top of this. Ping me if you need my review too.

@chrisdavidmills chrisdavidmills left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very cool. Let's get this in.

@chrisdavidmills
chrisdavidmills merged commit c9b973e into mdn:main Aug 28, 2026
10 checks passed
@tunetheweb

Copy link
Copy Markdown
Contributor Author

Thank @chrisdavidmills !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants