(CssAtRule atRule)
| 140 | .compile("@((keyframes)|(-moz-keyframes)|(-webkit-keyframes)|(-o-keyframes))"); |
| 141 | |
| 142 | @Override |
| 143 | public void startAtRule(CssAtRule atRule) |
| 144 | { |
| 145 | String ruleName = atRule.getName().get(); |
| 146 | this.atRule = atRule; |
| 147 | if (ruleName.equals("@import")) |
| 148 | { |
| 149 | CssConstruct uriOrString = atRule.getComponents().get(0); |
| 150 | if (uriOrString != null) |
| 151 | { |
| 152 | int line = uriOrString.getLocation().getLine(); |
| 153 | int col = uriOrString.getLocation().getColumn(); |
| 154 | String uri = null; |
| 155 | if (uriOrString.getType() == CssConstruct.Type.URI) |
| 156 | { |
| 157 | uri = ((CssURI) uriOrString).toUriString(); |
| 158 | } |
| 159 | else if (uriOrString.getType() == CssConstruct.Type.STRING) |
| 160 | { |
| 161 | uri = CharMatcher.anyOf("\"'").trimFrom(uriOrString.toCssString()); |
| 162 | } |
| 163 | else |
| 164 | { |
| 165 | // syntax error, url must be first parameter |
| 166 | } |
| 167 | if (uri != null) |
| 168 | { |
| 169 | resolveAndRegister(uri, line, col, atRule.toCssString(), Reference.Type.STYLESHEET); |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | else if (atRule.getName().get().equals("@namespace")) |
| 174 | { |
| 175 | // do not register namespace URIs as resources... |
| 176 | } |
| 177 | else |
| 178 | { |
| 179 | // check generically for urls in other atrules |
| 180 | registerURIs(atRule.getComponents(), atRule.getLocation().getLine(), |
| 181 | atRule.getLocation().getColumn()); |
| 182 | } |
| 183 | |
| 184 | if (ruleName.equals("@font-face")) |
| 185 | { |
| 186 | inFontFace = true; |
| 187 | } |
| 188 | else if (keyframesPattern.matcher(ruleName).matches()) |
| 189 | { |
| 190 | inKeyFrames = true; |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | @Override |
| 195 | public void endAtRule(String name) |
nothing calls this directly
no test coverage detected