Firefox paints decdn.org before the stylesheet applies on reload
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
- Công nghệ
- next.js, react, typescript
- 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ả
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>, servedtext/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
requestAnimationFrametick 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)
- 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. - A browser extension (content script running at
document_startordocument_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 untildocument.styleSheetsis 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của decdn/website
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug med-priority
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement low-priority
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement low-priority
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
decdn/website#268 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của decdn/website
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
db-ux-design-system/core-web#8613 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
foxglove/mcap#1907 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug internal-plugin pr-welcome upstream
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
dsh-tauri-desk/deepseek-harness-desktop#1225 · 1 bình luận ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
unjs/unhead#1027 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày