From 745437791ac6a96458fa344b96e1bb7809d945e8 Mon Sep 17 00:00:00 2001 From: melloware Date: Tue, 19 Jul 2022 16:38:09 -0400 Subject: [PATCH] Fix #81: Revert #77 pseudo spacing --- .../optimizerplugin/optimizer/CssCompressor.java | 4 ++-- src/test/resources/bug2527974.css.min | 2 +- src/test/resources/bug2528034.css.min | 2 +- src/test/resources/issue334.css | 8 ++++++-- src/test/resources/issue334.css.min | 2 +- src/test/resources/lowercasing.css.min | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/primefaces/extensions/optimizerplugin/optimizer/CssCompressor.java b/src/main/java/org/primefaces/extensions/optimizerplugin/optimizer/CssCompressor.java index f53cd6f..94745c6 100644 --- a/src/main/java/org/primefaces/extensions/optimizerplugin/optimizer/CssCompressor.java +++ b/src/main/java/org/primefaces/extensions/optimizerplugin/optimizer/CssCompressor.java @@ -305,7 +305,7 @@ public void compress(Writer out, int linebreakpos) throws IOException { "(?i):(active|after|before|checked|disabled|empty|enabled|first-(?:child|of-type)|focus|hover|last-(?:child|of-type)|link|only-(?:child|of-type)|root|:selection|target|visited)"); m = p.matcher(css); while (m.find()) { - m.appendReplacement(sb, " :" + m.group(1).toLowerCase()); + m.appendReplacement(sb, ":" + m.group(1).toLowerCase()); } m.appendTail(sb); css = normalizeSpace(sb.toString()); @@ -316,7 +316,7 @@ public void compress(Writer out, int linebreakpos) throws IOException { "(?i):(lang|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|(?:-(?:moz|webkit)-)?any)\\("); m = p.matcher(css); while (m.find()) { - m.appendReplacement(sb, " :" + m.group(1).toLowerCase() + '('); + m.appendReplacement(sb, ":" + m.group(1).toLowerCase() + '('); } m.appendTail(sb); css = normalizeSpace(sb.toString()); diff --git a/src/test/resources/bug2527974.css.min b/src/test/resources/bug2527974.css.min index bbb1840..00cc007 100644 --- a/src/test/resources/bug2527974.css.min +++ b/src/test/resources/bug2527974.css.min @@ -1 +1 @@ -/*! $LastChangedRevision: 81 $ $LastChangedDate: 2009-05-27 17:41:02 +0100 (Wed, 27 May 2009) $ */body{yo:cats}ul[id$=foo] label :hover{yo:yo} \ No newline at end of file +/*! $LastChangedRevision: 81 $ $LastChangedDate: 2009-05-27 17:41:02 +0100 (Wed, 27 May 2009) $ */body{yo:cats}ul[id$=foo] label:hover{yo:yo} \ No newline at end of file diff --git a/src/test/resources/bug2528034.css.min b/src/test/resources/bug2528034.css.min index f984509..1543777 100644 --- a/src/test/resources/bug2528034.css.min +++ b/src/test/resources/bug2528034.css.min @@ -1 +1 @@ -a[href$="/test/"] span :first-child{b:1} \ No newline at end of file +a[href$="/test/"] span:first-child{b:1} \ No newline at end of file diff --git a/src/test/resources/issue334.css b/src/test/resources/issue334.css index 25f143d..a08aa1f 100644 --- a/src/test/resources/issue334.css +++ b/src/test/resources/issue334.css @@ -1,7 +1,11 @@ @media screen and (-ms-high-contrast: none) { - body :focus { + body :FOCUS { outline: 2px solid #5e9ed6; } } -@media screen and (-ms-high-contrast: none) { .content :not(.test) { outline: 2px solid #5e9ed6; } } \ No newline at end of file +@media screen and (-ms-high-contrast: none) { .content :not(.test) { outline: 2px solid #5e9ed6; } } + +.handsontable.htRowHeaders thead tr th:nth-child(2) { + border-left: 1px solid #CCC; +} \ No newline at end of file diff --git a/src/test/resources/issue334.css.min b/src/test/resources/issue334.css.min index ceb37dd..77f941a 100644 --- a/src/test/resources/issue334.css.min +++ b/src/test/resources/issue334.css.min @@ -1 +1 @@ -@media screen and (-ms-high-contrast:none){body :focus{outline:2px solid #5e9ed6}}@media screen and (-ms-high-contrast:none){.content :not(.test){outline:2px solid #5e9ed6}} \ No newline at end of file +@media screen and (-ms-high-contrast:none){body:focus{outline:2px solid #5e9ed6}}@media screen and (-ms-high-contrast:none){.content:not(.test){outline:2px solid #5e9ed6}}.handsontable.htRowHeaders thead tr th:nth-child(2){border-left:1px solid #CCC} \ No newline at end of file diff --git a/src/test/resources/lowercasing.css.min b/src/test/resources/lowercasing.css.min index 3dac64b..468f677 100644 --- a/src/test/resources/lowercasing.css.min +++ b/src/test/resources/lowercasing.css.min @@ -1 +1 @@ -@charset "UTF-8";@font-face{FONT-FAMILY:"YOUR FACE"}@import "HTTP://DOMAIN.TLD/OTHER.CSS";@media print{background:0;background-position:0 0}@page{CONTENT:attr(HREF);HEIGHT:max(0,min(10,20));WIDTH:calc(50% - 10PX)}@namespace XHTML "HTTP://WWW.W3.ORG/1999/XHTML";a :active,a :after,a :before,a :checked,a :disabled,a :empty,a :enabled,a :first-child,a:first-letter ,a:first-line ,a :first-of-type,a :focus,a :hover,a :last-child,a :last-of-type,a :link,a :only-child,a :only-of-type,a :root,a ::selection,a :target,a :visited,a :any(A,B,I) STRONG,a :lang(FR),a :not([HIDDEN]),a :nth-child(2),a :nth-last-child(2),a :nth-last-of-type(2),a :nth-of-type(2){BACKGROUND:url(PROTO://DOMAIN.TLD/PATH),repeating-linear-gradient(20DEG,GRAY,GREEN,20PX,WHITE 40PX),-atsc-linear-gradient(LEFT,BLACK,WHITE),-khtml-radial-gradient(CENTER 50DEG,CIRCLE CLOSEST-SIDE,BLACK 0,GREEN 100%),-moz-radial-gradient(CENTER 45DEG,CIRCLE CLOSEST-SIDE,ORANGE 0,RED 100%),-ms-linear-gradient(LEFT,BLUE,BLACK),-o-repeating-radial-gradient(CENTER,CIRCLE CLOSEST-SIDE,PAPAYAWHIP,RED 50%,GAINSBORO),-wap-linear-gradient(LEFT,BLACK,WHITE),-webkit-gradient(LINEAR,LEFT,from(WHITE),to(rgba(1,2,3,.4)))} \ No newline at end of file +@charset "UTF-8";@font-face{FONT-FAMILY:"YOUR FACE"}@import "HTTP://DOMAIN.TLD/OTHER.CSS";@media print{background:0;background-position:0 0}@page{CONTENT:attr(HREF);HEIGHT:max(0,min(10,20));WIDTH:calc(50% - 10PX)}@namespace XHTML "HTTP://WWW.W3.ORG/1999/XHTML";a:active,a:after,a:before,a:checked,a:disabled,a:empty,a:enabled,a:first-child,a:first-letter ,a:first-line ,a:first-of-type,a:focus,a:hover,a:last-child,a:last-of-type,a:link,a:only-child,a:only-of-type,a:root,a::selection,a:target,a:visited,a:any(A,B,I) STRONG,a:lang(FR),a:not([HIDDEN]),a:nth-child(2),a:nth-last-child(2),a:nth-last-of-type(2),a:nth-of-type(2){BACKGROUND:url(PROTO://DOMAIN.TLD/PATH),repeating-linear-gradient(20DEG,GRAY,GREEN,20PX,WHITE 40PX),-atsc-linear-gradient(LEFT,BLACK,WHITE),-khtml-radial-gradient(CENTER 50DEG,CIRCLE CLOSEST-SIDE,BLACK 0,GREEN 100%),-moz-radial-gradient(CENTER 45DEG,CIRCLE CLOSEST-SIDE,ORANGE 0,RED 100%),-ms-linear-gradient(LEFT,BLUE,BLACK),-o-repeating-radial-gradient(CENTER,CIRCLE CLOSEST-SIDE,PAPAYAWHIP,RED 50%,GAINSBORO),-wap-linear-gradient(LEFT,BLACK,WHITE),-webkit-gradient(LINEAR,LEFT,from(WHITE),to(rgba(1,2,3,.4)))} \ No newline at end of file