[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: CSS media type support
From:       Michael =?iso-8859-1?q?H=E4ckel?= <haeckel () kde ! org>
Date:       2001-11-15 19:46:04
[Download RAW message or body]

On Thursday 15 November 2001 20:04, Martijn Klingens wrote:
>
> Ehm? I wrote the CSS Media code because the app I'm developing at work
> needs it... and it uses KHTMLPart... So unless something serious broke the
> last few days since my last cvs up it should 'just work'.

The problem is actually, that something is not loaded for the screen.

What is also strange, that it works in Konqueror. I added a kdDebug call in 
khtml and put the exact html code in a html file for testing. Some time ago I 
had a different problem about something working in Konqueror but not from 
KMail and the problem were some "\n" characters. But removing them also 
doens't help.

I basically want to do something like:
<style type="text/css">
@media screen
{
  table.encr { background-color: #33cc33; border-width: 0px; }
  tr.encrH { background-color: #40ff40; font-weight: bold; }
  tr.encrB { background-color: #e8ffe8; }
}
</style>
<body>
<table><tr class="encrH"><td>Some text</td></tr></table>
</body>

In the case of printing encrH should then not be defined and the background 
colour default to white.

Trivial test patch for KMail attached, for the case you are interested.

Regards,
Michael Häckel
["media.diff" (text/x-diff)]

? space.diff
? media.diff
Index: kmreaderwin.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmreaderwin.cpp,v
retrieving revision 1.336
diff -u -3 -p -r1.336 kmreaderwin.cpp
--- kmreaderwin.cpp	2001/11/15 05:31:36	1.336
+++ kmreaderwin.cpp	2001/11/15 19:44:28
@@ -614,8 +614,8 @@ void KMReaderWin::parseMsg(void)
                          "color: #%3; background-color: #%4; }\n")
                  .arg( mBodyFamily ).arg( fntSize ).arg(colorToString(c1)).arg(colorToString(c4)) +
 		 QString("a { color: #%1; ").arg(colorToString(c2)) +
-		 "text-decoration: none; }" + // just playing
-                 QString( "table.encr { background-color: #%1; "
+		 "text-decoration: none; } " + // just playing
+                 QString( "@media screen { table.encr { background-color: #%1; "
                           "border-width: 0px; }\n" )
                  .arg( colorToString( cPgpOkF ) ) +
                  QString( "tr.encrH { background-color: #%1; "
@@ -645,7 +645,7 @@ void KMReaderWin::parseMsg(void)
                  QString( "tr.signErrH { background-color: #%1; "
                           "font-weight: bold; }\n" )
                  .arg( colorToString( cPgpErrH ) ) +
-                 QString( "tr.signErrB { background-color: #%1; }\n" )
+                 QString( "tr.signErrB { background-color: #%1; } }\n" )
                  .arg( colorToString( cPgpErrB ) ) +
 		 "</style></head><body " +
 		 // TODO: move these to stylesheet, too:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic