Skip to content

Compare strict and ordinary pages after the page font has loaded - #536

Merged
PrzemyslawKlys merged 1 commit into
mainfrom
fix/browser-contract-settling
Dec 4, 2026
Merged

PrzemyslawKlys merged 1 commit into
mainfrom
fix/browser-contract-settling

Conversation

@PrzemyslawKlys

@PrzemyslawKlys PrzemyslawKlys commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

StrictStyleTests.StrictPageRendersLikeTheOrdinaryPageUnderAStrictPolicy(interactive-adaptive-page) failed twice on main on Windows Chromium. The adaptive page's section measured 456.812px on one page and 451.656px on the other, and the two runs had the values on opposite sides of the comparison. So this is a race, not a difference the strict policy causes.

The page font (Archivo) uses font-display: swap. The contract snapshotted both pages straight after the load event, so on a busy runner one page could still be laid out in the fallback font. Forcing a fallback font locally gives exactly the 451.656px section height from CI. Both pages now wait for document.fonts.ready and the relayout after it before they are compared.

Checked with the strict style tests in Chromium and WebKit, and the strict page contract run five times under CPU load.

Summary by CodeRabbit

  • Tests
    • Browser-based presentation checks now wait for fonts to load and visual updates to complete before continuing, improving the consistency of those checks. This change does not add or remove end-user features.

The page font uses font-display swap, so a page measured before it loads lays out in the fallback font. The strict
page contract snapshotted each page straight after the load event, and on a busy runner one of the two pages was
sometimes still in the fallback font: the adaptive page's section measured 451.656px instead of 456.812px, on either
side of the comparison. Forcing a fallback font locally reproduces exactly that 451.656px height. Both pages now wait
for document.fonts.ready and the relayout that follows before they are compared.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T17:57:30.148086Z 1d903ca PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

OpenAsync now waits for document fonts to load and for two animation frames after navigation before settling presentation and returning the browser session.

Changes: Strict style test setup

Layer / File(s) Summary
Wait for page readiness
ChartForgeX.Tests/StrictStyleTests.cs
OpenAsync waits for document.fonts.ready and two animation frames after navigation before settling presentation and returning the session.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Other

Possibly related PRs

Merge Risk: Minimal · up to 1d903

This change only makes a browser-based style test more reliable by waiting for fonts to load before comparing pages. It has no production impact, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: both strict and ordinary pages are compared only after the page font has loaded. The summary and objectives confirm the change makes both pages wait for document.fonts…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: both strict and ordinary pages are compared only after the page font has loaded. The summary and objectives confirm the change makes both pages wait for document.fonts.ready and a relayout before comparison, which fixes the intermittent Windows Chromium failure. The title is specific and matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 50d619b9-12a5-4487-be8b-ecb4eeb76329
Commits

Reviewing files that changed from the base of the PR and between 93ca113 and 1d903ca.

Files selected for processing: 1

  • ChartForgeX.Tests/StrictStyleTests.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@PrzemyslawKlys
PrzemyslawKlys merged commit c016381 into main Dec 4, 2026
32 of 34 checks passed
@PrzemyslawKlys
PrzemyslawKlys deleted the fix/browser-contract-settling branch December 4, 2026 18:57
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.

1 participant