Skip to content

feat: Add conditional marker exposure based on cross-origin isolation (supersedes #85) - #89

Open
monica-ch wants to merge 6 commits into
WICG:mainfrom
monica-ch:monica-ch/pr-85-fixes
Open

feat: Add conditional marker exposure based on cross-origin isolation (supersedes #85)#89
monica-ch wants to merge 6 commits into
WICG:mainfrom
monica-ch:monica-ch/pr-85-fixes

Conversation

@monica-ch

@monica-ch monica-ch commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Supersedes #85 (picking up the conditional-marker-exposure work from @HeathcliffAC — thanks for the initial draft).

This PR retains the original commit from #85 and adds one follow-up commit that:

Bug fixes

  • Fix mangled JSON in the Trace with markers example in markers.md — the closing } was glued onto the same line as "timestamp": 150, breaking the code block.
  • Correct the MSEdgeExplainers explainer URL — was github.com/MSEdgeExplainers/ConditionalMarkersExposure, corrected to github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/ConditionalMarkersExposure/explainer.md.
  • Restore the newline between </p> and <section data-dfn-for="ProfilerSample"> in index.html that was collapsed by the previous edit.

Normative gap
The original PR replaced the [CrossOriginIsolated] IDL extended attribute with prose ("availability depends on the context''s cross-origin isolation status"), but never specified how the marker field is populated. That left two conforming UAs free to ship different subsets.

This adds a normative filter a marker algorithm in the Processing Model section, invoked from take a sample when setting ProfilerSample.marker:

To filter a marker given a ProfilerMarker marker and an environment settings object settings:
  1. If settings'' cross-origin isolated capability is true, return marker.
  2. If marker is "style" or "layout", return marker.
  3. Return null.

The <dfn>marker</dfn> prose is tightened to point at the algorithm rather than restating the exposure rule informally.

Opt-in hook
Adds a non-normative note reserving room for UA-defined opt-in mechanisms (e.g. origin trials, document policies) that may widen the set returned by filter a marker for a specific settings object, while still forbidding cross-origin marker exposure.

Implementation status

Chromium implementation of the algorithm as specified here is in flight https://chromium-review.googlesource.com/c/chromium/src/+/6012522. The filtering behavior in ProfilerTraceBuilder::GetMarker()ProfileMarkerToPublicMarker — matches this algorithm exactly for the non-opt-in path.


Preview | Diff

@monica-ch

Copy link
Copy Markdown
Contributor Author

@acomminos @camillelamy @ArthurSonzogni Can I get your review on this change?

@acomminos acomminos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall looks good to me, but I'd like @camillelamy / @ArthurSonzogni to provide some feedback on the security design choices here.

Comment thread index.html Outdated
Comment thread index.html Outdated
PaulKinlan added a commit to PaulKinlan/chrome-platform-showcase that referenced this pull request Aug 23, 2026
Concepts: marker-gates-probe, live-trace-explorer, gap-attribution-workbench

The markers proposal (WICG/js-self-profiling#89) adds a per-sample marker
member (script/gc/style/layout/paint/other), [CrossOriginIsolated]-gated.
Route support: v153/js-self-profiling-markers pages and their conformance
route now serve Document-Policy: js-profiling — the same targeted special
case the repo already ships for v147/js-profiling-in-dedicated-workers —
so every demo runs REAL Profiler sessions on this origin (verified: 120+
samples captured headlessly, genuine stackless gap samples plotted, honest
zero-marker verdicts on Chromium 141 with the COI gate explained). 0px
overflow mobile+desktop, zero console errors.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CNfiPLAVbcuK4uL2qZX4ur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants