1. /*
  2. * Copyright (c) 2000 World Wide Web Consortium,
  3. * (Massachusetts Institute of Technology, Institut National de
  4. * Recherche en Informatique et en Automatique, Keio University). All
  5. * Rights Reserved. This program is distributed under the W3C's Software
  6. * Intellectual Property License. This program is distributed in the
  7. * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
  8. * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  9. * PURPOSE.
  10. * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  11. */
  12. package org.w3c.dom.css;
  13. import org.w3c.dom.DOMException;
  14. /**
  15. * The <code>CSSCharsetRule</code> interface represents a @charset rule in a
  16. * CSS style sheet. The value of the <code>encoding</code> attribute does
  17. * not affect the encoding of text data in the DOM objects; this encoding is
  18. * always UTF-16. After a stylesheet is loaded, the value of the
  19. * <code>encoding</code> attribute is the value found in the
  20. * <code>@charset</code> rule. If there was no <code>@charset</code> in the
  21. * original document, then no <code>CSSCharsetRule</code> is created. The
  22. * value of the <code>encoding</code> attribute may also be used as a hint
  23. * for the encoding used on serialization of the style sheet.
  24. * <p> The value of the @charset rule (and therefore of the
  25. * <code>CSSCharsetRule</code>) may not correspond to the encoding the
  26. * document actually came in; character encoding information e.g. in an HTTP
  27. * header, has priority (see CSS document representation) but this is not
  28. * reflected in the <code>CSSCharsetRule</code>.
  29. * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.
  30. * @since DOM Level 2
  31. */
  32. public interface CSSCharsetRule extends CSSRule {
  33. /**
  34. * The encoding information used in this <code>@charset</code> rule.
  35. * @exception DOMException
  36. * SYNTAX_ERR: Raised if the specified encoding value has a syntax error
  37. * and is unparsable.
  38. * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this encoding rule is
  39. * readonly.
  40. */
  41. public String getEncoding();
  42. public void setEncoding(String encoding)
  43. throws DOMException;
  44. }