Skip to content

Commit

Permalink
Add text-combine-upright,text-decoration-thickness
Browse files Browse the repository at this point in the history
  • Loading branch information
torusrxxx committed Nov 12, 2024
1 parent b892b9b commit cb162b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/freenet/client/filter/CSSTokenizerFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,13 @@ public static <T> T[] concat(T[] a, T[] b) {
allelementVerifiers.add("text-align");
allelementVerifiers.add("text-align-last");
allelementVerifiers.add("text-autospace");
allelementVerifiers.add("text-combine-upright");
allelementVerifiers.add("text-decoration");
allelementVerifiers.add("text-decoration-color");
allelementVerifiers.add("text-decoration-line");
allelementVerifiers.add("text-decoration-skip");
allelementVerifiers.add("text-decoration-style");
allelementVerifiers.add("text-decoration-thickness");
allelementVerifiers.add("text-emphasis");
allelementVerifiers.add("text-emphasis-color");
allelementVerifiers.add("text-emphasis-position");
Expand Down Expand Up @@ -1498,6 +1500,11 @@ else if("text-autospace".equalsIgnoreCase(element))
allelementVerifiers.remove(element);

}
else if("text-combine-upright".equalsIgnoreCase(element))
{
elementVerifiers.put(element,new CSSPropertyVerifier(Arrays.asList("none","all"),ElementInfo.VISUALMEDIA,null,null));
allelementVerifiers.remove(element);
}
else if("text-decoration".equalsIgnoreCase(element))
{
elementVerifiers.put(element,new CSSPropertyVerifier(null,ElementInfo.VISUALMEDIA,null,Arrays.asList("115a73a104a116")));
Expand Down Expand Up @@ -1530,13 +1537,16 @@ else if("text-decoration-style".equalsIgnoreCase(element))
{
elementVerifiers.put(element,new CSSPropertyVerifier(null,ElementInfo.VISUALMEDIA,null,Arrays.asList("104")));
allelementVerifiers.remove(element);

}
else if("text-decoration-thickness".equalsIgnoreCase(element))
{
elementVerifiers.put(element, new CSSPropertyVerifier(Arrays.asList("from-font", "auto"), ElementInfo.VISUALMEDIA, Arrays.asList("le", "pe")));
allelementVerifiers.remove(element);
}
else if("text-emphasis".equalsIgnoreCase(element))
{
elementVerifiers.put(element,new CSSPropertyVerifier(null,ElementInfo.VISUALMEDIA,null,Arrays.asList("73a107")));
allelementVerifiers.remove(element);

}
else if("text-emphasis-color".equalsIgnoreCase(element))
{
Expand Down
2 changes: 2 additions & 0 deletions test/freenet/client/filter/CSSParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,8 @@ public class CSSParserTest {
propertyTests.put("#x { list-style-type: korean-hanja-formal }", "#x { list-style-type: korean-hanja-formal }");
propertyTests.put("#x { list-style-type: \"*\" }", "#x { list-style-type: \"*\" }");
propertyTests.put("#x { max-inline-size: none; min-block-size: auto; }", "#x { max-inline-size: none; min-block-size: auto; }");
propertyTests.put("#x { text-combine-upright: all; }", "#x { text-combine-upright: all; }");
propertyTests.put("#x { text-decoration-thickness: 5px; }", "#x { text-decoration-thickness: 5px; }");

// text-emphasis
propertyTests.put("#x { text-emphasis: triangle blue; }", "#x { text-emphasis: triangle blue; }"); // java.lang.NullPointerException
Expand Down

0 comments on commit cb162b7

Please sign in to comment.