Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4f6f6aa
@ font-face font-weight descriptor per https://www.w3.org/TR/2021/WD-…
ylafon Sep 13, 2021
b5cb6e5
fix the 'auto' single value case
ylafon Sep 13, 2021
dd5021b
@​font-face font-stretch descriptor per https://www.w3.org/TR/2021/WD…
ylafon Sep 13, 2021
cddac56
forgot number check...
ylafon Sep 13, 2021
2937875
@​font-face font-style descriptor per https://www.w3.org/TR/2021/WD-c…
ylafon Sep 13, 2021
9a7a5f6
@ font-face font-weight descriptor per https://www.w3.org/TR/2021/WD-…
ylafon Sep 13, 2021
dc1f3f5
fix the 'auto' single value case
ylafon Sep 13, 2021
614ae37
@​font-face font-stretch descriptor per https://www.w3.org/TR/2021/WD…
ylafon Sep 13, 2021
a333b54
forgot number check...
ylafon Sep 13, 2021
e00ae04
@​font-face font-style descriptor per https://www.w3.org/TR/2021/WD-c…
ylafon Sep 13, 2021
0371dc7
Merge branch 'font-face-4' of github.com:w3c/css-validator into font-…
ylafon Sep 20, 2021
4d03595
@ font-face font-weight descriptor per https://www.w3.org/TR/2021/WD-…
ylafon Sep 13, 2021
7c94d60
fix the 'auto' single value case
ylafon Sep 13, 2021
5534c15
@​font-face font-stretch descriptor per https://www.w3.org/TR/2021/WD…
ylafon Sep 13, 2021
98a78be
forgot number check...
ylafon Sep 13, 2021
4a0040c
@​font-face font-style descriptor per https://www.w3.org/TR/2021/WD-c…
ylafon Sep 13, 2021
4055d67
Merge branch 'font-face-4' of github.com:w3c/css-validator into font-…
ylafon Sep 24, 2021
122e3d5
@​font-face font-named-instance per https://www.w3.org/TR/2021/WD-css…
ylafon Sep 24, 2021
f1b1587
@​font-face ascent-override per https://www.w3.org/TR/2021/WD-css-fon…
ylafon Sep 25, 2021
00e961d
@​font-face descent-override per https://www.w3.org/TR/2021/WD-css-fo…
ylafon Sep 25, 2021
1608148
@​font-face line-gap-override per https://www.w3.org/TR/2021/WD-css-f…
ylafon Sep 25, 2021
3615cac
@​font-face unicode-range per https://www.w3.org/TR/2021/WD-css-fonts…
ylafon Sep 25, 2021
b11e994
@​font-face font-language-override per https://www.w3.org/TR/2021/WD-…
ylafon Sep 25, 2021
ba50fee
@​font-face font-family per https://www.w3.org/TR/2021/WD-css-fonts-4…
ylafon Sep 25, 2021
aecdbb0
@​font-face font-feature-settings per https://www.w3.org/TR/2021/WD-c…
ylafon Sep 25, 2021
f54ccbe
set ident check to public to be reused in fontface
ylafon Sep 25, 2021
cb6c2a8
@​font-face font-variation-settings per https://www.w3.org/TR/2021/WD…
ylafon Sep 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 13 additions & 24 deletions org/w3c/css/properties/CSS3Properties.properties
Original file line number Diff line number Diff line change
Expand Up @@ -498,31 +498,20 @@ flood-color: org.w3c.css.properties.css3.CssFloodColo
flood-opacity: org.w3c.css.properties.css3.CssFloodOpacity
lighting-color: org.w3c.css.properties.css3.CssLightingColor

@font-face.unicode-range: org.w3c.css.properties.css2.font.UnicodeRange
@font-face.units-per-em: org.w3c.css.properties.css2.font.UnitsPerEm
@font-face.src: org.w3c.css.properties.css3.fontface.CssSrc
@font-face.panose-1: org.w3c.css.properties.css2.font.Panose1
@font-face.stemv: org.w3c.css.properties.css2.font.Stemv
@font-face.stemh: org.w3c.css.properties.css2.font.Stemh
@font-face.slope: org.w3c.css.properties.css2.font.Slope
@font-face.cap-height: org.w3c.css.properties.css2.font.CapHeight
@font-face.x-hegiht: org.w3c.css.properties.css2.font.XHeight
@font-face.widths: org.w3c.css.properties.css2.font.Widths
@font-face.ascent: org.w3c.css.properties.css2.font.Ascent
@font-face.descent: org.w3c.css.properties.css2.font.Descent
@font-face.bbox: org.w3c.css.properties.css2.font.Bbox
@font-face.baseline: org.w3c.css.properties.css2.font.Baseline
@font-face.centerline: org.w3c.css.properties.css2.font.Centerline
@font-face.definition-src: org.w3c.css.properties.css2.font.DefinitionSrc
@font-face.mathline: org.w3c.css.properties.css2.font.Mathline
@font-face.topline: org.w3c.css.properties.css2.font.Topline
@font-face.font-style: org.w3c.css.properties.css2.font.FontStyle
@font-face.font-variant: org.w3c.css.properties.css2.font.FontVariant
@font-face.font-weight: org.w3c.css.properties.css2.font.FontWeight
@font-face.font-size: org.w3c.css.properties.css2.font.FontSize
@font-face.font-family: org.w3c.css.properties.css2.font.FontFamily
@font-face.font-stretch: org.w3c.css.properties.css2.font.FontStretch
@font-face.ascent-override: org.w3c.css.properties.css3.fontface.CssAscentOverride
@font-face.descent-override: org.w3c.css.properties.css3.fontface.CssDescentOverride
@font-face.font-display: org.w3c.css.properties.css3.fontface.CssFontDisplay
@font-face.font-family: org.w3c.css.properties.css3.fontface.CssFontFamily
@font-face.font-feature-settings: org.w3c.css.properties.css3.fontface.CssFontFeatureSettings
@font-face.font-language-override: org.w3c.css.properties.css3.fontface.CssFontLanguageOverride
@font-face.font-named-instance org.w3c.css.properties.css3.fontface.CssFontNamedInstance
@font-face.font-stretch: org.w3c.css.properties.css3.fontface.CssFontStretch
@font-face.font-style: org.w3c.css.properties.css3.fontface.CssFontStyle
@font-face.font-variation-settings: org.w3c.css.properties.css3.fontface.CssFontVariationSettings
@font-face.font-weight: org.w3c.css.properties.css3.fontface.CssFontWeight
@font-face.line-gap-override: org.w3c.css.properties.css3.fontface.CssLineGapOverride
@font-face.src: org.w3c.css.properties.css3.fontface.CssSrc
@font-face.unicode-range: org.w3c.css.properties.css3.fontface.CssUnicodeRange

// mediafeatures
mf.any-hover: org.w3c.css.atrules.css3.media.MediaAnyHover
Expand Down
118 changes: 118 additions & 0 deletions org/w3c/css/properties/css/fontface/CssAscentOverride.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
//
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM, Keio, Beihang, 2021.
// Please first read the full copyright statement in file COPYRIGHT.html

package org.w3c.css.properties.css.fontface;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css.CssProperty;
import org.w3c.css.properties.css3.Css3Style;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;

/**
* @since CSS3
*/
public class CssAscentOverride extends CssProperty {

public CssValue value;

/**
* Create a new CssAscentOverride
*/
public CssAscentOverride() {
}

/**
* Creates a new CssAscentOverride
*
* @param expression The expression for this property
* @throws InvalidParamException
* Expressions are incorrect
*/
public CssAscentOverride(ApplContext ac, CssExpression expression, boolean check)
throws InvalidParamException {
throw new InvalidParamException("value",
expression.getValue().toString(),
getPropertyName(), ac);
}

public CssAscentOverride(ApplContext ac, CssExpression expression)
throws InvalidParamException {
this(ac, expression, false);
}

/**
* Returns the value of this property
*/
public Object get() {
return value;
}


/**
* Returns the name of this property
*/
public final String getPropertyName() {
return "ascent-override";
}

/**
* Returns true if this property is "softly" inherited
* e.g. his value is equals to inherit
*/
public boolean isSoftlyInherited() {
return value.equals(inherit);
}

/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}

/**
* Add this property to the CssStyle.
*
* @param style The CssStyle
*/
public void addToStyle(ApplContext ac, CssStyle style) {
Css3Style s = (Css3Style) style;
if (s.fontFaceCssAscentOverride != null) {
style.addRedefinitionWarning(ac, this);
}
s.fontFaceCssAscentOverride = this;
}


/**
* Compares two properties for equality.
*
* @param property The other property.
*/
public boolean equals(CssProperty property) {
return (property instanceof CssAscentOverride &&
value.equals(((CssAscentOverride) property).value));
}


/**
* Get this property in the style.
*
* @param style The style where the property is
* @param resolve if true, resolve the style to find this property
*/
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
if (resolve) {
return ((Css3Style) style).getFontFaceCssAscentOverride();
} else {
return ((Css3Style) style).fontFaceCssAscentOverride;
}
}
}

118 changes: 118 additions & 0 deletions org/w3c/css/properties/css/fontface/CssDescentOverride.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
//
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM, Keio, Beihang, 2021.
// Please first read the full copyright statement in file COPYRIGHT.html

package org.w3c.css.properties.css.fontface;

import org.w3c.css.parser.CssStyle;
import org.w3c.css.properties.css.CssProperty;
import org.w3c.css.properties.css3.Css3Style;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssValue;

/**
* @since CSS3
*/
public class CssDescentOverride extends CssProperty {

public CssValue value;

/**
* Create a new CssDescentOverride
*/
public CssDescentOverride() {
}

/**
* Creates a new CssDescentOverride
*
* @param expression The expression for this property
* @throws InvalidParamException
* Expressions are incorrect
*/
public CssDescentOverride(ApplContext ac, CssExpression expression, boolean check)
throws InvalidParamException {
throw new InvalidParamException("value",
expression.getValue().toString(),
getPropertyName(), ac);
}

public CssDescentOverride(ApplContext ac, CssExpression expression)
throws InvalidParamException {
this(ac, expression, false);
}

/**
* Returns the value of this property
*/
public Object get() {
return value;
}


/**
* Returns the name of this property
*/
public final String getPropertyName() {
return "descent-override";
}

/**
* Returns true if this property is "softly" inherited
* e.g. his value is equals to inherit
*/
public boolean isSoftlyInherited() {
return value.equals(inherit);
}

/**
* Returns a string representation of the object.
*/
public String toString() {
return value.toString();
}

/**
* Add this property to the CssStyle.
*
* @param style The CssStyle
*/
public void addToStyle(ApplContext ac, CssStyle style) {
Css3Style s = (Css3Style) style;
if (s.fontFaceCssDescentOverride != null) {
style.addRedefinitionWarning(ac, this);
}
s.fontFaceCssDescentOverride = this;
}


/**
* Compares two properties for equality.
*
* @param property The other property.
*/
public boolean equals(CssProperty property) {
return (property instanceof CssDescentOverride &&
value.equals(((CssDescentOverride) property).value));
}


/**
* Get this property in the style.
*
* @param style The style where the property is
* @param resolve if true, resolve the style to find this property
*/
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
if (resolve) {
return ((Css3Style) style).getFontFaceCssDescentOverride();
} else {
return ((Css3Style) style).fontFaceCssDescentOverride;
}
}
}

Loading