diff --git a/src/freenet/client/filter/CSSTokenizerFilter.java b/src/freenet/client/filter/CSSTokenizerFilter.java index 877c1a9730..f3a99e7078 100644 --- a/src/freenet/client/filter/CSSTokenizerFilter.java +++ b/src/freenet/client/filter/CSSTokenizerFilter.java @@ -118,6 +118,7 @@ public static T[] concat(T[] a, T[] b) { allelementVerifiers.add("align-self"); allelementVerifiers.add("azimuth"); allelementVerifiers.add("background-attachment"); + allelementVerifiers.add("background-blend-mode"); allelementVerifiers.add("background-clip"); allelementVerifiers.add("background-color"); allelementVerifiers.add("background-image"); @@ -242,6 +243,7 @@ public static T[] concat(T[] a, T[] b) { allelementVerifiers.add("max-width"); allelementVerifiers.add("min-height"); allelementVerifiers.add("min-width"); + allelementVerifiers.add("mix-blend-mode"); allelementVerifiers.add("nav-down"); allelementVerifiers.add("nav-left"); allelementVerifiers.add("nav-right"); @@ -331,7 +333,7 @@ public static T[] concat(T[] a, T[] b) { * Array for storing additional Verifier objects for validating Regular expressions in CSS Property value * e.g. [ | transparent]{1,4}. It is explained in detail in CSSPropertyVerifier class */ - private final static CSSPropertyVerifier[] auxilaryVerifiers=new CSSPropertyVerifier[148]; + private final static CSSPropertyVerifier[] auxilaryVerifiers=new CSSPropertyVerifier[149]; static { /*CSSPropertyVerifier(String[] allowedValues,String[] possibleValues,String expression,boolean onlyValueVerifier)*/ @@ -454,6 +456,11 @@ else if("background-attachment".equalsIgnoreCase(element)){ elementVerifiers.put(element,new CSSPropertyVerifier(null,ElementInfo.VISUALMEDIA,null,Arrays.asList("60<1,65535>"), true,true)); allelementVerifiers.remove(element); } + else if("background-blend-mode".equalsIgnoreCase(element)){ + auxilaryVerifiers[148] = new CSSPropertyVerifier(Arrays.asList("normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"), null, null, null, true); + elementVerifiers.put(element,new CSSPropertyVerifier(null,ElementInfo.VISUALMEDIA,null,Arrays.asList("148<1,2>"), true,true)); + allelementVerifiers.remove(element); + } else if("background-clip".equalsIgnoreCase(element)) { elementVerifiers.put(element,new CSSPropertyVerifier(null,ElementInfo.VISUALMEDIA,null,Arrays.asList("61<1,65535>"), true,true)); @@ -1196,7 +1203,13 @@ else if("min-width".equalsIgnoreCase(element)) { elementVerifiers.put(element,new CSSPropertyVerifier(Arrays.asList("auto"),ElementInfo.VISUALMEDIA,Arrays.asList("le","pe"))); allelementVerifiers.remove(element); - } else if ("nav-down".equalsIgnoreCase(element)) { + } + else if("mix-blend-mode".equalsIgnoreCase(element)){ + auxilaryVerifiers[148] = new CSSPropertyVerifier(Arrays.asList("normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"), null, null, null, true); + elementVerifiers.put(element,new CSSPropertyVerifier(null,ElementInfo.VISUALMEDIA,null,Arrays.asList("148<1,2>"), true,true)); + allelementVerifiers.remove(element); + } + else if ("nav-down".equalsIgnoreCase(element)) { elementVerifiers.put(element, new CSSPropertyVerifier(Arrays.asList("auto"), ElementInfo.VISUALINTERACTIVEMEDIA, null, Arrays.asList("143 144?"))); allelementVerifiers.remove(element); } else if ("nav-left".equalsIgnoreCase(element)) { diff --git a/test/freenet/client/filter/CSSParserTest.java b/test/freenet/client/filter/CSSParserTest.java index 63e659c9a3..7b216cbded 100644 --- a/test/freenet/client/filter/CSSParserTest.java +++ b/test/freenet/client/filter/CSSParserTest.java @@ -966,6 +966,18 @@ public class CSSParserTest { propertyTests.put("div { transition-delay: \"test\"; }", "div { }"); propertyTests.put("div { transition-property: \"test\"; }", "div { }"); propertyTests.put("div { transition-timing-function: \"test\"; }", "div { }"); + + // writing mode + propertyTests.put("#a { writing-mode: vertical-rl; text-underline-position: left; } #b { writing-mode: horizontal-tb; text-underline-position: auto; }", "#a { writing-mode: vertical-rl; text-underline-position: left; } #b { writing-mode: horizontal-tb; text-underline-position: auto; }"); + + // Compositing and Blending + propertyTests.put("#foo { background: url(\"1.png\"); background-blend-mode: darken; }", "#foo { background: url(\"1.png\"); background-blend-mode: darken; }"); + propertyTests.put("#foo {mix-blend-mode: luminosity; }", "#foo {mix-blend-mode: luminosity; }"); + + // new property values + 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;}"); } FilterMIMEType cssMIMEType;