Skip to content

Conversation

@bcaudan
Copy link
Collaborator

@bcaudan bcaudan commented Jan 27, 2026

Motivation

Since the bump of safari iOS version, one test is failing inconsistently:

 serializeDocumentNode handles
    with dynamic stylesheet
      βœ— serializes a document with adoptedStyleSheets [Mobile Safari 16.4 (iOS 16.4.1)]
	Expected $.adoptedStyleSheets.length = 0 to equal 1.

It seems that Safari started the adoptedStyleSheets implementation with FrozenArray around 16.x version.

In this case, the use of map simply returns an empty array without any error.

Changes

Use a regular for loop to iterate over CSSStyleSheet array.

Test instructions

I've managed to see the fix working where the issue should have happened.
We should not see this test fail anymore.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@bcaudan bcaudan requested review from a team as code owners January 27, 2026 15:47
Copy link
Contributor

@sethfowler-datadog sethfowler-datadog left a comment

Choose a reason for hiding this comment

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

LGTM!

@bcaudan bcaudan merged commit bbef099 into main Jan 27, 2026
22 checks passed
@bcaudan bcaudan deleted the bcaudan/fix-ios-adoptedStylesheets branch January 27, 2026 16:23
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants