Skip to content

Commit

Permalink
Add CSS global values revert,revert-layer, attribute writing-mode, up…
Browse files Browse the repository at this point in the history
…date attributes unicode-bidi,caret-color
  • Loading branch information
torusrxxx committed Oct 19, 2024
1 parent 7cf3133 commit 35a00bf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/freenet/client/filter/CSSTokenizerFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ public static <T> T[] concat(T[] a, T[] b) {
allelementVerifiers.add("word-break");
allelementVerifiers.add("word-spacing");
allelementVerifiers.add("word-wrap");
allelementVerifiers.add("writing-mode");
allelementVerifiers.add("z-index");


Expand Down Expand Up @@ -775,7 +776,7 @@ else if("caption-side".equalsIgnoreCase(element))
allelementVerifiers.remove(element);

} else if ("caret-color".equalsIgnoreCase(element)) {
elementVerifiers.put(element, new CSSPropertyVerifier(Arrays.asList("auto", "transparent"), ElementInfo.VISUALMEDIA, Arrays.asList("co")));
elementVerifiers.put(element, new CSSPropertyVerifier(Arrays.asList("auto", "transparent", "currentcolor"), ElementInfo.VISUALMEDIA, Arrays.asList("co")));
allelementVerifiers.remove(element);
}
else if("clear".equalsIgnoreCase(element))
Expand Down Expand Up @@ -1559,7 +1560,7 @@ else if("transform-origin".equalsIgnoreCase(element))
}
else if("unicode-bidi".equalsIgnoreCase(element))
{
elementVerifiers.put(element,new CSSPropertyVerifier( Arrays.asList("normal", "embed", "bidi-override"),ElementInfo.VISUALMEDIA));
elementVerifiers.put(element,new CSSPropertyVerifier(Arrays.asList("normal", "embed", "bidi-override", "isolate", "isolate-override", "plaintext"),ElementInfo.VISUALMEDIA));
allelementVerifiers.remove(element);
}
else if("vertical-align".equalsIgnoreCase(element))
Expand Down Expand Up @@ -1620,6 +1621,11 @@ else if("word-wrap".equalsIgnoreCase(element))
elementVerifiers.put(element,new CSSPropertyVerifier(Arrays.asList("normal", "break-word", "anywhere"),ElementInfo.VISUALMEDIA));
allelementVerifiers.remove(element);
}
else if("writing-mode".equalsIgnoreCase(element))
{
elementVerifiers.put(element,new CSSPropertyVerifier(Arrays.asList("horizontal-tb", "vertical-rl", "vertical-lr", "lr", "lr-tb", "rl", "tb", "tb-lr", "tb-rl"),ElementInfo.VISUALMEDIA));
allelementVerifiers.remove(element);
}
else if("z-index".equalsIgnoreCase(element))
{
elementVerifiers.put(element,new CSSPropertyVerifier(Arrays.asList("auto"),ElementInfo.VISUALMEDIA,Arrays.asList("in")));
Expand Down Expand Up @@ -3914,7 +3920,7 @@ public boolean checkValidity(String[] media,String[] elements,ParsedWord[] words
// CSS Property has one of the explicitly defined values
return true;
}
if (lowerCaseWord.equals("initial") || lowerCaseWord.equals("inherit") || lowerCaseWord.equals("unset")) {
if (lowerCaseWord.equals("initial") || lowerCaseWord.equals("inherit") || lowerCaseWord.equals("unset") || lowerCaseWord.equals("revert") || lowerCaseWord.equals("revert-layer")) {
// CSS Property is one of the Defaulting Keywords (http://www.w3.org/TR/css3-cascade/#defaulting-keywords)
return true;
}
Expand Down

0 comments on commit 35a00bf

Please sign in to comment.