Summary: | [testcase] text and background uses colors from KDE color scheme if not specified in the html style | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Charles Samuels <charles> |
Component: | khtml renderer | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED UNMAINTAINED | ||
Severity: | normal | CC: | ahd9ryi02, aiacovitti, ana, arne_bab, bluedzins, branan, chusty, congyiwu, daniel.hill, danielbarrettbolton, dsolaz, eli, finex, giecrilj, hackeron, i.zaufi, jamie, jlp, kde, kubry, larsivar, martin.hohenberg, meyerm, miklcct, missive, news, pete, peyotll, rfernandes, samuel.brack, scottsimus, trouble, zingeepe |
Priority: | VHI | ||
Version: | 4.4.5 | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
trying to fix
Patch to use theme's text color unless page's css selects otherwise Improper default colour in Konqueror |
Description
Charles Samuels
2002-09-02 02:54:54 UTC
I remember to see a bug for the different problem (color: always black)....:) * CDE color scheme. * kill all konqueror (including the preloaded) * visit both web pages - black text on white where expected. The bug was quite old... is this still a problem in 3.1.x? Those URLs have been fixed, try this one: http://www.gothmetal.net/ (wasn't logged in just now :) I see no white background on that site :-) Can't reproduce it there with CDE colors - did you use other? But I found another one: http://www.aftonbladet.se/ With CDE colors; background white, links yellow == unreadable If I configure the same color preference in mozilla only links in ads are yellow - links in body are OK. *** Bug 81057 has been marked as a duplicate of this bug. *** I have a black on black problem when I set foreground to white and background to black: ftp://81.86.159.146/mutt.jpg Very critical problem for me -- has been around for years. usual fix: user defined stylesheet, overwriting default background body { background-color: white; } Thats not a fix. That gets rid of background images on the websites, and makes many websites unviewable as well. If a webpage sets the font to white and background to black or a dark image, and you override the background. You are left with white on white. What I did is override the font colour to dark grey. So atleast if a webpage opens with black background, I can see the text in grey. -- But that has its own disadvantages. why should background-color: get rid of background images? That's either a lie or a bug. And yes, you need to include color: in your overwrite too. I cant remember the specifics, my laptop is being repaired atm and I'm using firefox on this temporary machine. But I think it wasnt body { background-color } but *{ background-color } -- I remember body { } wasnt enough for some sites. *** Bug 76686 has been marked as a duplicate of this bug. *** This is also reported in Debian: http://bugs.debian.org/282146 [need to repeat here since #76686 has been closed, sorry]. *** Bug 57089 has been marked as a duplicate of this bug. *** Created attachment 8455 [details] trying to fix I played a lot with this patch and I'm still not convinced this is the right thing to do. It fixes mutt.org and it makes sure web pages only defining a background still show something reasonable. But e.g. http://finance.yahoo.com/q/bc?s=NOVL looks like shit in CDE color scheme, but there is nothing I can do about within reasonable efforts. The only option I can offer is to disable following system colors. Try it out. regarding comment #12, please see comment #7 for bug 76686, which (IMO) is NOT a duplicate of this one If, once system settings are honored by khtml, some Yahoo page looks bad, then it's the page author's fault for not defining colors consistently. Bug 76686 is about honoring system settings, this one is about working around incomplete color settings in web pages. the bugs are not independent of each other. #76686 happens because of incompletely following system colors. We used to follow only with foreground -> white/white and now we follow only with background -> black/black. My patch tries to fix this. But following system colors doesn't really help you as just too many web pages don't care. That patch doesn't work for me: it references a function `setBaseColor()' which I can't find in the DocumentImpl or any superclasses in release 3.3.2 or in HEAD (and this bug is definitely still present in 3.3.2; I'm experiencing the `foreground colour in system colours not mapped to stylesheet' variant, with an added dash of all-user-stylesheets-ignored to make it even more aggravating). What am I missing? *** Bug 98533 has been marked as a duplicate of this bug. *** *** Bug 60555 has been marked as a duplicate of this bug. *** *** Bug 80062 has been marked as a duplicate of this bug. *** Another affected page (which is _ignore_ foreground color) of currently configured scheme: http://www.boost.org/libs/utility/enable_if.html -- DAMN IT ALL! How long this nasty bug will be in KDE!!!!! 3.5.1 Still affected!! Why not just expect that users will use a custom style sheet for Konqueror if they wish to change colors and only change SYSTEM colors, not Konqueror colors. Personally, I'd rather have a page be legible and in the wrong color scheme. This seems like such a thorny issue to have (especially with so many badly written sites that specify a text or background color but not both) that it's not really solvable. One more tip. If you DO run into a site where you just can't read it, hit control-A to select all. This will force the colors into the highlight scheme, which should be legible unless you screwed those up. Also, (and this is what I did with the Dusky color scheme: http://www.kde-look.org/content/show.php?content=7832 ) make the default text color a medium color -- not light or dark. That way you'll be able to read it on either background. Of course, this is easier said than done, since you'll probably want to go closer to either light or dark. (reading text that has lower contrast than it should is somewhat challenging.) Okay, it's a given that various sites are going to be poorly designed such that if you're using colors other than black text on a white background they are not going to look good. I'm unaware of any fix for this other than shooting all of the web developers who do that (but for better or worse that's not legal....). The main problem I see is what was reported in bug #76686 (which was unfortunately closed and marked as a duplicate of this bug). Konqueror does not follow the system colors when no colors are specified by the web page. I have a dark blue background with light blue text as my system colors, but I consistently get black text on my dark blue background on web pages where the person who designed the page did not specify the color of either the text or the background. If Konqueror is going to set the background to match my background when the background color isn't specified by the page, why isn't it also using my text color when the page doesn't define the text color? Either it should ignore the system colors entirely (not desirable) or it should use the system colors when the page doesn't define the colors. Why can't konqueror just do what I tell it to? If I want white text on a black background that's what I should get, unless the page itself overrides. If the page is badly written it will show, and that is the fault of the web author, and not the responsibility of konqueror. If you want to work around that, add a config option for using either (1) the system colours or (2) special fg/bg colours for web pages. Maybe also a check box in (1) for 'except when the page specifies only one of fg+bg'. That way I can at least have the rest of my kde apps look how I want (without having to use firefox for web browsing!). Other browsers have done this for years now. I tried hacking the source myself, but I just got totally lost in all the framework gubbins and couldn't see what was actually going on. What's actually impeding the Right Way (tm) to solve this problem? Hardcode black on white by default (ignoring colour scheme) to make the internet experience for the typical user as seamless as possible, and provide the option to use system colours as done by Coolo's patch. I really can't understand why *by default* we hardcode one colour (fg) but leave the other one (bg) to be defined by the underlying colour scheme. Workaround: you actually can force an override with a modified accessibility stylesheet, but this IS still a bug. richard missenden wrote: [bugs.kde.org quoted mail] There are still problems with text and background colors in Konqueror KDE 4 RC2+. For example try to use the Obsidian Coast color scheme which is dark and visit many pages. I have a dark theme (http://www.kde-look.org/content/show.php/Tempered+Charcoal?content=67024) and I have black text on a dark background, even though the default text color should be white. I browsed through the khtml source and ended up finding a workaround that works for me: KDE has base css files in /usr/share/apps/khtml/css/html4.css and /usr/share/apps/khtml/css/quirks.css Changing html4.css will change your default colors/layout, but web pages can still override your changes! You can also copy html4 to your .kde directory instead of modifying it globally: cd ~/.kde/share/apps/khtml/ mkdir css cp /usr/share/apps/khtml/css/html4.css css The section: html { display: block; color: -khtml-text; } is responsible for the foreground text color. Somewhere in the khtml code, -khtml-text gets replaced by black. So if you want white text by default, just use color: white; Further down in the css file are 2 more useful blocks: @media print { body { display: block; margin: 0px; } } @media screen { body { display: block; margin: 10px; } } To get a white background change those blocks to: @media print { body { display: block; margin: 0px; background-color: white; } } @media screen { body { display: block; margin: 10px; background-color: white; } } I kept my foreground text black and changed the background to white, and I haven't noticed any problems. > ------- Additional Comment #26 From Leo Savernik 2007-04-20 17:33 -------
> What's actually impeding the Right Way (tm) to solve this problem? Hardcode
> black on white by default (ignoring colour scheme) to make the internet
> experience for the typical user as seamless as possible, and provide the
> option to use system colours as done by Coolo's patch.
>
> I really can't understand why *by default* we hardcode one colour (fg) but
> leave the other one (bg) to be defined by the underlying colour scheme.
I support this. One could argue it's the whole half of the Web that's broken with assuming everyone has black colours on white background by default and not setting the background colour along with the foreground, but it's a whole lot less inertia to fix (*cough*) Konqueror to act like other major browsers than to fix the Web.
This is still a problem with Konqueror 4 from trunk (kdelibs r, kdebase r). Another testcase can be my simple website: http://jlp.holodeck1.com/ It is also a problem for us in KDE Edu. We're using KHTML part in Step physics simulator for contextual help and it is hard to read if a user uses a dark color scheme. So I think the best solution for this would be to have all colors in KHTML part to follow the system color scheme so that it can look consistent when integrated into apps like Step. And then there should be an option to enable web compatibility mode for KHTML part so that web browsers like Konqueror could enable it and the background would be hardcoded to white and text to black. Oh forgot to add revisions in my previous comment: kdelibs r795429, kdebase r795176 I'm having a hard time accessing http://bugs.kde.org under konqueror! Trying many different color schemes (including default), the text entry regions are not outlined so I have to guess (or remember) where they are, selection boxes are transparent unless I select or deselect them, etc. I WANT to use konqueror, but many, too many websites are unusable so my patience is getting tried. Re #33: see http://bugs.kde.org/show_bug.cgi?id=157850 This is biting me for form elements using konqueror. dropdown lists and textboxes have black text on grey backgrounds. when using the obsidian color style. KDE 4.0.84-1 debian svn 20080625 This bug is still present in 4.1.0, and effectively makes dark colour schemes like Obsidian Coast "broken". I'd like to support the idea that Konqueror / KHTML should honour the system settings and have whichever colour I choose from the colour scheme. If websites or accessibility stylesheets want to override, then that's fine. This really is a showstopper for anyone using a dark background. Thanks. Hi again, I just tried Congyi Wu's workaround to make my konqueror backgrounds white (which I really don't want to do, but it's the only thing to make it work right now, I guess), and I thought I'd add that you'll also need to replace all the instances of: background-color: window; with background-color: white; in the various form sections lower down the html4.css file. Otherwise, even this page looks terrible in Obsidian, as you're entering black text into a dark grey box to make comments :-/ HTH, but looking forward to a "proper" solution soon :-) Bug 170919 is probably a duplicate. I just want post a link that still affected by this bug (some of them posted above are not valid already) http://www.gnu.org/software/autoconf/manual/make/ Indeed. BTW - I've made my html4.css available for download here: http://www.petesodyssey.org/files/html4.css ...to be placed into ~/.kde/share/apps/khtml/css/ in order to work-around this bug for now and make pages readable. Still hoping for a konqueror that does what it's told though... :-) (In reply to comment #40) > Indeed. > > BTW - I've made my html4.css available for download here: > http://www.petesodyssey.org/files/html4.css > > ...to be placed into ~/.kde/share/apps/khtml/css/ in order to work-around this > bug for now and make pages readable. > > Still hoping for a konqueror that does what it's told though... :-) > This is well and fine enough for the background, but do still not handle the serious issues referred to in my post in Bug 170919 which relates to the colours used in themed widgets (the biggest problem is forms, but for instance black scrollbars (like I see in this particular form) just look ugly when the page was designed with light widgets in mind. Hmm... something seems to have changed at least in 4.1.3 or later. BTW, I've noticed from my playing around with the html4.css that I don't seem able to override the text colour for text input areas any more. They seem to be hard-coded as view-text, though the background isn't. Can someone confirm that khtml overrides html4.css with text colour for text input form items? Thanks. BTW, there's a really easy way of seeing this brokenness in action- select obsidian coast as a your scheme, then try to write a comment on this very page :-( http://www.ridingwithrobots.org/blog/?p=1616 This is the site that is pointed by the plasmoid ridewithrobots. It is all black. If I go to File/open with Konqueror/kde3 it works OK. The same with Firefox. It seems to be the same problem. If not I will start another bug report. *** Bug 170919 has been marked as a duplicate of this bug. *** *** Bug 200253 has been marked as a duplicate of this bug. *** *** Bug 203797 has been marked as a duplicate of this bug. *** *** Bug 175922 has been marked as a duplicate of this bug. *** *** Bug 172534 has been marked as a duplicate of this bug. *** *** Bug 160165 has been marked as a duplicate of this bug. *** *** Bug 53885 has been marked as a duplicate of this bug. *** *** Bug 207875 has been marked as a duplicate of this bug. *** Look bug #207875 for some additional details. *** Bug 207906 has been marked as a duplicate of this bug. *** I just found this bug when I wanted to post one for the topic myself. I would prefer to have an option to override the default text color of websites which don't supply a custom background color. I'm also browsing with dark background, and I don't want Konqueror to break my theme (theme: http://draketo.de/licht/freie-software/kde/kde-433 ). I didn't realize until I found this bug that the websites didn't supply a default text color - I assumed they defined black for text. So the straightforward solution I see is to make Konqueror honor my colorscheme - I set it for a reason, after all. The complex solution would be to honor the colorscheme, but to have an option to make Konqueror check for each custom text color if its contrast to the according background is high enough, and to use a color with more contrast if the custom color isn't visible/readable. Why is there black themes in KDE if we can't use them??? I tried obsidian theme and can't go back now, I really love It. I hope that bug will be corrected. This bug still exists. As a workaround for dark-background lovers, you can edit /usr/share/kde4/apps/khtml/css/html4.css and replace color: -khtml-text; with color: white; This will affect all users on the machine, though, so a real fix is still needed. This bug STILL exists in 4.4.5! I have to use a custom stylesheet to override it. (In reply to comment #57) > This bug STILL exists in 4.4.5! I have to use a custom stylesheet to override > it. Yep! Its about 7 years old bug!! Anniversary coming soon :) Updated it to version 4.4.5 I think that the best is to follow the system settings for background, text and links in terms of colour, font and size unless the page overrides it. *** Bug 226437 has been marked as a duplicate of this bug. *** *** Bug 273630 has been marked as a duplicate of this bug. *** My solution: BODY { COLOR: WINDOWTEXT } :LINK { COLOR: AQUA } (In reply to comment #29) > KDE has base css files in /usr/share/apps/khtml/css/html4.css and It is at /usr/share/kde4/apps/khtml/css/html4.css It also turns out that Konqueror ignores any custom styles for TEXTAREA. Moreover, the custom style sheet is not applied in WebKit mode and I still get black on dark there. (In reply to comment #65) > It also turns out that Konqueror ignores any custom styles for TEXTAREA. As weird as it sounds, TEXTAREA got updated after restart. (In reply to comment #63) > My solution: > > BODY { COLOR: WINDOWTEXT } :LINK { COLOR: AQUA } Unfortunately, putting those declarations into custom CSS for Konqueror does not affect the display of embedded documents such as Ark Preview. *** Bug 169701 has been marked as a duplicate of this bug. *** Created attachment 86145 [details]
Patch to use theme's text color unless page's css selects otherwise
This patch uses the theme's foreground color for text, unless the displayed page defines another textcolor. It fixes display of basic HTML pages without any stylesheet yet links are IMHO still too dark and probably need the same fix.
Since there are pages in the web which set textcolor but no background (apparently simply relying on the assumption that such pages are displayed with a white background a more complete patch could examine a page, try to figure if textcolor is set, while background is not and in that case switch to white background.
Or, even simpler, use white background as default and leave textcolor as-is (and annoy users with black color background themes ;) ).
This still exists in KDE 4.14.1 as in 2014! More than 12 years already! Created attachment 91374 [details]
Improper default colour in Konqueror
This shows the improper default colour in KDE. I am using the produkt colour scheme, but both rendering engine does not get all the colours right, leaving some unintelligible combination.
Dear user, KHTML (and KJS) was a long time more or less unmaintained and got removed in KF6. Please migrate to use a QWebEngine based HTML component. We will do no further fixes or improvements to the KF5 branches of these components beside important security fixes. For security issues, please see: https://kde.org/info/security/ Sorry that we did not fix this issue during the life-time of KHTML. Greetings Christoph Cullmann |