Skip to content

Track Responsive-Design carousel resize events#57

Open
issackjohn wants to merge 1 commit into
mainfrom
track-responsive-carousel-resize-counts
Open

Track Responsive-Design carousel resize events#57
issackjohn wants to merge 1 commit into
mainfrom
track-responsive-carousel-resize-counts

Conversation

@issackjohn

@issackjohn issackjohn commented Jun 1, 2026

Copy link
Copy Markdown
Owner

Summary

Tracks the Responsive-Design recipe carousel's ResizeObserver activity during the two iframe width-change steps.

  • Adds PageElement.observeResizeEvents() to count distinct content-box width changes.
  • Instruments ReduceWidthIn5Steps and IncreaseWidthIn5Steps on the same .carousel element observed by the component.
  • Reports the observed count in the browser console and highlights an unexpected zero count.

Motivation

This follows up on the upstream review request to make carousel resize activity visible for cross-browser comparison while providing strict tests for the deterministic counting behavior.

Implementation details

  • The first observer delivery establishes the baseline and is not counted as a resize.
  • Widths come from contentBoxSize, with contentRect.width as the compatibility fallback.
  • Each workload step waits for the baseline before changing the iframe width.
  • Repeated deliveries of the same width are ignored.
  • The observer is disconnected after pending resize deliveries have had time to run.

Validation

  • Unit tests cover baseline initialization, distinct width changes, and duplicate-width deliveries.
  • Linters and Chrome, Firefox, and Safari CI checks pass.

Related to #54.

@issackjohn issackjohn force-pushed the track-responsive-carousel-resize-counts branch from a286c76 to 414734a Compare June 1, 2026 23:46
@issackjohn issackjohn requested a review from Copilot June 2, 2026 16:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds lightweight instrumentation to the benchmark runner to observe ResizeObserver-driven width changes on a specific element (the Responsive-Design recipe carousel) during iframe width-change workload steps, surfacing missing ResizeObserver delivery via browser warnings without changing the step boundaries.

Changes:

  • Added a generic PageElement.observeResizeEvents() helper to count delivered width changes and allow explicit disconnect.
  • Updated the Responsive-Design ReduceWidthIn5Steps / IncreaseWidthIn5Steps steps to observe .carousel and console.warn if no resize events were delivered.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
resources/benchmark-runner.mjs Adds PageElement.observeResizeEvents() to track ResizeObserver deliveries and expose a disconnectable counter.
experimental/tests.mjs Uses the new helper in Responsive-Design width-change steps and warns when no carousel resize events are observed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread resources/benchmark-runner.mjs
@issackjohn issackjohn force-pushed the track-responsive-carousel-resize-counts branch from 03f3e78 to 06b5ab5 Compare June 2, 2026 20:22
@issackjohn issackjohn changed the base branch from responsive-design to main June 2, 2026 20:22
@issackjohn issackjohn force-pushed the track-responsive-carousel-resize-counts branch 4 times, most recently from 116434a to 564579a Compare June 2, 2026 20:40
@issackjohn issackjohn force-pushed the track-responsive-carousel-resize-counts branch from 564579a to fbf374f Compare June 2, 2026 20:49
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