Commits

cthedot  committed f9e313b

refactoring and slight opt for unknown rules

  • Participants
  • Parent commits 75765da

Comments (0)

Files changed (1)

File src/cssutils/css/csspagerule.py

         cssRules = []
         
         for token in g:
-            if (token[0] == 'ATKEYWORD'):   
+            if token[0] == 'ATKEYWORD' and \
+               self._normalize(token[1]) in MarginRule.margins:
+                
+                # MarginRule                   
                 m = MarginRule(parentRule=self,
-                                  parentStyleSheet=self.parentStyleSheet)
+                               parentStyleSheet=self.parentStyleSheet)
                 m.cssText = chain([token], g)
                 
                 # merge if margin set more than once
                     cssRules.append(m)
                     
                 continue
-            
+                            
+            # TODO: Properties?
             styletokens.append(token)
 
         return cssRules, styletokens