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

List:       kfm-devel
Subject:    Next challenge: media support in <link> elements
From:       Martijn Klingens <mklingens () ism ! nl>
Date:       2001-09-28 12:06:12
[Download RAW message or body]

@media works, but before I post a patch here I want to add <link media="..."> 
and @import media ... support as well. This because I expect those two 
elements to affect the current code a bit. Maybe they don't, but I'd rather 
make sure.

Looking in the HTMLLinkElementImpl I found the following code:

-----
StyleSheetImpl *HTMLLinkElementImpl::sheet() const
{
    if ( khtml::printpainter ) {
        // we're currently printing, return all and print style sheets
        if( m_media.isNull() || m_media.contains("all") || 
m_media.contains("print") )
            return m_sheet;
    } else {
        if( m_media.isNull() || m_media.contains("screen") || 
m_media.contains("all") )
            return m_sheet;
    }
    return 0;
}
-----

Could be just me, but is this function actually called again once 
khtml::printpainter is set to true? I actually wonder if it is. Besides, this 
is not generic enough to be able to work with other media types.

For the @media support I added a setMediaType() call to XmlDocumentImpl, 
which works wonders for me and is truly generic.

Back to the real issue: is this above method indeed the method that I need to 
change for generic media support or should I remove the current 
implementation and add my code elsewhere?

Martijn

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

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