MDL-32081 csslib: Improved handling of parentheses when processing styles

This commit is contained in:
Sam Hemelryk
2012-03-30 10:20:59 +13:00
parent 897ad664e4
commit 50e49c917d
+22
View File
@@ -638,6 +638,13 @@ class css_optimiser {
}
switch ($char) {
case ';':
if ($inparenthesis) {
$buffer .= $char;
// continue 1: The switch processing chars
// continue 2: The switch processing the state
// continue 3: The for loop
continue 3;
}
$currentrule->add_style($buffer);
$buffer = '';
$inquotes = false;
@@ -656,6 +663,21 @@ class css_optimiser {
$this->rawrules++;
$buffer = '';
$inquotes = false;
$inparenthesis = false;
// continue 1: The switch processing chars
// continue 2: The switch processing the state
// continue 3: The for loop
continue 3;
case '(':
$inparenthesis = true;
$buffer .= $char;
// continue 1: The switch processing chars
// continue 2: The switch processing the state
// continue 3: The for loop
continue 3;
case ')':
$inparenthesis = false;
$buffer .= $char;
// continue 1: The switch processing chars
// continue 2: The switch processing the state
// continue 3: The for loop