1<?php 2// $Header: /cvsroot/html2ps/css.text-decoration.inc.php,v 1.10 2006/09/07 18:38:14 Konstantin Exp $ 3 4/** 5 * TODO: correct inheritance 6 * 7 * This property describes decorations that are added to the text of 8 * an element using the element's color. When specified on an inline 9 * element, it affects all the boxes generated by that element; for 10 * all other elements, the decorations are propagated to an 11 * anonymous inline box that wraps all the in-flow inline children 12 * of the element, and to any block-level in-flow descendants. It is 13 * not, however, further propagated to floating and absolutely 14 * positioned descendants, nor to the contents of 'inline-table' and 15 * 'inline-block' descendants. 16 */ 17 18class CSSTextDecoration extends CSSPropertyHandler { 19 function CSSTextDecoration() { 20 $this->CSSPropertyHandler(true, true); 21 } 22 23 function default_value() { 24 return array("U"=>false, 25 "O"=>false, 26 "T"=>false); 27 } 28 29 function parse($value) { 30 if ($value === 'inherit') { 31 return CSS_PROPERTY_INHERIT; 32 }; 33 34 $parsed = $this->default_value(); 35 if (strstr($value,"overline") !== false) { $parsed['O'] = true; }; 36 if (strstr($value,"underline") !== false) { $parsed['U'] = true; }; 37 if (strstr($value,"line-through") !== false) { $parsed['T'] = true; }; 38 return $parsed; 39 } 40 41 function get_property_code() { 42 return CSS_TEXT_DECORATION; 43 } 44 45 function get_property_name() { 46 return 'text-decoration'; 47 } 48} 49 50CSS::register_css_property(new CSSTextDecoration); 51 52?> 53