예제 #1
0
 private function parseRule()
 {
     $oRule = new CSSRule($this->parseIdentifier());
     $this->consumeWhiteSpace();
     $this->consume(':');
     $oValue = $this->parseValue(self::listDelimiterForRule($oRule->getRule()));
     $oRule->setValue($oValue);
     if ($this->comes('!')) {
         $this->consume('!');
         $this->consumeWhiteSpace();
         $sImportantMarker = $this->consume(strlen('important'));
         if (mb_convert_case($sImportantMarker, MB_CASE_LOWER) !== 'important') {
             throw new Exception("! was followed by “" . $sImportantMarker . "”. Expected “important”");
         }
         $oRule->setIsImportant(true);
     }
     if ($this->comes(';')) {
         $this->consume(';');
     }
     return $oRule;
 }
예제 #2
0
 public function addRule(CSSRule $oRule)
 {
     $this->aRules[$oRule->getRule()] = $oRule;
 }