Skip to content

Commit eb2446b

Browse files
authored
fix function not bug, update dependencies (#130)
* fix function not bug, update dependencies * forgot to update version in pom
1 parent ce2459f commit eb2446b

File tree

5 files changed

+47
-5
lines changed

5 files changed

+47
-5
lines changed

Changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## AMP HTML Validator 1.0.31
4+
- upgrade protobuf-java from 3.20.1 to 3.21.0
5+
- upgrade jackson-databind from 2.13.2.2 to 2.13.3
6+
- upgrade jackson-core from 2.13.3 to 2.13.2
7+
- upgrade testng from 7.5 to 7.6.0
8+
- fix bug for pseudo class function :not in css
9+
310
## AMP HTML Validator 1.0.30
411
- upgrade protobuf-java from 3.16.1 to 3.20.1
512
- upgrade exec-maven-plugin from 1.6.0 to 3.0.0

pom.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<groupId>dev.amp</groupId>
88
<artifactId>validator-java</artifactId>
99
<name>AMP validator Java API</name>
10-
<version>1.0.30</version>
10+
<version>1.0.31</version>
1111
<description>A Java validator for the AMP Html format.</description>
1212
<packaging>jar</packaging>
1313
<url>https://github.com/ampproject/validator-java</url>
@@ -66,16 +66,16 @@
6666
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
6767

6868
<os-maven-plugin.version>1.7.0</os-maven-plugin.version>
69-
<protobuf.version>3.20.1</protobuf.version>
69+
<protobuf.version>3.21.0</protobuf.version>
7070
<maven-surefire-plugin.version>3.0.0-M6</maven-surefire-plugin.version>
7171
<jdk.version>11</jdk.version>
7272
<main.basedir>${project.basedir}</main.basedir>
7373

7474
<checkstyle.maxAllowedViolations>10</checkstyle.maxAllowedViolations>
7575

7676
<com.puppycrawl.checkstyle.version>10.2</com.puppycrawl.checkstyle.version>
77-
<fasterxml.jackson.version>2.13.2</fasterxml.jackson.version>
78-
<fasterxml.jackson.databind.version>2.13.2.2</fasterxml.jackson.databind.version>
77+
<fasterxml.jackson.version>2.13.3</fasterxml.jackson.version>
78+
<fasterxml.jackson.databind.version>2.13.3</fasterxml.jackson.databind.version>
7979
<mockito.version>1.10.19</mockito.version>
8080
</properties>
8181

@@ -649,7 +649,7 @@
649649
<dependency>
650650
<groupId>org.testng</groupId>
651651
<artifactId>testng</artifactId>
652-
<version>7.5</version>
652+
<version>7.6.0</version>
653653
<scope>test</scope>
654654
</dependency>
655655
<dependency>

src/main/java/dev/amp/validator/css/CssTokenUtil.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ private CssTokenUtil() {
9090

9191
// TODO : check this
9292
KIND_TO_TOKENTYPE.put(SACParserCSS3Constants.FUNCTION, TokenType.FUNCTION_TOKEN);
93+
KIND_TO_TOKENTYPE.put(SACParserCSS3Constants.FUNCTION_NOT, TokenType.FUNCTION_TOKEN);
9394
KIND_TO_TOKENTYPE.put(SACParserCSS3Constants.IDENT, TokenType.IDENT);
9495

9596
// TODO : verify uri and url are interchangeable for validation

src/test/java/dev/amp/validator/parser/AMPHtmlParserTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,22 @@ public void testEqualsDelimiter() {
960960
}
961961
}
962962

963+
@Test
964+
public void testPseudoClassFunctionNot() {
965+
try {
966+
String inputHtml =
967+
readFile(
968+
"test-cases/css/testPseudoClassFunctionNot.html");
969+
final int maxNode = 10000;
970+
ValidatorProtos.ValidationResult result =
971+
ampHtmlParser.parse(inputHtml, ValidatorProtos.HtmlFormat.Code.AMP4EMAIL, ExitCondition.FULL_PARSING, maxNode);
972+
Assert.assertEquals(result.getErrorsCount(), 0, "Expecting to have 0 error");
973+
Assert.assertTrue(result.getStatus() == ValidatorProtos.ValidationResult.Status.PASS);
974+
} catch (final IOException ex) {
975+
ex.printStackTrace();
976+
}
977+
}
978+
963979
// TODO: debugging indicates the CSS is tokenized before the length check. Should validate length before.
964980
@Test
965981
public void testStylesheetTooLong() {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!--
2+
verify delims are parsed correctly
3+
-->
4+
<!doctype html>
5+
<html data-css-strict amp4email>
6+
<head>
7+
<meta charset="utf-8">
8+
<script async src="https://cdn.ampproject.org/v0.js"></script>
9+
<style amp4email-boilerplate>body{visibility:hidden}</style>
10+
<style amp-custom>
11+
amp-accordion section:not([expanded]) .upArrow {
12+
display: none;
13+
}
14+
</style>
15+
</head>
16+
<body>
17+
</body>
18+
</html>

0 commit comments

Comments
 (0)