@@ -132,6 +132,7 @@ private function parseListItem(CSSList $oList, $bIsRoot = false) {
132
132
private function parseAtRule () {
133
133
$ this ->consume ('@ ' );
134
134
$ sIdentifier = $ this ->parseIdentifier ();
135
+ $ iIdentifierLineNum = $ this ->iLineNum ;
135
136
$ this ->consumeWhiteSpace ();
136
137
if ($ sIdentifier === 'import ' ) {
137
138
$ oLocation = $ this ->parseURLValue ();
@@ -141,14 +142,14 @@ private function parseAtRule() {
141
142
$ sMediaQuery = $ this ->consumeUntil ('; ' );
142
143
}
143
144
$ this ->consume ('; ' );
144
- return new Import ($ oLocation , $ sMediaQuery , $ this -> iLineNum );
145
+ return new Import ($ oLocation , $ sMediaQuery , $ iIdentifierLineNum );
145
146
} else if ($ sIdentifier === 'charset ' ) {
146
147
$ sCharset = $ this ->parseStringValue ();
147
148
$ this ->consumeWhiteSpace ();
148
149
$ this ->consume ('; ' );
149
- return new Charset ($ sCharset , $ this -> iLineNum );
150
+ return new Charset ($ sCharset , $ iIdentifierLineNum );
150
151
} else if ($ this ->identifierIs ($ sIdentifier , 'keyframes ' )) {
151
- $ oResult = new KeyFrame ($ this -> iLineNum );
152
+ $ oResult = new KeyFrame ($ iIdentifierLineNum );
152
153
$ oResult ->setVendorKeyFrame ($ sIdentifier );
153
154
$ oResult ->setAnimationName (trim ($ this ->consumeUntil ('{ ' , false , true )));
154
155
$ this ->consumeWhiteSpace ();
@@ -168,7 +169,7 @@ private function parseAtRule() {
168
169
if (!($ mUrl instanceof CSSString || $ mUrl instanceof URL )) {
169
170
throw new UnexpectedTokenException ('Wrong namespace url of invalid type ' , $ mUrl , 'custom ' );
170
171
}
171
- return new CSSNamespace ($ mUrl , $ sPrefix , $ this -> iLineNum );
172
+ return new CSSNamespace ($ mUrl , $ sPrefix , $ iIdentifierLineNum );
172
173
} else {
173
174
//Unknown other at rule (font-face or such)
174
175
$ sArgs = trim ($ this ->consumeUntil ('{ ' , false , true ));
@@ -181,10 +182,10 @@ private function parseAtRule() {
181
182
}
182
183
}
183
184
if ($ bUseRuleSet ) {
184
- $ oAtRule = new AtRuleSet ($ sIdentifier , $ sArgs , $ this -> iLineNum );
185
+ $ oAtRule = new AtRuleSet ($ sIdentifier , $ sArgs , $ iIdentifierLineNum );
185
186
$ this ->parseRuleSet ($ oAtRule );
186
187
} else {
187
- $ oAtRule = new AtRuleBlockList ($ sIdentifier , $ sArgs , $ this -> iLineNum );
188
+ $ oAtRule = new AtRuleBlockList ($ sIdentifier , $ sArgs , $ iIdentifierLineNum );
188
189
$ this ->parseList ($ oAtRule );
189
190
}
190
191
return $ oAtRule ;
0 commit comments