Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Firefox paints decdn.org before the stylesheet applies on reload

Đang mở
#331 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
54/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
frontend, performance

Hướng nghiên cứu

Start by reproducing the reload in Firefox with the console open and follow the “Layout was forced” warning to the responsible script. Inspect Chrome.tsx and its layout reads, then retry in a private window or Troubleshoot Mode to check for extension involvement. Done means identifying the cause and confirming reloads no longer show an unstyled paint.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Symptom

On reload in Firefox (Linux), decdn.org shows the page fully unstyled for ~250 ms (three frames of a ~12 fps screen recording) before the CSS applies: serif text, bulleted nav and drawer lists, default blue links. Before #330 this also drew the hero's litepaper icon at full container width as a blue block. #330 made the icons harmless, but the unstyled paint itself remains.

Confirmed

  • In the user's recording, frames before the first styled frame show the raw HTML with no stylesheet applied (wordmark <img> not yet painted either).
  • The stylesheet is a single render-blocking <link rel="stylesheet" href="/_next/static/chunks/….css" data-precedence="next"> in <head>, served text/css, allowed by the CSP.

Not reproduced

  • Headless Chromium (Playwright, chromium-1234), cold and throttled (300 ms latency, 200 KB/s), 1440×900 and 390×844: screencast frames go blank → styled with nothing in between.
  • Playwright Firefox (firefox-1511), cold load and prime-then-reload, with the CSS response held 1.5 s: no unstyled paint and no requestAnimationFrame tick sees unstyled layout. The paint waits for the CSS.
  • document.getAnimations() at load shows only the intended entrance animations. The mobile drawer's overlay and panel (prerendered since #324) do not animate on load.

Hypotheses (unconfirmed)

  1. A script forces layout before the CSS lands. This is Firefox's documented FOUC trigger. The console warns "Layout was forced before the page was fully loaded. If stylesheets are not yet loaded this may cause a flash of unstyled content." Async scripts are not held back by a pending stylesheet the way parser-blocking ones are. On reload the JS chunks can be ready before the CSS revalidation round-trip completes. Candidates that read layout on mount: Chrome.tsx (navRef.current.offsetHeight, window.innerHeight, window.scrollY), plus anything in Next's bootstrap.
  2. A browser extension (content script running at document_start or document_idle) forcing layout. That would also explain why clean Playwright profiles don't reproduce it.

Next steps

  • Reload decdn.org in Firefox with the console open and check for the "Layout was forced" warning; it links to the script responsible.
  • Retry in a private window or Troubleshoot Mode (extensions off).
  • If it's our code: defer the layout read until after load, or until document.styleSheets is complete.

Related: shortening the window by caching hashed assets as immutable (#332).

Ngôn ngữ chính
TypeScript
Star
3
Fork
0
Merge trung bình
12 giờ 41 phút
Pull request đã merge (30 ngày)
70

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của decdn/website

Tất cả issue của decdn/website

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.