@@ -70,35 +70,37 @@ public void hwbRelative() throws Exception {
7070 */
7171 @ Test
7272 public void hwbVariousErrors () throws Exception {
73- // color(1, "Error in expression. (Invalid token \",\". Was expecting one of: <S>, \"none\", \"-\", \"+\", <PERCENTAGE>.)",
74- // "foreground: hwb(10, 20% 30%)");
75- // color(1, "Error in expression. (Invalid token \",\". Was expecting one of: <S>, \"none\", \"-\", \"+\", <PERCENTAGE>.)", "foreground: hwb(10 20%, 30%)");
76- //
77- // color(1, "DOM exception: ''hwb' alpha value must be separated by '/'.'", "foreground: hwb(10 20% 30% 40)");
78- //
79- // color(1, "Error in expression. (Invalid token \"-none\". Was expecting one of: <S>, <NUMBER>, \"none\", \"-\", \"+\", <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>.)",
80- // "foreground: hwb(-none 20% 30%)");
81- // color(1, "Error in expression. (Invalid token \"-none\". Was expecting one of: <S>, \"none\", \"-\", \"+\", <PERCENTAGE>.)",
82- // "foreground: hwb(10 -none 30%)");
83- // color(1, "Error in expression. (Invalid token \"-none\". Was expecting one of: <S>, \"none\", \"-\", \"+\", <PERCENTAGE>.)",
84- // "foreground: hwb(10 20% -none)");
85- // color(1, "Error in expression. (Invalid token \"-none\". Was expecting one of: <S>, <NUMBER>, \"none\", \"-\", \"+\", <PERCENTAGE>.)",
86- // "foreground: hwb(10 20% 30% / -none)");
87- //
88- // color(1, "Error in expression. (Invalid token \")\". Was expecting one of: <S>, <NUMBER>, \"none\", \"-\", \"+\", <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>.)",
89- // "foreground: hwb()");
90- // color(1, "Error in expression. (Invalid token \")\". Was expecting one of: <S>, \"none\", \"-\", \"+\", <PERCENTAGE>.)",
91- // "foreground: hwb(10)");
92- // color(1, "Error in expression. (Invalid token \")\". Was expecting one of: <S>, \"none\", \"-\", \"+\", <PERCENTAGE>.)",
93- // "foreground: hwb(10 20%)");
94- //
95- // color(1, "Error in expression. (Invalid token \")\". Was expecting one of: <S>, <NUMBER>, \"none\", \"-\", \"+\", <PERCENTAGE>.)",
96- // "foreground: hwb(10 20% 30%/)");
97- //
98- // color(1, "Error in expression. (Invalid token \"20\". Was expecting one of: <S>, \"none\", \"-\", \"+\", <PERCENTAGE>.)",
99- // "foreground: hwb(10 20px 30)");
100- //
101- // color(1, "Error in expression. (Invalid token \"10\". Was expecting one of: <S>, <NUMBER>, \"none\", \"-\", \"+\", <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>.)",
102- // "foreground: hwb('10' 20 30)");
73+ // like browsers we ignore many errors during parsing
74+
75+ color (1 , "Error in expression. (Invalid token \" ,\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
76+ "foreground: hwb(10, 20% 30%)" );
77+ color (1 , "Error in expression. (Invalid token \" ,\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" , "foreground: hwb(10 20%, 30%)" );
78+
79+ color ("foreground: hwb(10 20% 30% 40)" , "foreground: hwb(10 20% 30% 40)" );
80+
81+ color (1 , "Error in expression. (Invalid token \" -none\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" from\" , \" -\" , \" +\" , <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>.)" ,
82+ "foreground: hwb(-none 20% 30%)" );
83+ color (1 , "Error in expression. (Invalid token \" -none\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
84+ "foreground: hwb(10 -none 30%)" );
85+ color (1 , "Error in expression. (Invalid token \" -none\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
86+ "foreground: hwb(10 20% -none)" );
87+ color (1 , "Error in expression. (Invalid token \" -none\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
88+ "foreground: hwb(10 20% 30% / -none)" );
89+
90+ color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" from\" , \" -\" , \" +\" , <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>.)" ,
91+ "foreground: hwb()" );
92+ color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
93+ "foreground: hwb(10)" );
94+ color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
95+ "foreground: hwb(10 20%)" );
96+
97+ color (1 , "Error in expression. (Invalid token \" )\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
98+ "foreground: hwb(10 20% 30%/)" );
99+
100+ color (1 , "Error in expression. (Invalid token \" 20\" . Was expecting one of: <S>, \" none\" , \" -\" , \" +\" , <PERCENTAGE>.)" ,
101+ "foreground: hwb(10 20px 30)" );
102+
103+ color (1 , "Error in expression. (Invalid token \" 10\" . Was expecting one of: <S>, <NUMBER>, \" none\" , \" from\" , \" -\" , \" +\" , <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <ANGLE_TURN>.)" ,
104+ "foreground: hwb('10' 20 30)" );
103105 }
104106}
0 commit comments