Skip to content

Commit 8247284

Browse files
committed
That includes new properties, aligning existing properties and external definitions. Fixing some long time 'font' parsing issues.
1 parent d6feb0a commit 8247284

36 files changed

+2248
-612
lines changed

org/w3c/css/properties/CSS3Properties.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ font-feature-settings: org.w3c.css.properties.css3.CssFontFeatu
1212
font-kerning: org.w3c.css.properties.css3.CssFontKerning
1313
font-language-override: org.w3c.css.properties.css3.CssFontLanguageOverride
1414
font-synthesis: org.w3c.css.properties.css3.CssFontSynthesis
15+
font-synthesis-small-caps: org.w3c.css.properties.css3.CssFontSynthesisSmallCaps
16+
font-synthesis-style: org.w3c.css.properties.css3.CssFontSynthesisStyle
17+
font-synthesis-weight: org.w3c.css.properties.css3.CssFontSynthesisWeight
1518
font-variant-caps: org.w3c.css.properties.css3.CssFontVariantCaps
1619
font-variant-position: org.w3c.css.properties.css3.CssFontVariantPosition
1720
font-variant-east-asian: org.w3c.css.properties.css3.CssFontVariantEastAsian
21+
font-variant-emoji: org.w3c.css.properties.css3.CssFontVariantEmoji
1822
font-variant-ligatures: org.w3c.css.properties.css3.CssFontVariantLigatures
1923
font-variant-numeric: org.w3c.css.properties.css3.CssFontVariantNumeric
2024
font-variant-alternates: org.w3c.css.properties.css3.CssFontVariantAlternates
25+
font-variation-settings: org.w3c.css.properties.css3.CssFontVariationSettings
2126

2227
color: org.w3c.css.properties.css3.CssColor
2328

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
//
2+
// Author: Yves Lafon <ylafon@w3.org>
3+
//
4+
// (c) COPYRIGHT MIT, ERCIM, Keio, Beihang, 2021.
5+
// Please first read the full copyright statement in file COPYRIGHT.html
6+
package org.w3c.css.properties.css;
7+
8+
import org.w3c.css.parser.CssStyle;
9+
import org.w3c.css.properties.css3.Css3Style;
10+
import org.w3c.css.util.ApplContext;
11+
import org.w3c.css.util.InvalidParamException;
12+
import org.w3c.css.values.CssExpression;
13+
14+
/**
15+
* @since CSS3
16+
*/
17+
public class CssFontOpticalSizing extends CssProperty {
18+
19+
20+
/**
21+
* Create a new CssFontOpticalSizing
22+
*/
23+
public CssFontOpticalSizing() {
24+
}
25+
26+
/**
27+
* Creates a new CssFontOpticalSizing
28+
*
29+
* @param expression The expression for this property
30+
* @throws InvalidParamException Expressions are incorrect
31+
*/
32+
public CssFontOpticalSizing(ApplContext ac, CssExpression expression, boolean check)
33+
throws InvalidParamException {
34+
throw new InvalidParamException("value",
35+
expression.getValue().toString(),
36+
getPropertyName(), ac);
37+
}
38+
39+
public CssFontOpticalSizing(ApplContext ac, CssExpression expression)
40+
throws InvalidParamException {
41+
this(ac, expression, false);
42+
}
43+
44+
/**
45+
* Returns the value of this property
46+
*/
47+
public Object get() {
48+
return value;
49+
}
50+
51+
52+
/**
53+
* Returns the name of this property
54+
*/
55+
public final String getPropertyName() {
56+
return "font-optical-sizing";
57+
}
58+
59+
/**
60+
* Returns true if this property is "softly" inherited
61+
* e.g. his value is equals to inherit
62+
*/
63+
public boolean isSoftlyInherited() {
64+
return value.equals(inherit);
65+
}
66+
67+
/**
68+
* Returns a string representation of the object.
69+
*/
70+
public String toString() {
71+
return value.toString();
72+
}
73+
74+
/**
75+
* Add this property to the CssStyle.
76+
*
77+
* @param style The CssStyle
78+
*/
79+
public void addToStyle(ApplContext ac, CssStyle style) {
80+
Css3Style s = (Css3Style) style;
81+
if (s.cssFontOpticalSizing != null) {
82+
style.addRedefinitionWarning(ac, this);
83+
}
84+
s.cssFontOpticalSizing = this;
85+
}
86+
87+
88+
/**
89+
* Compares two properties for equality.
90+
*
91+
* @param property The other property.
92+
*/
93+
public boolean equals(CssProperty property) {
94+
return (property instanceof CssFontOpticalSizing &&
95+
value.equals(((CssFontOpticalSizing) property).value));
96+
}
97+
98+
99+
/**
100+
* Get this property in the style.
101+
*
102+
* @param style The style where the property is
103+
* @param resolve if true, resolve the style to find this property
104+
*/
105+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
106+
if (resolve) {
107+
return ((Css3Style) style).getFontOpticalSizing();
108+
} else {
109+
return ((Css3Style) style).cssFontOpticalSizing;
110+
}
111+
}
112+
}
113+
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
//
2+
// Author: Yves Lafon <ylafon@w3.org>
3+
//
4+
// (c) COPYRIGHT MIT, ERCIM, Keio, Beihang, 2021.
5+
// Please first read the full copyright statement in file COPYRIGHT.html
6+
package org.w3c.css.properties.css;
7+
8+
import org.w3c.css.parser.CssStyle;
9+
import org.w3c.css.properties.css3.Css3Style;
10+
import org.w3c.css.util.ApplContext;
11+
import org.w3c.css.util.InvalidParamException;
12+
import org.w3c.css.values.CssExpression;
13+
14+
/**
15+
* @since CSS3
16+
*/
17+
public class CssFontPalette extends CssProperty {
18+
19+
20+
/**
21+
* Create a new CssFontPalette
22+
*/
23+
public CssFontPalette() {
24+
}
25+
26+
/**
27+
* Creates a new CssFontPalette
28+
*
29+
* @param expression The expression for this property
30+
* @throws InvalidParamException Expressions are incorrect
31+
*/
32+
public CssFontPalette(ApplContext ac, CssExpression expression, boolean check)
33+
throws InvalidParamException {
34+
throw new InvalidParamException("value",
35+
expression.getValue().toString(),
36+
getPropertyName(), ac);
37+
}
38+
39+
public CssFontPalette(ApplContext ac, CssExpression expression)
40+
throws InvalidParamException {
41+
this(ac, expression, false);
42+
}
43+
44+
/**
45+
* Returns the value of this property
46+
*/
47+
public Object get() {
48+
return value;
49+
}
50+
51+
52+
/**
53+
* Returns the name of this property
54+
*/
55+
public final String getPropertyName() {
56+
return "font-palette";
57+
}
58+
59+
/**
60+
* Returns true if this property is "softly" inherited
61+
* e.g. his value is equals to inherit
62+
*/
63+
public boolean isSoftlyInherited() {
64+
return value.equals(inherit);
65+
}
66+
67+
/**
68+
* Returns a string representation of the object.
69+
*/
70+
public String toString() {
71+
return value.toString();
72+
}
73+
74+
/**
75+
* Add this property to the CssStyle.
76+
*
77+
* @param style The CssStyle
78+
*/
79+
public void addToStyle(ApplContext ac, CssStyle style) {
80+
Css3Style s = (Css3Style) style;
81+
if (s.cssFontPalette != null) {
82+
style.addRedefinitionWarning(ac, this);
83+
}
84+
s.cssFontPalette = this;
85+
}
86+
87+
88+
/**
89+
* Compares two properties for equality.
90+
*
91+
* @param property The other property.
92+
*/
93+
public boolean equals(CssProperty property) {
94+
return (property instanceof CssFontPalette &&
95+
value.equals((property).value));
96+
}
97+
98+
99+
/**
100+
* Get this property in the style.
101+
*
102+
* @param style The style where the property is
103+
* @param resolve if true, resolve the style to find this property
104+
*/
105+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
106+
if (resolve) {
107+
return ((Css3Style) style).getFontPalette();
108+
} else {
109+
return ((Css3Style) style).cssFontPalette;
110+
}
111+
}
112+
}
113+
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
//
2+
// Author: Yves Lafon <ylafon@w3.org>
3+
//
4+
// (c) COPYRIGHT MIT, ERCIM, Keio, Beihang, 2021.
5+
// Please first read the full copyright statement in file COPYRIGHT.html
6+
package org.w3c.css.properties.css;
7+
8+
import org.w3c.css.parser.CssStyle;
9+
import org.w3c.css.properties.css3.Css3Style;
10+
import org.w3c.css.util.ApplContext;
11+
import org.w3c.css.util.InvalidParamException;
12+
import org.w3c.css.values.CssExpression;
13+
14+
/**
15+
* @since CSS3
16+
*/
17+
public class CssFontSynthesisSmallCaps extends CssProperty {
18+
19+
20+
/**
21+
* Create a new CssFontSynthesisSmallCaps
22+
*/
23+
public CssFontSynthesisSmallCaps() {
24+
}
25+
26+
/**
27+
* Creates a new CssFontSynthesisSmallCaps
28+
*
29+
* @param expression The expression for this property
30+
* @throws InvalidParamException
31+
* Expressions are incorrect
32+
*/
33+
public CssFontSynthesisSmallCaps(ApplContext ac, CssExpression expression, boolean check)
34+
throws InvalidParamException {
35+
throw new InvalidParamException("value",
36+
expression.getValue().toString(),
37+
getPropertyName(), ac);
38+
}
39+
40+
public CssFontSynthesisSmallCaps(ApplContext ac, CssExpression expression)
41+
throws InvalidParamException {
42+
this(ac, expression, false);
43+
}
44+
45+
/**
46+
* Returns the value of this property
47+
*/
48+
public Object get() {
49+
return value;
50+
}
51+
52+
53+
/**
54+
* Returns the name of this property
55+
*/
56+
public final String getPropertyName() {
57+
return "font-synthesis-small-caps";
58+
}
59+
60+
/**
61+
* Returns true if this property is "softly" inherited
62+
* e.g. his value is equals to inherit
63+
*/
64+
public boolean isSoftlyInherited() {
65+
return value.equals(inherit);
66+
}
67+
68+
/**
69+
* Returns a string representation of the object.
70+
*/
71+
public String toString() {
72+
return value.toString();
73+
}
74+
75+
/**
76+
* Add this property to the CssStyle.
77+
*
78+
* @param style The CssStyle
79+
*/
80+
public void addToStyle(ApplContext ac, CssStyle style) {
81+
Css3Style s = (Css3Style) style;
82+
if (s.cssFontSynthesisSmallCaps != null) {
83+
style.addRedefinitionWarning(ac, this);
84+
}
85+
s.cssFontSynthesisSmallCaps = this;
86+
}
87+
88+
89+
/**
90+
* Compares two properties for equality.
91+
*
92+
* @param property The other property.
93+
*/
94+
public boolean equals(CssProperty property) {
95+
return (property instanceof CssFontSynthesisSmallCaps &&
96+
value.equals(property.value));
97+
}
98+
99+
100+
/**
101+
* Get this property in the style.
102+
*
103+
* @param style The style where the property is
104+
* @param resolve if true, resolve the style to find this property
105+
*/
106+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
107+
if (resolve) {
108+
return ((Css3Style) style).getFontSynthesisSmallCaps();
109+
} else {
110+
return ((Css3Style) style).cssFontSynthesisSmallCaps;
111+
}
112+
}
113+
}
114+

0 commit comments

Comments
 (0)