Skip to content

Commit

Permalink
Fix #81: Revert #77 pseudo spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Jul 19, 2022
1 parent a97a3f0 commit 7454377
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/bug2527974.css.min
Original file line number Diff line number Diff line change
@@ -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}
/*! $LastChangedRevision: 81 $ $LastChangedDate: 2009-05-27 17:41:02 +0100 (Wed, 27 May 2009) $ */body{yo:cats}ul[id$=foo] label:hover{yo:yo}
2 changes: 1 addition & 1 deletion src/test/resources/bug2528034.css.min
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a[href$="/test/"] span :first-child{b:1}
a[href$="/test/"] span:first-child{b:1}
8 changes: 6 additions & 2 deletions src/test/resources/issue334.css
Original file line number Diff line number Diff line change
@@ -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; } }
@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;
}
2 changes: 1 addition & 1 deletion src/test/resources/issue334.css.min
Original file line number Diff line number Diff line change
@@ -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}}
@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}
2 changes: 1 addition & 1 deletion src/test/resources/lowercasing.css.min
Original file line number Diff line number Diff line change
@@ -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)))}
@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)))}

0 comments on commit 7454377

Please sign in to comment.