1 ;;; w3-style.el --- Emacs/W3 binding style sheet mechanism
2 ;; Author: $Author: fx $
3 ;; Created: $Date: 2001/10/11 13:04:58 $
4 ;; Version: $Revision: 1.4 $
5 ;; Keywords: faces, hypermedia
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8 ;;; Copyright (c) 1993 - 1996 by William M. Perry <wmperry@cs.indiana.edu>
9 ;;; Copyright (c) 1996 - 1999 Free Software Foundation, Inc.
11 ;;; This file is part of GNU Emacs.
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify
14 ;;; it under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 2, or (at your option)
16 ;;; any later version.
18 ;;; GNU Emacs is distributed in the hope that it will be useful,
19 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 ;;; Boston, MA 02111-1307, USA.
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
30 ;;; A style sheet mechanism for emacs-w3
32 ;;; This will eventually be able to under DSSSL[-lite] as well as the
33 ;;; experimental W3C mechanism
34 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
36 (eval-when-compile (require 'cl))
40 (defun w3-handle-style (&optional plist)
41 (let ((url (or (plist-get plist 'href)
42 (plist-get plist 'src)
43 (plist-get plist 'uri)))
44 (media (intern (downcase (or (plist-get plist 'media) "all"))))
45 (type (downcase (or (plist-get plist 'notation) "text/css")))
49 (cur-sheet w3-current-stylesheet)
50 (string (plist-get plist 'data)))
51 (if (not (memq media (css-active-device-types)))
52 nil ; Not applicable to us!
55 ((member type '("experimental" "arena" "w3c-style" "css" "text/css"))
56 (setq stylesheet (css-parse url string cur-sheet)))
58 (w3-warn 'html "Unknown stylesheet notation: %s" type))))
59 (setq w3-current-stylesheet stylesheet))))
62 (defun w3-display-stylesheet (&optional sheet)
63 "Display the stylesheet for the current document."
65 (setq sheet (or sheet w3-current-stylesheet w3-user-stylesheet))
67 (error "No stylesheet available!"))