33 'em' =>
true,
'ex' =>
true,
'px' =>
true,
'in' =>
true,
34 'cm' =>
true,
'mm' =>
true,
'pt' =>
true,
'pc' =>
true
43 $this->
n = (string)
$n;
44 $this->unit = $u !==
false ? (string) $u :
false;
52 public static function make($s)
57 $n_length = strspn($s,
'1234567890.+-');
58 $n = substr($s, 0, $n_length);
59 $unit = substr($s, $n_length);
63 return new HTMLPurifier_Length(
$n,
$unit);
73 if ($this->
n ===
'+0' || $this->
n ===
'-0') {
76 if ($this->
n ===
'0' && $this->unit ===
false) {
79 if (!ctype_lower($this->unit)) {
80 $this->unit = strtolower($this->unit);
87 $result = $def->validate($this->
n,
false,
false);
149 if ($l->unit !== $this->unit) {
151 $l = $converter->convert($l, $this->unit);
156 return $this->
n - $l->n;