LadybirdBrowser / ladybird

Truly independent web browser
https://ladybird.org
BSD 2-Clause "Simplified" License
19.27k stars 781 forks source link

Flashbang (white background) effect before page loads: sweclockers.com #695

Open Ryder17z opened 1 month ago

Ryder17z commented 1 month ago

Just tested this browser and this is something that doesn't happen with firefox/chromium and it's forks.

I don't know the cause of this issue, but I'm running Linux and I suspect more sites might have similar issues.

AtkinsSJ commented 1 month ago

Looking at the site, the relevant CSS is this:

body {
    background: var(--background-main, #edeceb);
}

@media (prefers-color-scheme: dark) {
    :root.os-default {
        --background-main: #101010;
    }
}

On load, the <html> element doesn't have a class set, so the background colour is the fallback near-white #edeceb. Then at some point JS adds the os-default class, and so the --background-main value exists and is used.

I'm not 100% sure here because #edeceb looks so much like white, so it might be something else. But it's definitely suspicious. Maybe we're either taking longer to run JS than other browsers, or we're not waiting as long before first paint.

Ryder17z commented 1 month ago

I am not sure, but I think the site is pretty lightweight on the js side. The white-ish color is very odd because the site has had a dark theme for over a decade.

On Fri, 19 Jul 2024, 10:16 Sam Atkins, @.***> wrote:

Looking at the site, the relevant CSS is this:

body { background: var(--background-main, #edeceb); } @media (prefers-color-scheme: dark) { :root.os-default { --background-main: #101010; } }

On load, the element doesn't have a class set, so the background colour is the fallback near-white #edeceb. Then at some point JS adds the os-default class, and so the --background-main value exists and is used.

I'm not 100% sure here because #edeceb looks so much like white, so it might be something else. But it's definitely suspicious. Maybe we're either taking longer to run JS than other browsers, or we're not waiting as long before first paint.

— Reply to this email directly, view it on GitHub https://github.com/LadybirdBrowser/ladybird/issues/695#issuecomment-2238621725, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPIOP4LBK7WFKSNDBEYN7LZNDDO5AVCNFSM6AAAAABLCRZDQSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZYGYZDCNZSGU . You are receiving this because you authored the thread.Message ID: @.***>

avbdr commented 1 month ago

same issue happens on https://www.linux.org.ru/