Problem with background-color on html/body

Stephan Kulow coolo at kde.org
Fri Nov 26 15:10:18 GMT 2004


Hi!

I'm trying to fix #47320 as cleanly as possible. For this I created a 
-khtml-base value that follows system color's background as long
as the web page doesn't define only one of background/foreground.

We have currently something similiar in 
HTMLBodyElementImpl::insertedIntoDocument, which I try to make
more general in delaying it till the styles are applied. 

But there are several problems with that, which make it either very hard
or impossible to solve in general.

The most obvious is that it's by no meaning clear where to start with the
check. The body might define no colors at all and appear fine, but include
a table that sets a bgcolor=white only.

The other problem is that there is a pretty fragile connection between HTML
and BODY when it comes to background color. I.e. the page's background
depends not only on BODY's background, but also on the fact that HTML has
no background-color defined.

What makes me wonder about all this is that most likely only a very tiny
portion of all people will use dark color schemes and those that do might
still consider being able to view all pages of higher value than respecting 
the color scheme 100%.

So I'm wondering if it would be a feasonable approach to add an option
to follow system colors, default to true and auto-disable it when a color
scheme is choosen that either has a too light foreground or too dark
background.

Or I just lack an ellegant way to fix this ;(

Greetings, Stephan




More information about the kfm-devel mailing list