Bug 296645

Summary: webkit forces the body CSS background to that of the current theme
Product: [Frameworks and Libraries] kwebkitpart Reporter: Marcus Harrison <marcus>
Component: generalAssignee: webkit-devel
Status: RESOLVED WORKSFORME    
Severity: normal CC: adawit
Priority: NOR    
Version: 1.2.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: minimal test case

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.