Skip to content

Commit

Permalink
Add object-fit
Browse files Browse the repository at this point in the history
  • Loading branch information
torusrxxx committed Oct 28, 2024
1 parent 9591dba commit 47e72cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/freenet/client/filter/CSSTokenizerFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ public static <T> T[] concat(T[] a, T[] b) {
allelementVerifiers.add("nav-left");
allelementVerifiers.add("nav-right");
allelementVerifiers.add("nav-up");
allelementVerifiers.add("object-fit");
allelementVerifiers.add("opacity");
allelementVerifiers.add("order");
allelementVerifiers.add("orphans");
Expand Down Expand Up @@ -1241,6 +1242,9 @@ else if ("nav-down".equalsIgnoreCase(element)) {
} else if ("nav-up".equalsIgnoreCase(element)) {
elementVerifiers.put(element, new CSSPropertyVerifier(Arrays.asList("auto"), ElementInfo.VISUALINTERACTIVEMEDIA, null, Arrays.asList("143 144?")));
allelementVerifiers.remove(element);
} else if ("object-fit".equalsIgnoreCase(element)) {
elementVerifiers.put(element, new CSSPropertyVerifier(Arrays.asList("contain","cover","fill","none","scale-down"), ElementInfo.VISUALMEDIA));
allelementVerifiers.remove(element);
}
else if("opacity".equalsIgnoreCase(element))
{
Expand Down
1 change: 1 addition & 0 deletions test/freenet/client/filter/CSSParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@ public class CSSParserTest {
propertyTests.put("#a { word-break: keep-all; font-kerning: none; }", "#a { word-break: keep-all; font-kerning: none; }");
propertyTests.put("#a { tab-size: 4; }", "#a { tab-size: 4; }");
propertyTests.put("#a { tab-size: 12pt; }", "#a { tab-size: 12pt; }");
propertyTests.put("img#a { object-fit: scale-down; }", "img#a { object-fit: scale-down; }");
// text-emphasis
propertyTests.put("#x { text-emphasis: triangle blue; }", "#x { text-emphasis: triangle blue; }"); // java.lang.NullPointerException
propertyTests.put("#x { text-emphasis: filled triangle blue; }", "#x { text-emphasis: filled triangle blue; }");
Expand Down

0 comments on commit 47e72cc

Please sign in to comment.