comparison lisp/w3/css.el @ 98:0d2f883870bc r20-1b1

Import from CVS: tag r20-1b1
author cvs
date Mon, 13 Aug 2007 09:13:56 +0200
parents 859a2309aef8
children 441bb1e64a06
comparison
equal deleted inserted replaced
97:498bf5da1c90 98:0d2f883870bc
1 ;;; css.el -- Cascading Style Sheet parser 1 ;;; css.el -- Cascading Style Sheet parser
2 ;; Author: wmperry 2 ;; Author: wmperry
3 ;; Created: 1997/01/17 14:30:54 3 ;; Created: 1997/02/08 05:24:49
4 ;; Version: 1.25 4 ;; Version: 1.27
5 ;; Keywords: 5 ;; Keywords:
6 6
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu) 8 ;;; Copyright (c) 1996 by William M. Perry (wmperry@cs.indiana.edu)
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc. 9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
364 364
365 (defun css-expand-length (spec) 365 (defun css-expand-length (spec)
366 (cond 366 (cond
367 ((not (stringp spec)) spec) 367 ((not (stringp spec)) spec)
368 ((string-equal spec "auto") nil) 368 ((string-equal spec "auto") nil)
369 ((string-match "\([0-9]+\)%" spec) ; A percentage 369 ((string-match "\\([+-]?\\([0-9]+\\|[0-9]*\\.[0-9]+\\)\\)%" spec) ; A percentage
370 nil) 370 nil)
371 ((string-match "\([0-9]+\)e[mn]" spec) ; Character based 371 ((string-match "\\([+-]?\\([0-9]+\\|[0-9]*\\.[0-9]+\\)\\)e[mx]" spec) ; Character based
372 (string-to-int (substring spec (match-beginning 1) (match-end 1)))) 372 (max 0 (round (string-to-number (match-string 1 spec)))))
373 (t 373 (t
374 (truncate (font-spatial-to-canonical spec))) 374 (truncate (font-spatial-to-canonical spec)))
375 ) 375 )
376 ) 376 )
377 377