Bug 296645 - webkit forces the body CSS background to that of the current theme
Summary: webkit forces the body CSS background to that of the current theme
Status: RESOLVED WORKSFORME
Alias: None
Product: kwebkitpart
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 1.2.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: webkit-devel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-23 22:35 UTC by Marcus Harrison
Modified: 2012-09-22 15:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
minimal test case (195 bytes, text/html)
2012-09-07 17:55 UTC, Dawit Alemayehu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Harrison 2012-03-23 22:35:08 UTC
Given a website with this simple CSS:

* {background-color: transparent;}
body {background-color: #ffffff;
color: #000000;}

The font becomes unreadable under dark themes (I tested with Obsidian Coast) because the background colour of the body element is forced to that of the current Qt/KDE widget theme colour. I have observed that if the above CSS is changed to:

* {background-color: transparent;}
body {background-color: #ffffff!important;
color: #000000;}

the background colour is correctly set to the colour given in the stylesheet. However, this should not be necessary to override the background colour set by the browser.

I have observed this in both Konqueror and Rekonq. This is a major limiter in the use of dark themes and breaks many websites.
Comment 1 Dawit Alemayehu 2012-09-07 17:55:02 UTC
I think you need to report this to whomever created the dark theme you are using because I can easily show that no such thing happens using the default KDE theme (oxygen). 

I have taken your 1st css excerpt and created a minimal test case that sets the background to light yellow color. When I open the test file, the background color is correctly set to light yellow in all the browsers I tested (konq+webkit, konq+html, chromium and firefox) ; so I fail to see how this could be a webkit related bug.
Comment 2 Dawit Alemayehu 2012-09-07 17:55:36 UTC
Created attachment 73724 [details]
minimal test case
Comment 3 Dawit Alemayehu 2012-09-22 15:50:34 UTC
See comment #1 and the test case in comment #2.