JsoupCssInliner.java

1
package fr.sii.ogham.html.inliner.impl.jsoup;
2
3
import static fr.sii.ogham.core.util.HtmlUtils.getCssUrlFunctions;
4
import static fr.sii.ogham.core.util.HtmlUtils.relativize;
5
import static fr.sii.ogham.html.inliner.impl.jsoup.CssInlineUtils.isInlineModeAllowed;
6
7
import java.util.List;
8
import java.util.StringTokenizer;
9
import java.util.regex.Pattern;
10
11
import org.jsoup.Jsoup;
12
import org.jsoup.nodes.DataNode;
13
import org.jsoup.nodes.Document;
14
import org.jsoup.nodes.Element;
15
import org.jsoup.parser.Tag;
16
import org.jsoup.select.Elements;
17
import org.slf4j.Logger;
18
import org.slf4j.LoggerFactory;
19
20
import fr.sii.ogham.core.util.CssUrlFunction;
21
import fr.sii.ogham.html.inliner.CssInliner;
22
import fr.sii.ogham.html.inliner.CssInlinerConstants.InlineModes;
23
import fr.sii.ogham.html.inliner.ExternalCss;
24
25
public class JsoupCssInliner implements CssInliner {
26
	private static final Logger LOG = LoggerFactory.getLogger(JsoupCssInliner.class);
27
	
28
	private static final String HREF_ATTR = "href";
29
	private static final String TEMP_STYLE_ATTR = "data-cssstyle";
30
	private static final String STYLE_ATTR = "style";
31
	private static final String STYLE_TAG = "style";
32
	private static final String CSS_LINKS_SELECTOR = "link[rel*=\"stylesheet\"], link[type=\"text/css\"], link[href$=\".css\"]";
33
	private static final Pattern NEW_LINES = Pattern.compile("\n");
34
	private static final Pattern COMMENTS = Pattern.compile("/\\*.*?\\*/");
35
	private static final Pattern SPACES = Pattern.compile(" +");
36
	private static final String QUOTE_ENTITY = """;
37
38
	@Override
39
	public String inline(String htmlContent, List<ExternalCss> cssContents) {
40
		Document doc = Jsoup.parse(htmlContent);
41
42 1 1. inline : removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::internStyles → RUN_ERROR
		internStyles(doc, cssContents);
43
		String stylesheet = fetchStyles(doc);
44 1 1. inline : removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::extractStyles → RUN_ERROR
		extractStyles(doc, stylesheet);
45 1 1. inline : removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::applyStyles → RUN_ERROR
		applyStyles(doc);
46
47 1 1. inline : replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::inline → RUN_ERROR
		return doc.outerHtml();
48
	}
49
50
	/**
51
	 * Applies the styles to a <code>data-cssstyle</code> attribute. This is
52
	 * because the styles need to be applied sequentially, but before the
53
	 * <code>style</code> defined for the element inline.
54
	 *
55
	 * @param doc
56
	 *            the html document
57
	 */
58
	private static void extractStyles(Document doc, String stylesheet) {
59
		String cleanedStylesheet = ignoreAtRules(stylesheet);
60
		cleanedStylesheet = NEW_LINES.matcher(cleanedStylesheet).replaceAll("");
61
		cleanedStylesheet = COMMENTS.matcher(cleanedStylesheet).replaceAll("");
62
		cleanedStylesheet = SPACES.matcher(cleanedStylesheet).replaceAll(" ");
63
		String styleRules = cleanedStylesheet.trim();
64
		String delims = "{}";
65
		StringTokenizer st = new StringTokenizer(styleRules, delims);
66 2 1. extractStyles : negated conditional → RUN_ERROR
2. extractStyles : changed conditional boundary → RUN_ERROR
		while (st.countTokens() > 1) {
67
			String selector = st.nextToken();
68
			String properties = st.nextToken();
69
			Elements selectedElements = doc.select(selector.trim());
70
			for (Element selElem : selectedElements) {
71
				String oldProperties = selElem.attr(TEMP_STYLE_ATTR);
72 2 1. extractStyles : changed conditional boundary → RUN_ERROR
2. extractStyles : negated conditional → RUN_ERROR
				selElem.attr(TEMP_STYLE_ATTR, oldProperties.length() > 0 ? concatenateProperties(oldProperties, properties) : properties);
73
			}
74
		}
75
	}
76
	
77
	/**
78
	 * Replace link tags with style tags in order to keep the same inclusion
79
	 * order
80
	 *
81
	 * @param doc
82
	 *            the html document
83
	 * @param cssContents
84
	 *            the list of external css files with their content
85
	 */
86
	private static void internStyles(Document doc, List<ExternalCss> cssContents) {
87
		Elements els = doc.select(CSS_LINKS_SELECTOR);
88
		for (Element e : els) {
89 1 1. internStyles : negated conditional → RUN_ERROR
			if (isInlineModeAllowed(e, InlineModes.STYLE_ATTR)) {
90
				String path = e.attr(HREF_ATTR);
91
				ExternalCss css = getCss(cssContents, path);
92 1 1. internStyles : negated conditional → RUN_ERROR
				if (css != null) {
93
					Element style = new Element(Tag.valueOf(STYLE_TAG), "");
94
					style.appendChild(new DataNode(getCssContent(css)));
95 1 1. internStyles : removed call to org/jsoup/nodes/Element::replaceWith → RUN_ERROR
					e.replaceWith(style);
96
				}
97
			}
98
		}
99
	}
100
101
	private static ExternalCss getCss(List<ExternalCss> cssContents, String path) {
102
		for (ExternalCss css : cssContents) {
103 1 1. getCss : negated conditional → RUN_ERROR
			if (css.getPath().getOriginalPath().contains(path)) {
104 1 1. getCss : replaced return value with null for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::getCss → RUN_ERROR
				return css;
105
			}
106
		}
107
		return null;
108
	}
109
110
	/**
111
	 * Generates a stylesheet from an html document
112
	 *
113
	 * @param doc
114
	 *            the html document
115
	 * @return a string representing the stylesheet.
116
	 */
117
	private static String fetchStyles(Document doc) {
118
		Elements els = doc.select(STYLE_TAG);
119
		StringBuilder styles = new StringBuilder();
120
		for (Element e : els) {
121 1 1. fetchStyles : negated conditional → RUN_ERROR
			if (isInlineModeAllowed(e, InlineModes.STYLE_ATTR)) {
122
				styles.append(e.data());
123 1 1. fetchStyles : removed call to org/jsoup/nodes/Element::remove → RUN_ERROR
				e.remove();
124
			}
125
		}
126 1 1. fetchStyles : replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::fetchStyles → RUN_ERROR
		return styles.toString();
127
	}
128
129
	/**
130
	 * Transfers styles from the <code>data-cssstyle</code> attribute to the
131
	 * <code>style</code> attribute.
132
	 *
133
	 * @param doc
134
	 *            the html document
135
	 */
136
	private static void applyStyles(Document doc) {
137
		Elements allStyledElements = doc.getElementsByAttribute(TEMP_STYLE_ATTR);
138
139
		for (Element e : allStyledElements) {
140 1 1. applyStyles : negated conditional → RUN_ERROR
			if (isInlineModeAllowed(e, InlineModes.STYLE_ATTR)) {
141
				String newStyle = e.attr(TEMP_STYLE_ATTR);
142
				String oldStyle = e.attr(STYLE_ATTR);
143
				e.attr(STYLE_ATTR, (trimAll(newStyle) + ";" + trimAll(oldStyle)).replaceAll(";+", ";").trim());
144
			}
145
			e.removeAttr(TEMP_STYLE_ATTR);
146
		}
147
	}
148
149
	private static String concatenateProperties(String oldProp, String newProp) {
150
		String prop = oldProp;
151 1 1. concatenateProperties : negated conditional → RUN_ERROR
		if (!prop.endsWith(";")) {
152
			prop += ";";
153
		}
154 1 1. concatenateProperties : replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::concatenateProperties → RUN_ERROR
		return trimAll(prop) + " " + trimAll(newProp) + ";";
155
	}
156
	
157
	private static String trimAll(String str) {
158 1 1. trimAll : replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::trimAll → RUN_ERROR
		return str.replaceAll("\\s+", " ").trim();
159
	}
160
	
161
162
	private static String ignoreAtRules(String stylesheet) {
163
		StringBuilder sb = new StringBuilder();
164
		AtRuleParserContext ctx = new AtRuleParserContext();
165 2 1. ignoreAtRules : negated conditional → RUN_ERROR
2. ignoreAtRules : changed conditional boundary → RUN_ERROR
		for (int i=0 ; i<stylesheet.length() ; i++) {
166
			char c = stylesheet.charAt(i);
167 1 1. ignoreAtRules : removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::updateLineNumberIfNewLine → RUN_ERROR
			updateLineNumberIfNewLine(ctx, c);
168 1 1. ignoreAtRules : removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::markAsStartOfAtRuleIfAtChar → RUN_ERROR
			markAsStartOfAtRuleIfAtChar(ctx, c);
169 1 1. ignoreAtRules : removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::markAsStartOfNestedAtRuleIfAlreadyInAtRuleAndIsOpeningBracket → RUN_ERROR
			markAsStartOfNestedAtRuleIfAlreadyInAtRuleAndIsOpeningBracket(ctx, c);
170 1 1. ignoreAtRules : removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket → RUN_ERROR
			markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket(ctx, c);
171 1 1. ignoreAtRules : negated conditional → RUN_ERROR
			if (ignoreAtRuleIfAtEndOfAtRule(ctx, c)) {
172
				continue;
173
			}
174 1 1. ignoreAtRules : removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::updateStylesAndAtRuleContent → RUN_ERROR
			updateStylesAndAtRuleContent(ctx, sb, c);
175
		}
176 1 1. ignoreAtRules : replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::ignoreAtRules → RUN_ERROR
		return sb.toString();
177
	}
178
179
	private static boolean ignoreAtRuleIfAtEndOfAtRule(AtRuleParserContext ctx, char c) {
180 3 1. ignoreAtRuleIfAtEndOfAtRule : negated conditional → RUN_ERROR
2. ignoreAtRuleIfAtEndOfAtRule : negated conditional → RUN_ERROR
3. ignoreAtRuleIfAtEndOfAtRule : negated conditional → RUN_ERROR
		if (ctx.inAtRule && !ctx.inNestedAtRule && c == ';') {
181
			ctx.inAtRule = false;
182
			LOG.warn("{} rule is not handled by JsoupCssInliner implementation. Line {}:'{}' is skipped", rulename(ctx.rule), ctx.startLineOfCurrentAtRule, ctx.rule);
183 1 1. ignoreAtRuleIfAtEndOfAtRule : replaced boolean return with false for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::ignoreAtRuleIfAtEndOfAtRule → RUN_ERROR
			return true;
184
		}
185 3 1. ignoreAtRuleIfAtEndOfAtRule : negated conditional → RUN_ERROR
2. ignoreAtRuleIfAtEndOfAtRule : negated conditional → RUN_ERROR
3. ignoreAtRuleIfAtEndOfAtRule : negated conditional → RUN_ERROR
		if (ctx.inAtRule && ctx.inNestedAtRule && ctx.numberOfOpenedAtRules == 0) {
186
			ctx.inAtRule = false;
187
			ctx.inNestedAtRule = false;
188
			LOG.warn("{} rule is not handled by JsoupCssInliner implementation. Lines {}-{} are skipped", rulename(ctx.rule), ctx.startLineOfCurrentAtRule, ctx.line);
189 1 1. ignoreAtRuleIfAtEndOfAtRule : replaced boolean return with false for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::ignoreAtRuleIfAtEndOfAtRule → RUN_ERROR
			return true;
190
		}
191 1 1. ignoreAtRuleIfAtEndOfAtRule : replaced boolean return with true for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::ignoreAtRuleIfAtEndOfAtRule → RUN_ERROR
		return false;
192
	}
193
194
	private static void updateStylesAndAtRuleContent(AtRuleParserContext ctx, StringBuilder sb, char c) {
195 1 1. updateStylesAndAtRuleContent : negated conditional → RUN_ERROR
		if (!ctx.inAtRule) {
196
			sb.append(c);
197
			ctx.rule = new StringBuilder();
198
		} else {
199
			ctx.rule.append(c);
200
		}
201
	}
202
203
	private static void markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket(AtRuleParserContext ctx, char c) {
204 3 1. markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket : negated conditional → RUN_ERROR
2. markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket : negated conditional → RUN_ERROR
3. markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket : negated conditional → RUN_ERROR
		if (ctx.inAtRule && ctx.inNestedAtRule && c == '}') {
205 1 1. markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket : Replaced integer subtraction with addition → RUN_ERROR
			ctx.numberOfOpenedAtRules--;
206
		}
207
	}
208
209
	private static void markAsStartOfNestedAtRuleIfAlreadyInAtRuleAndIsOpeningBracket(AtRuleParserContext ctx, char c) {
210 2 1. markAsStartOfNestedAtRuleIfAlreadyInAtRuleAndIsOpeningBracket : negated conditional → RUN_ERROR
2. markAsStartOfNestedAtRuleIfAlreadyInAtRuleAndIsOpeningBracket : negated conditional → RUN_ERROR
		if (ctx.inAtRule && c == '{') {
211
			ctx.inNestedAtRule = true;
212 1 1. markAsStartOfNestedAtRuleIfAlreadyInAtRuleAndIsOpeningBracket : Replaced integer addition with subtraction → RUN_ERROR
			ctx.numberOfOpenedAtRules++;
213
		}
214
	}
215
216
	private static void markAsStartOfAtRuleIfAtChar(AtRuleParserContext ctx, char c) {
217 2 1. markAsStartOfAtRuleIfAtChar : negated conditional → RUN_ERROR
2. markAsStartOfAtRuleIfAtChar : negated conditional → RUN_ERROR
		if (c == '@' && !ctx.inAtRule) {
218
			ctx.inAtRule = true;
219
			ctx.startLineOfCurrentAtRule = ctx.line;
220
		}
221
	}
222
223
	private static void updateLineNumberIfNewLine(AtRuleParserContext ctx, char c) {
224 1 1. updateLineNumberIfNewLine : negated conditional → RUN_ERROR
		if (c == '\n') {
225 1 1. updateLineNumberIfNewLine : Replaced integer addition with subtraction → RUN_ERROR
			ctx.line++;
226
		}
227
	}
228
	
229
	private static String rulename(StringBuilder rule) {
230
		StringBuilder name = new StringBuilder();
231 2 1. rulename : negated conditional → RUN_ERROR
2. rulename : changed conditional boundary → RUN_ERROR
		for (int i=0 ; i<rule.length() ; i++) {
232
			char c = rule.charAt(i);
233 4 1. rulename : negated conditional → RUN_ERROR
2. rulename : negated conditional → RUN_ERROR
3. rulename : negated conditional → RUN_ERROR
4. rulename : negated conditional → RUN_ERROR
			if (c != '@' && c != '-' && !Character.isAlphabetic(c) && !Character.isDigit(c)) {
234
				break;
235
			}
236
			name.append(c);
237
		}
238 1 1. rulename : replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::rulename → RUN_ERROR
		return name.toString();
239
	}
240
241
242
	private static String getCssContent(ExternalCss css) {
243
		String content = css.getContent();
244 1 1. getCssContent : replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::getCssContent → RUN_ERROR
		return updateRelativeUrls(content, css);
245
	}
246
247
	private static String updateRelativeUrls(String content, ExternalCss css) {
248
		String newContent = content;
249
		for (CssUrlFunction match : getCssUrlFunctions(content, QUOTE_ENTITY)) {
250
			newContent = match.rewriteUrl(newContent, relativize(css.getPath().getOriginalPath(), match.getUrl()));
251
		}
252 1 1. updateRelativeUrls : replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::updateRelativeUrls → RUN_ERROR
		return newContent;
253
	}
254
255
	private static class AtRuleParserContext {
256
		protected int line;
257
		protected int startLineOfCurrentAtRule;
258
		protected boolean inAtRule;
259
		protected boolean inNestedAtRule;
260
		protected int numberOfOpenedAtRules;
261
		protected StringBuilder rule;
262
		
263
		public AtRuleParserContext() {
264
			super();
265
			this.line = 1;
266
			this.startLineOfCurrentAtRule = 0;
267
			this.inAtRule = false;
268
			this.inNestedAtRule = false;
269
			this.numberOfOpenedAtRules = 0;
270
			this.rule = new StringBuilder();
271
		}
272
		
273
		
274
	}
275
}

Mutations

42

1.1
Location : inline
Killed by :
removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::internStyles → RUN_ERROR

44

1.1
Location : inline
Killed by :
removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::extractStyles → RUN_ERROR

45

1.1
Location : inline
Killed by :
removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::applyStyles → RUN_ERROR

47

1.1
Location : inline
Killed by :
replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::inline → RUN_ERROR

66

1.1
Location : extractStyles
Killed by :
negated conditional → RUN_ERROR

2.2
Location : extractStyles
Killed by :
changed conditional boundary → RUN_ERROR

72

1.1
Location : extractStyles
Killed by :
changed conditional boundary → RUN_ERROR

2.2
Location : extractStyles
Killed by :
negated conditional → RUN_ERROR

89

1.1
Location : internStyles
Killed by :
negated conditional → RUN_ERROR

92

1.1
Location : internStyles
Killed by :
negated conditional → RUN_ERROR

95

1.1
Location : internStyles
Killed by :
removed call to org/jsoup/nodes/Element::replaceWith → RUN_ERROR

103

1.1
Location : getCss
Killed by :
negated conditional → RUN_ERROR

104

1.1
Location : getCss
Killed by :
replaced return value with null for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::getCss → RUN_ERROR

121

1.1
Location : fetchStyles
Killed by :
negated conditional → RUN_ERROR

123

1.1
Location : fetchStyles
Killed by :
removed call to org/jsoup/nodes/Element::remove → RUN_ERROR

126

1.1
Location : fetchStyles
Killed by :
replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::fetchStyles → RUN_ERROR

140

1.1
Location : applyStyles
Killed by :
negated conditional → RUN_ERROR

151

1.1
Location : concatenateProperties
Killed by :
negated conditional → RUN_ERROR

154

1.1
Location : concatenateProperties
Killed by :
replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::concatenateProperties → RUN_ERROR

158

1.1
Location : trimAll
Killed by :
replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::trimAll → RUN_ERROR

165

1.1
Location : ignoreAtRules
Killed by :
negated conditional → RUN_ERROR

2.2
Location : ignoreAtRules
Killed by :
changed conditional boundary → RUN_ERROR

167

1.1
Location : ignoreAtRules
Killed by :
removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::updateLineNumberIfNewLine → RUN_ERROR

168

1.1
Location : ignoreAtRules
Killed by :
removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::markAsStartOfAtRuleIfAtChar → RUN_ERROR

169

1.1
Location : ignoreAtRules
Killed by :
removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::markAsStartOfNestedAtRuleIfAlreadyInAtRuleAndIsOpeningBracket → RUN_ERROR

170

1.1
Location : ignoreAtRules
Killed by :
removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket → RUN_ERROR

171

1.1
Location : ignoreAtRules
Killed by :
negated conditional → RUN_ERROR

174

1.1
Location : ignoreAtRules
Killed by :
removed call to fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::updateStylesAndAtRuleContent → RUN_ERROR

176

1.1
Location : ignoreAtRules
Killed by :
replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::ignoreAtRules → RUN_ERROR

180

1.1
Location : ignoreAtRuleIfAtEndOfAtRule
Killed by :
negated conditional → RUN_ERROR

2.2
Location : ignoreAtRuleIfAtEndOfAtRule
Killed by :
negated conditional → RUN_ERROR

3.3
Location : ignoreAtRuleIfAtEndOfAtRule
Killed by :
negated conditional → RUN_ERROR

183

1.1
Location : ignoreAtRuleIfAtEndOfAtRule
Killed by :
replaced boolean return with false for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::ignoreAtRuleIfAtEndOfAtRule → RUN_ERROR

185

1.1
Location : ignoreAtRuleIfAtEndOfAtRule
Killed by :
negated conditional → RUN_ERROR

2.2
Location : ignoreAtRuleIfAtEndOfAtRule
Killed by :
negated conditional → RUN_ERROR

3.3
Location : ignoreAtRuleIfAtEndOfAtRule
Killed by :
negated conditional → RUN_ERROR

189

1.1
Location : ignoreAtRuleIfAtEndOfAtRule
Killed by :
replaced boolean return with false for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::ignoreAtRuleIfAtEndOfAtRule → RUN_ERROR

191

1.1
Location : ignoreAtRuleIfAtEndOfAtRule
Killed by :
replaced boolean return with true for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::ignoreAtRuleIfAtEndOfAtRule → RUN_ERROR

195

1.1
Location : updateStylesAndAtRuleContent
Killed by :
negated conditional → RUN_ERROR

204

1.1
Location : markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket
Killed by :
negated conditional → RUN_ERROR

2.2
Location : markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket
Killed by :
negated conditional → RUN_ERROR

3.3
Location : markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket
Killed by :
negated conditional → RUN_ERROR

205

1.1
Location : markAsEndOfNestedAtRuleIfAlreadyInAtRuleAndIsClosingBracket
Killed by :
Replaced integer subtraction with addition → RUN_ERROR

210

1.1
Location : markAsStartOfNestedAtRuleIfAlreadyInAtRuleAndIsOpeningBracket
Killed by :
negated conditional → RUN_ERROR

2.2
Location : markAsStartOfNestedAtRuleIfAlreadyInAtRuleAndIsOpeningBracket
Killed by :
negated conditional → RUN_ERROR

212

1.1
Location : markAsStartOfNestedAtRuleIfAlreadyInAtRuleAndIsOpeningBracket
Killed by :
Replaced integer addition with subtraction → RUN_ERROR

217

1.1
Location : markAsStartOfAtRuleIfAtChar
Killed by :
negated conditional → RUN_ERROR

2.2
Location : markAsStartOfAtRuleIfAtChar
Killed by :
negated conditional → RUN_ERROR

224

1.1
Location : updateLineNumberIfNewLine
Killed by :
negated conditional → RUN_ERROR

225

1.1
Location : updateLineNumberIfNewLine
Killed by :
Replaced integer addition with subtraction → RUN_ERROR

231

1.1
Location : rulename
Killed by :
negated conditional → RUN_ERROR

2.2
Location : rulename
Killed by :
changed conditional boundary → RUN_ERROR

233

1.1
Location : rulename
Killed by :
negated conditional → RUN_ERROR

2.2
Location : rulename
Killed by :
negated conditional → RUN_ERROR

3.3
Location : rulename
Killed by :
negated conditional → RUN_ERROR

4.4
Location : rulename
Killed by :
negated conditional → RUN_ERROR

238

1.1
Location : rulename
Killed by :
replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::rulename → RUN_ERROR

244

1.1
Location : getCssContent
Killed by :
replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::getCssContent → RUN_ERROR

252

1.1
Location : updateRelativeUrls
Killed by :
replaced return value with "" for fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner::updateRelativeUrls → RUN_ERROR

Active mutators

Tests examined


Report generated by PIT 1.13.1