Skip to content

Commit ac5272f

Browse files
committed
dvw, dvh, dvmin, dvmax, lvw, lvh, lvmin, lvmax, svw, svh, svmin, svmax
1 parent 241ac67 commit ac5272f

File tree

6 files changed

+4122
-3357
lines changed

6 files changed

+4122
-3357
lines changed

src/main/java/org/htmlunit/cssparser/dom/CSSValueImpl.java

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,42 @@ public enum CSSPrimitiveValueType {
8585
/** CSS_VMAX. */
8686
CSS_VMAX,
8787

88+
/** CSS_DVW. */
89+
CSS_DVW,
90+
91+
/** CSS_DVH. */
92+
CSS_DVH,
93+
94+
/** CSS_DVMIN. */
95+
CSS_DVMIN,
96+
97+
/** CSS_DVMAX. */
98+
CSS_DVMAX,
99+
100+
/** CSS_LVW. */
101+
CSS_LVW,
102+
103+
/** CSS_LVH. */
104+
CSS_LVH,
105+
106+
/** CSS_LVMIN. */
107+
CSS_LVMIN,
108+
109+
/** CSS_LVMAX. */
110+
CSS_LVMAX,
111+
112+
/** CSS_SVW. */
113+
CSS_SVW,
114+
115+
/** CSS_SVH. */
116+
CSS_SVH,
117+
118+
/** CSS_SVMIN. */
119+
CSS_SVMIN,
120+
121+
/** CSS_SVMAX. */
122+
CSS_SVMAX,
123+
88124
/** CSS_PX. */
89125
CSS_PX,
90126

@@ -355,6 +391,32 @@ public CSSPrimitiveValueType getPrimitiveType() {
355391
return CSSPrimitiveValueType.CSS_VMIN;
356392
case VMAX:
357393
return CSSPrimitiveValueType.CSS_VMAX;
394+
395+
case DVW:
396+
return CSSPrimitiveValueType.CSS_DVW;
397+
case DVH:
398+
return CSSPrimitiveValueType.CSS_DVH;
399+
case DVMIN:
400+
return CSSPrimitiveValueType.CSS_DVMIN;
401+
case DVMAX:
402+
return CSSPrimitiveValueType.CSS_DVMAX;
403+
case LVW:
404+
return CSSPrimitiveValueType.CSS_LVW;
405+
case LVH:
406+
return CSSPrimitiveValueType.CSS_LVH;
407+
case LVMIN:
408+
return CSSPrimitiveValueType.CSS_LVMIN;
409+
case LVMAX:
410+
return CSSPrimitiveValueType.CSS_LVMAX;
411+
case SVW:
412+
return CSSPrimitiveValueType.CSS_SVW;
413+
case SVH:
414+
return CSSPrimitiveValueType.CSS_SVH;
415+
case SVMIN:
416+
return CSSPrimitiveValueType.CSS_SVMIN;
417+
case SVMAX:
418+
return CSSPrimitiveValueType.CSS_SVMAX;
419+
358420
case PIXEL:
359421
return CSSPrimitiveValueType.CSS_PX;
360422
case INCH:

src/main/java/org/htmlunit/cssparser/parser/LexicalUnit.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,30 @@ enum LexicalUnitType {
7171
VMIN,
7272
/** VMAX. */
7373
VMAX,
74+
/** DVW. */
75+
DVW,
76+
/** DVH. */
77+
DVH,
78+
/** DVMIN. */
79+
DVMIN,
80+
/** DVMAX. */
81+
DVMAX,
82+
/** LVW. */
83+
LVW,
84+
/** LVH. */
85+
LVH,
86+
/** LVMIN. */
87+
LVMIN,
88+
/** LVMAX. */
89+
LVMAX,
90+
/** SVW. */
91+
SVW,
92+
/** SVH. */
93+
SVH,
94+
/** SVMIN. */
95+
SVMIN,
96+
/** SVMAX. */
97+
SVMAX,
7498
/** PIXEL. */
7599
PIXEL,
76100
/** INCH. */

src/main/java/org/htmlunit/cssparser/parser/LexicalUnitImpl.java

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,30 @@ public String getDimensionUnitText() {
241241
return "vmin";
242242
case VMAX:
243243
return "vmax";
244+
case DVW:
245+
return "dvw";
246+
case DVH:
247+
return "dvh";
248+
case DVMIN:
249+
return "dvmin";
250+
case DVMAX:
251+
return "dvmax";
252+
case LVW:
253+
return "lvw";
254+
case LVH:
255+
return "lvh";
256+
case LVMIN:
257+
return "lvmin";
258+
case LVMAX:
259+
return "lvmax";
260+
case SVW:
261+
return "svw";
262+
case SVH:
263+
return "svh";
264+
case SVMIN:
265+
return "svmin";
266+
case SVMAX:
267+
return "svmax";
244268
case PIXEL:
245269
return "px";
246270
case INCH:
@@ -363,6 +387,18 @@ public String getCssText() {
363387
case VH:
364388
case VMIN:
365389
case VMAX:
390+
case DVW:
391+
case DVH:
392+
case DVMIN:
393+
case DVMAX:
394+
case LVW:
395+
case LVH:
396+
case LVMIN:
397+
case LVMAX:
398+
case SVW:
399+
case SVH:
400+
case SVMIN:
401+
case SVMAX:
366402
case PIXEL:
367403
case INCH:
368404
case CENTIMETER:
@@ -584,6 +620,78 @@ public String toDebugString() {
584620
.append(getDimensionUnitText())
585621
.append(")");
586622
break;
623+
case DVW:
624+
sb.append("DVW(")
625+
.append(getTrimedDoubleValue())
626+
.append(getDimensionUnitText())
627+
.append(")");
628+
break;
629+
case DVH:
630+
sb.append("DVH(")
631+
.append(getTrimedDoubleValue())
632+
.append(getDimensionUnitText())
633+
.append(")");
634+
break;
635+
case DVMIN:
636+
sb.append("DVMIN(")
637+
.append(getTrimedDoubleValue())
638+
.append(getDimensionUnitText())
639+
.append(")");
640+
break;
641+
case DVMAX:
642+
sb.append("DVMAX(")
643+
.append(getTrimedDoubleValue())
644+
.append(getDimensionUnitText())
645+
.append(")");
646+
break;
647+
case LVW:
648+
sb.append("LVW(")
649+
.append(getTrimedDoubleValue())
650+
.append(getDimensionUnitText())
651+
.append(")");
652+
break;
653+
case LVH:
654+
sb.append("LVH(")
655+
.append(getTrimedDoubleValue())
656+
.append(getDimensionUnitText())
657+
.append(")");
658+
break;
659+
case LVMIN:
660+
sb.append("LVMIN(")
661+
.append(getTrimedDoubleValue())
662+
.append(getDimensionUnitText())
663+
.append(")");
664+
break;
665+
case LVMAX:
666+
sb.append("LVMAX(")
667+
.append(getTrimedDoubleValue())
668+
.append(getDimensionUnitText())
669+
.append(")");
670+
break;
671+
case SVW:
672+
sb.append("SVW(")
673+
.append(getTrimedDoubleValue())
674+
.append(getDimensionUnitText())
675+
.append(")");
676+
break;
677+
case SVH:
678+
sb.append("SVH(")
679+
.append(getTrimedDoubleValue())
680+
.append(getDimensionUnitText())
681+
.append(")");
682+
break;
683+
case SVMIN:
684+
sb.append("SVMIN(")
685+
.append(getTrimedDoubleValue())
686+
.append(getDimensionUnitText())
687+
.append(")");
688+
break;
689+
case SVMAX:
690+
sb.append("SVMAX(")
691+
.append(getTrimedDoubleValue())
692+
.append(getDimensionUnitText())
693+
.append(")");
694+
break;
587695
case PIXEL:
588696
sb.append("PIXEL(")
589697
.append(getTrimedDoubleValue())
@@ -973,6 +1081,114 @@ public static LexicalUnit createVMax(final LexicalUnit prev, final double d) {
9731081
return new LexicalUnitImpl(prev, LexicalUnitType.VMAX, d);
9741082
}
9751083

1084+
/**
1085+
* @param prev the previous LexicalUnit
1086+
* @param d the double value
1087+
* @return lexical unit with type dvw
1088+
*/
1089+
public static LexicalUnit createDvw(final LexicalUnit prev, final double d) {
1090+
return new LexicalUnitImpl(prev, LexicalUnitType.DVW, d);
1091+
}
1092+
1093+
/**
1094+
* @param prev the previous LexicalUnit
1095+
* @param d the double value
1096+
* @return lexical unit with type dvh
1097+
*/
1098+
public static LexicalUnit createDvh(final LexicalUnit prev, final double d) {
1099+
return new LexicalUnitImpl(prev, LexicalUnitType.DVH, d);
1100+
}
1101+
1102+
/**
1103+
* @param prev the previous LexicalUnit
1104+
* @param d the double value
1105+
* @return lexical unit with type dvmin
1106+
*/
1107+
public static LexicalUnit createDvMin(final LexicalUnit prev, final double d) {
1108+
return new LexicalUnitImpl(prev, LexicalUnitType.DVMIN, d);
1109+
}
1110+
1111+
/**
1112+
* @param prev the previous LexicalUnit
1113+
* @param d the double value
1114+
* @return lexical unit with type dvmax
1115+
*/
1116+
public static LexicalUnit createDvMax(final LexicalUnit prev, final double d) {
1117+
return new LexicalUnitImpl(prev, LexicalUnitType.DVMAX, d);
1118+
}
1119+
1120+
/**
1121+
* @param prev the previous LexicalUnit
1122+
* @param d the double value
1123+
* @return lexical unit with type lvw
1124+
*/
1125+
public static LexicalUnit createLvw(final LexicalUnit prev, final double d) {
1126+
return new LexicalUnitImpl(prev, LexicalUnitType.LVW, d);
1127+
}
1128+
1129+
/**
1130+
* @param prev the previous LexicalUnit
1131+
* @param d the double value
1132+
* @return lexical unit with type lvh
1133+
*/
1134+
public static LexicalUnit createLvh(final LexicalUnit prev, final double d) {
1135+
return new LexicalUnitImpl(prev, LexicalUnitType.LVH, d);
1136+
}
1137+
1138+
/**
1139+
* @param prev the previous LexicalUnit
1140+
* @param d the double value
1141+
* @return lexical unit with type lvmin
1142+
*/
1143+
public static LexicalUnit createLvMin(final LexicalUnit prev, final double d) {
1144+
return new LexicalUnitImpl(prev, LexicalUnitType.LVMIN, d);
1145+
}
1146+
1147+
/**
1148+
* @param prev the previous LexicalUnit
1149+
* @param d the double value
1150+
* @return lexical unit with type lvmax
1151+
*/
1152+
public static LexicalUnit createLvMax(final LexicalUnit prev, final double d) {
1153+
return new LexicalUnitImpl(prev, LexicalUnitType.LVMAX, d);
1154+
}
1155+
1156+
/**
1157+
* @param prev the previous LexicalUnit
1158+
* @param d the double value
1159+
* @return lexical unit with type svw
1160+
*/
1161+
public static LexicalUnit createSvw(final LexicalUnit prev, final double d) {
1162+
return new LexicalUnitImpl(prev, LexicalUnitType.SVW, d);
1163+
}
1164+
1165+
/**
1166+
* @param prev the previous LexicalUnit
1167+
* @param d the double value
1168+
* @return lexical unit with type svh
1169+
*/
1170+
public static LexicalUnit createSvh(final LexicalUnit prev, final double d) {
1171+
return new LexicalUnitImpl(prev, LexicalUnitType.SVH, d);
1172+
}
1173+
1174+
/**
1175+
* @param prev the previous LexicalUnit
1176+
* @param d the double value
1177+
* @return lexical unit with type svmin
1178+
*/
1179+
public static LexicalUnit createSvMin(final LexicalUnit prev, final double d) {
1180+
return new LexicalUnitImpl(prev, LexicalUnitType.SVMIN, d);
1181+
}
1182+
1183+
/**
1184+
* @param prev the previous LexicalUnit
1185+
* @param d the double value
1186+
* @return lexical unit with type svmax
1187+
*/
1188+
public static LexicalUnit createSvMax(final LexicalUnit prev, final double d) {
1189+
return new LexicalUnitImpl(prev, LexicalUnitType.SVMAX, d);
1190+
}
1191+
9761192
/**
9771193
* @param prev the previous LexicalUnit
9781194
* @param d the double value

0 commit comments

Comments
 (0)