private function parseList(CSSList $oList, $bIsRoot = false) { while (!$this->isEnd()) { if ($this->comes('@')) { $oList->append($this->parseAtRule()); } else { if ($this->comes('}')) { $this->consume('}'); if ($bIsRoot) { throw new \Exception("Unopened {"); } else { return; } } else { if ($this->oParserSettings->bLenientParsing) { try { $oList->append($this->parseSelector()); } catch (UnexpectedTokenException $e) { } } else { $oList->append($this->parseSelector()); } } } $this->consumeWhiteSpace(); } if (!$bIsRoot) { throw new \Exception("Unexpected end of document"); } }
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) { $sResult = "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{"; $sResult .= parent::render($oOutputFormat); $sResult .= '}'; return $sResult; }
public function __toString() { $sResult = "@{$this->vendorKeyFrame} {$this->animationName} {"; $sResult .= parent::__toString(); $sResult .= '}'; return $sResult; }
private function parseListItem(CSSList $oList, $bIsRoot = false) { if ($this->comes('@')) { $oAtRule = $this->parseAtRule(); if ($oAtRule instanceof Charset) { if (!$bIsRoot) { throw new UnexpectedTokenException('@charset may only occur in root document', '', 'custom', $this->iLineNo); } if (count($oList->getContents()) > 0) { throw new UnexpectedTokenException('@charset must be the first parseable token in a document', '', 'custom', $this->iLineNo); } $this->setCharset($oAtRule->getCharset()->getString()); } return $oAtRule; } else { if ($this->comes('}')) { $this->consume('}'); if ($bIsRoot) { throw new SourceException("Unopened {", $this->iLineNo); } else { return null; } } else { return $this->parseSelector(); } } }
public function __construct($iLineNo = 0) { parent::__construct($iLineNo); }