private static final CssSchema ADDITIONAL_DEFAULT_CSS = CssSchema.withProperties(ImmutableSet.of(
"float",
"display"
));
HtmlPolicyBuilder htmlPolicyBuilder = new HtmlPolicyBuilder()
htmlPolicyBuilder.allowStyling(CssSchema.union(CssSchema.DEFAULT, ADDITIONAL_DEFAULT_CSS, CssSchema.withProperties(addlCssWhiteList)));
addlCssWhiteList contains two properties "z-index" and "flex".
In this case allowStyling() throws IllegalArgumentException as "flex" is not present in the CssSchema DEFINITION. Post this what is noticed is
Sanitizer doesn't filter any of the css properties present in the HTML on encountering an exception.
Please let me know if this is bug in the sanitizer.
Thanks
Rasmita