Mnemonic Cascading Style Sheet parser (oil-csshandler)
General Info

Introduction
Screenshots
Mailing Lists and IRC
Alternative Browsers
Special Thanks

FAQ
Understanding Mnemonic
TODO list and ideas
Bug Reports


User Info

Download binaries
Platforms
Compiling Mnemonic
Other useful software


Developer Info

Core
Message modules
Library modules
Object modules
Coding Guidelines
Browse Source
Using CVS


View with any browser

Website questions to:
webmaster@mnemonic.org

Mnemonic questions to:
disc@mnemonic.org

 

Overview

The CSS handler takes care of the conversion of textual specification of a CSS stylesheet to an internal datastructure provided by lib-dom. It takes incoming textual data from the following sources:

  • It listens to msg_dom_create_event messages. When the associated document has a document type for which a default stylesheet is known, namely one of the HTML versions, the CSS handler starts to monitor this document.
  • It listens to msg_dom_mutation_event messages for HTML documents. Whenever a <STYLE> node is created, the CSS handler will add the information in its children to the current stylesheet.
  • It also scans style attributes for HTML documents on newly created nodes.
  • It also listens to all other msg_dom_mutation_event messages, for DOM trees which do not have a known document type. This is done in order to keep track of
    
    
    processing instructions.
When a link to an external stylesheet is encountered, like with the XML processing instruction. The CSS handler will request this document, listen to the incoming textual data and merge it with the style information already present.

The stylesheet information can be obtained from the CSSStyleSheet objects created by the CSS handler. These are announced using msg_css_create_event messages. The CSSStyleSheet object contains methods to determine the specified and computed style of any element in the associated DOM tree.