Follow-up from WebKit#453 review.
Review context:
Current state:
experimental/responsive-design/src/lib/components/recipe-carousel.js uses ResizeObserver to update _carouselWidth, which affects _getItemsPerView() and carousel scroll distance.
- Other Responsive-Design components also intentionally use browser-observable responsive APIs:
app-ribbon.js uses ResizeObserver for visible button count.
information-window.js uses ResizeObserver.
recipe-grid.js uses matchMedia("(max-width: 640px)") and emits resize-work-complete for benchmark synchronization.
- The benchmark resize steps wait for one
resize-work-complete event from recipe-grid, but they do not verify how many ResizeObserver callbacks fire in recipe-carousel or whether the count is consistent across browsers.
Problem to investigate:
- ResizeObserver callback counts can differ by browser or layout timing.
- If
recipe-carousel sees a different number of resize notifications, the workload may do inconsistent responsive work even when the benchmark still completes.
Suggested direction:
- Track the number of
ResizeObserver notifications in recipe-carousel during ReduceWidthIn5Steps and IncreaseWidthIn5Steps.
- Decide whether this should be:
- a diagnostic
console.warn when counts differ from expected values, or
- a strict unittest/e2e assertion if the expected count is stable across Safari, Chrome, Firefox, and Edge.
- If strictness is too brittle, expose a debug counter and validate only coarse invariants, e.g. callbacks occurred and final
_carouselWidth matches the final iframe width class/threshold.
- Keep benchmark measurement boundaries unchanged unless the count tracking shows missing async work.
Validation:
- Run Responsive-Design across the browser matrix and compare observed ResizeObserver counts.
- Add a unit/e2e test only after expected browser behavior is confirmed stable enough.
Follow-up from WebKit#453 review.
Review context:
Current state:
experimental/responsive-design/src/lib/components/recipe-carousel.jsusesResizeObserverto update_carouselWidth, which affects_getItemsPerView()and carousel scroll distance.app-ribbon.jsusesResizeObserverfor visible button count.information-window.jsusesResizeObserver.recipe-grid.jsusesmatchMedia("(max-width: 640px)")and emitsresize-work-completefor benchmark synchronization.resize-work-completeevent fromrecipe-grid, but they do not verify how many ResizeObserver callbacks fire inrecipe-carouselor whether the count is consistent across browsers.Problem to investigate:
recipe-carouselsees a different number of resize notifications, the workload may do inconsistent responsive work even when the benchmark still completes.Suggested direction:
ResizeObservernotifications inrecipe-carouselduringReduceWidthIn5StepsandIncreaseWidthIn5Steps.console.warnwhen counts differ from expected values, or_carouselWidthmatches the final iframe width class/threshold.Validation: