3 namespace Sabberworm\CSS\Property
;
6 * Class representing an @charset rule.
7 * The following restrictions apply:
8 * • May not be found in any CSSList other than the Document.
9 * • May only appear at the very top of a Document’s contents.
10 * • Must not appear more than once.
12 class Charset
implements AtRule
{
18 public function __construct($sCharset, $iLineNo = 0) {
19 $this->sCharset
= $sCharset;
20 $this->iLineNo
= $iLineNo;
21 $this->aComments
= array();
27 public function getLineNo() {
28 return $this->iLineNo
;
31 public function setCharset($sCharset) {
32 $this->sCharset
= $sCharset;
35 public function getCharset() {
36 return $this->sCharset
;
39 public function __toString() {
40 return $this->render(new \Sabberworm\CSS\
OutputFormat());
43 public function render(\Sabberworm\CSS\OutputFormat
$oOutputFormat) {
44 return "@charset {$this->sCharset->render($oOutputFormat)};";
47 public function atRuleName() {
51 public function atRuleArgs() {
52 return $this->sCharset
;
55 public function addComments(array $aComments) {
56 $this->aComments
= array_merge($this->aComments
, $aComments);
59 public function getComments() {
60 return $this->aComments
;
63 public function setComments(array $aComments) {
64 $this->aComments
= $aComments;