function CSSDeclarations($endtoken) { $declarations = new CSSDeclarations(); $safe = 100; do { try { $this->whiteSpace(); if ($dec = $this->CSSDeclaration($endtoken)) { if ($this->backslashCommentHack) { $dec->setFilter('hidemac', true); } $declarations->add($dec); } if ($this->isNext(SCOL)) { $this->whiteSpace(); continue; } elseif (!$this->isEof() && !$this->is($endtoken)) { $this->error('trash between declarations?'); } else { break; } } catch (CSSParseError $e) { $this->skipUpTo(SCOL, $endtoken); if ($this->is($endtoken)) { break; } else { $this->nextToken(); } } } while ($safe--); return $declarations; }
function outputDeclarations(CSSDeclarations $decs, $ignorefilters = array()) { $prev = false; $out = '<div>'; foreach ($decs->getDeclarations() as $d) { if ($prev) { $out .= ';</div><div>'; } else { $prev = true; } $out .= $this->outputDeclaration($d); } return $out . '</div>'; }
function addVars(CSSDeclarations $decs) { $defs = $decs->getValues(); $this->vars = array_merge($this->vars, $defs); }