Skip to content

Commit

Permalink
Fix text-shadow parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
torusrxxx committed Oct 25, 2024
1 parent 5e0d013 commit e33b534
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/freenet/client/filter/CSSTokenizerFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public static <T> T[] concat(T[] a, T[] b) {
auxilaryVerifiers[78]=new CSSPropertyVerifier(null,null,Arrays.asList("70<1,2>"),null,true);

// <text-shadow>
auxilaryVerifiers[79]=new CSSPropertyVerifier(null, null, Arrays.asList("74a73"), null, true);
auxilaryVerifiers[79]=new CSSPropertyVerifier(null, null, Arrays.asList("73 72 72 72","73 72 72","72 72 72 73","72 72 73","72 72"), null, true);

// <spacing-limit>
auxilaryVerifiers[85]=new CSSPropertyVerifier(Arrays.asList("normal"), Arrays.asList("le","pe"), null, null, true);
Expand Down Expand Up @@ -1531,7 +1531,7 @@ else if("text-overflow".equalsIgnoreCase(element))
}
else if("text-shadow".equalsIgnoreCase(element))
{
elementVerifiers.put(element,new CSSPropertyVerifier(Arrays.asList("none"),ElementInfo.VISUALMEDIA,null,Arrays.asList("79<0,65535>"),true,true));
elementVerifiers.put(element,new CSSPropertyVerifier(Arrays.asList("none"),ElementInfo.VISUALMEDIA,null,Arrays.asList("79"),true,true));
allelementVerifiers.remove(element);
}
else if("text-transform".equalsIgnoreCase(element))
Expand Down
7 changes: 7 additions & 0 deletions test/freenet/client/filter/CSSParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,13 @@ public class CSSParserTest {
propertyTests.put("div { overflow: clip; clear: inline-end; text-decoration: revert; float: inline-end;}", "div { overflow: clip; clear: inline-end; text-decoration: revert; float: inline-end;}");
propertyTests.put("#a {unicode-bidi: isolate;}", "#a {unicode-bidi: isolate;}");
propertyTests.put("textarea#x {caret-color: currentcolor;}", "textarea#x {caret-color: currentcolor;}");
// text-shadow
propertyTests.put("#x { text-shadow: 1px 1px 2px black; }", "#x { text-shadow: 1px 1px 2px black; }");
propertyTests.put("#x { text-shadow: #fc0 1px 0 10px; }", "#x { text-shadow: #fc0 1px 0 10px; }");
propertyTests.put("#x { text-shadow: 5px 5px #558abb; }", "#x { text-shadow: 5px 5px #558abb; }");
propertyTests.put("#x { text-shadow: white 2px 5px; }", "#x { text-shadow: white 2px 5px; }");
propertyTests.put("#x { text-shadow: 5px 10px; }", "#x { text-shadow: 5px 10px; }");
propertyTests.put("#x { text-shadow: 1px 1px 2px 1px black; }", "#x { }");
}

FilterMIMEType cssMIMEType;
Expand Down

0 comments on commit e33b534

Please sign in to comment.