diff --git a/org/w3c/css/properties/CSS3Properties.properties b/org/w3c/css/properties/CSS3Properties.properties index 12fffa8a4..310007108 100644 --- a/org/w3c/css/properties/CSS3Properties.properties +++ b/org/w3c/css/properties/CSS3Properties.properties @@ -518,8 +518,12 @@ nav-up: org.w3c.css.properties.css3.CssNavUp nav-right: org.w3c.css.properties.css3.CssNavRight nav-down: org.w3c.css.properties.css3.CssNavDown nav-left: org.w3c.css.properties.css3.CssNavLeft +overflow-block: org.w3c.css.properties.css3.CssOverflowBlock +overflow-clip-margin: org.w3c.css.properties.css3.CssOverflowClipMargin +overflow-inline: org.w3c.css.properties.css3.CssOverflowInline overflow-x: org.w3c.css.properties.css3.CssOverflowX overflow-y: org.w3c.css.properties.css3.CssOverflowY +scrollbar-gutter: org.w3c.css.properties.css3.CssScrollbarGutter ruby-span: org.w3c.css.properties.css3.CssRubySpan filter: org.w3c.css.properties.css3.CssFilter diff --git a/org/w3c/css/properties/css/CssOverflowBlock.java b/org/w3c/css/properties/css/CssOverflowBlock.java new file mode 100644 index 000000000..3929ed8d8 --- /dev/null +++ b/org/w3c/css/properties/css/CssOverflowBlock.java @@ -0,0 +1,111 @@ +// +// Author: Yves Lafon +// +// (c) COPYRIGHT W3C, 2026. +// Please first read the full copyright statement in file COPYRIGHT.html +package org.w3c.css.properties.css; + +import org.w3c.css.parser.CssStyle; +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; + +/** + * @since CSS3 + */ +public class CssOverflowBlock extends CssProperty { + + + /** + * Create a new CssOverflowBlock + */ + public CssOverflowBlock() { + } + + /** + * Creates a new CssOverflowBlock + * + * @param expression The expression for this property + * @throws InvalidParamException + * Expressions are incorrect + */ + public CssOverflowBlock(ApplContext ac, CssExpression expression, boolean check) + throws InvalidParamException { + throw new InvalidParamException("value", + expression.getValue().toString(), + getPropertyName(), ac); + } + + public CssOverflowBlock(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 "overflow-block"; + } + + /** + * Returns true if this property is "softly" inherited + * e.g. his value is equals to inherit + */ + public boolean isSoftlyInherited() { + return inherit.equals(value); + } + + /** + * 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) { + if (((Css3Style) style).cssOverflowBlock != null) + style.addRedefinitionWarning(ac, this); + ((Css3Style) style).cssOverflowBlock = this; + } + + /** + * Compares two properties for equality. + * + * @param property The other property. + */ + public boolean equals(CssProperty property) { + return (property instanceof CssOverflowBlock && + value.equals(((CssOverflowBlock) 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).getOverflowBlock(); + } else { + return ((Css3Style) style).cssOverflowBlock; + } + } +} + diff --git a/org/w3c/css/properties/css/CssOverflowClipMargin.java b/org/w3c/css/properties/css/CssOverflowClipMargin.java new file mode 100644 index 000000000..d0a2dc49d --- /dev/null +++ b/org/w3c/css/properties/css/CssOverflowClipMargin.java @@ -0,0 +1,111 @@ +// +// Author: Yves Lafon +// +// (c) COPYRIGHT W3C, 2026. +// Please first read the full copyright statement in file COPYRIGHT.html +package org.w3c.css.properties.css; + +import org.w3c.css.parser.CssStyle; +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; + +/** + * @since CSS3 + */ +public class CssOverflowClipMargin extends CssProperty { + + + /** + * Create a new CssOverflowClipMargin + */ + public CssOverflowClipMargin() { + } + + /** + * Creates a new CssOverflowClipMargin + * + * @param expression The expression for this property + * @throws InvalidParamException + * Expressions are incorrect + */ + public CssOverflowClipMargin(ApplContext ac, CssExpression expression, boolean check) + throws InvalidParamException { + throw new InvalidParamException("value", + expression.getValue().toString(), + getPropertyName(), ac); + } + + public CssOverflowClipMargin(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 "overflow-clip-margin"; + } + + /** + * Returns true if this property is "softly" inherited + * e.g. his value is equals to inherit + */ + public boolean isSoftlyInherited() { + return inherit.equals(value); + } + + /** + * 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) { + if (((Css3Style) style).cssOverflowClipMargin != null) + style.addRedefinitionWarning(ac, this); + ((Css3Style) style).cssOverflowClipMargin = this; + } + + /** + * Compares two properties for equality. + * + * @param property The other property. + */ + public boolean equals(CssProperty property) { + return (property instanceof CssOverflowClipMargin && + value.equals(((CssOverflowClipMargin) 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).getOverflowClipMargin(); + } else { + return ((Css3Style) style).cssOverflowClipMargin; + } + } +} + diff --git a/org/w3c/css/properties/css/CssOverflowInline.java b/org/w3c/css/properties/css/CssOverflowInline.java new file mode 100644 index 000000000..360aa9fe4 --- /dev/null +++ b/org/w3c/css/properties/css/CssOverflowInline.java @@ -0,0 +1,111 @@ +// +// Author: Yves Lafon +// +// (c) COPYRIGHT W3C, 2026. +// Please first read the full copyright statement in file COPYRIGHT.html +package org.w3c.css.properties.css; + +import org.w3c.css.parser.CssStyle; +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; + +/** + * @since CSS3 + */ +public class CssOverflowInline extends CssProperty { + + + /** + * Create a new CssOverflowInline + */ + public CssOverflowInline() { + } + + /** + * Creates a new CssOverflowInline + * + * @param expression The expression for this property + * @throws InvalidParamException + * Expressions are incorrect + */ + public CssOverflowInline(ApplContext ac, CssExpression expression, boolean check) + throws InvalidParamException { + throw new InvalidParamException("value", + expression.getValue().toString(), + getPropertyName(), ac); + } + + public CssOverflowInline(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 "overflow-block"; + } + + /** + * Returns true if this property is "softly" inherited + * e.g. his value is equals to inherit + */ + public boolean isSoftlyInherited() { + return inherit.equals(value); + } + + /** + * 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) { + if (((Css3Style) style).cssOverflowInline != null) + style.addRedefinitionWarning(ac, this); + ((Css3Style) style).cssOverflowInline = this; + } + + /** + * Compares two properties for equality. + * + * @param property The other property. + */ + public boolean equals(CssProperty property) { + return (property instanceof CssOverflowInline && + value.equals(((CssOverflowInline) 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).getOverflowInline(); + } else { + return ((Css3Style) style).cssOverflowInline; + } + } +} + diff --git a/org/w3c/css/properties/css/CssScrollbarGutter.java b/org/w3c/css/properties/css/CssScrollbarGutter.java new file mode 100644 index 000000000..ae97f9b81 --- /dev/null +++ b/org/w3c/css/properties/css/CssScrollbarGutter.java @@ -0,0 +1,111 @@ +// +// Author: Yves Lafon +// +// (c) COPYRIGHT W3C, 2026. +// Please first read the full copyright statement in file COPYRIGHT.html +package org.w3c.css.properties.css; + +import org.w3c.css.parser.CssStyle; +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; + +/** + * @since CSS3 + */ +public class CssScrollbarGutter extends CssProperty { + + + /** + * Create a new CssScrollbarGutter + */ + public CssScrollbarGutter() { + } + + /** + * Creates a new CssScrollbarGutter + * + * @param expression The expression for this property + * @throws InvalidParamException + * Expressions are incorrect + */ + public CssScrollbarGutter(ApplContext ac, CssExpression expression, boolean check) + throws InvalidParamException { + throw new InvalidParamException("value", + expression.getValue().toString(), + getPropertyName(), ac); + } + + public CssScrollbarGutter(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 "scrollbar-gutter"; + } + + /** + * Returns true if this property is "softly" inherited + * e.g. his value is equals to inherit + */ + public boolean isSoftlyInherited() { + return inherit.equals(value); + } + + /** + * 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) { + if (((Css3Style) style).cssScrollbarGutter != null) + style.addRedefinitionWarning(ac, this); + ((Css3Style) style).cssScrollbarGutter = this; + } + + /** + * Compares two properties for equality. + * + * @param property The other property. + */ + public boolean equals(CssProperty property) { + return (property instanceof CssScrollbarGutter && + value.equals(((CssScrollbarGutter) 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).getScrollbarGutter(); + } else { + return ((Css3Style) style).cssScrollbarGutter; + } + } +} + diff --git a/org/w3c/css/properties/css3/Css3Style.java b/org/w3c/css/properties/css3/Css3Style.java index 6eec21693..f0c2f5b15 100644 --- a/org/w3c/css/properties/css3/Css3Style.java +++ b/org/w3c/css/properties/css3/Css3Style.java @@ -201,6 +201,9 @@ import org.w3c.css.properties.css.CssOrder; import org.w3c.css.properties.css.CssOutlineOffset; import org.w3c.css.properties.css.CssOverflowAnchor; +import org.w3c.css.properties.css.CssOverflowBlock; +import org.w3c.css.properties.css.CssOverflowClipMargin; +import org.w3c.css.properties.css.CssOverflowInline; import org.w3c.css.properties.css.CssOverflowStyle; import org.w3c.css.properties.css.CssOverflowWrap; import org.w3c.css.properties.css.CssOverflowX; @@ -259,6 +262,7 @@ import org.w3c.css.properties.css.CssScrollSnapStop; import org.w3c.css.properties.css.CssScrollSnapType; import org.w3c.css.properties.css.CssScrollbarColor; +import org.w3c.css.properties.css.CssScrollbarGutter; import org.w3c.css.properties.css.CssScrollbarWidth; import org.w3c.css.properties.css.CssSpeakAs; import org.w3c.css.properties.css.CssTabSize; @@ -590,6 +594,10 @@ public class Css3Style extends ATSCStyle { public CssOverflowX cssOverflowX; public CssOverflowY cssOverflowY; + public CssOverflowBlock cssOverflowBlock; + public CssOverflowInline cssOverflowInline; + public CssOverflowClipMargin cssOverflowClipMargin; + public CssScrollbarGutter cssScrollbarGutter; public CssObjectFit cssObjectFit; public CssObjectPosition cssObjectPosition; @@ -3004,6 +3012,42 @@ public CssOverflowY getOverflowY() { return cssOverflowY; } + public CssOverflowBlock getOverflowBlock() { + if (cssOverflowBlock == null) { + cssOverflowBlock = + (CssOverflowBlock) style.CascadingOrder( + new CssOverflowBlock(), style, selector); + } + return cssOverflowBlock; + } + + public CssOverflowInline getOverflowInline() { + if (cssOverflowInline == null) { + cssOverflowInline = + (CssOverflowInline) style.CascadingOrder( + new CssOverflowInline(), style, selector); + } + return cssOverflowInline; + } + + public CssOverflowClipMargin getOverflowClipMargin() { + if (cssOverflowClipMargin == null) { + cssOverflowClipMargin = + (CssOverflowClipMargin) style.CascadingOrder( + new CssOverflowClipMargin(), style, selector); + } + return cssOverflowClipMargin; + } + + public CssScrollbarGutter getScrollbarGutter() { + if (cssScrollbarGutter == null) { + cssScrollbarGutter = + (CssScrollbarGutter) style.CascadingOrder( + new CssScrollbarGutter(), style, selector); + } + return cssScrollbarGutter; + } + public CssRubySpan getRubySpan() { if (cssRubySpan == null) { cssRubySpan = diff --git a/org/w3c/css/properties/css3/CssOverflowBlock.java b/org/w3c/css/properties/css3/CssOverflowBlock.java new file mode 100644 index 000000000..7a3071f6a --- /dev/null +++ b/org/w3c/css/properties/css3/CssOverflowBlock.java @@ -0,0 +1,45 @@ +// +// Author: Yves Lafon +// +// (c) COPYRIGHT W3C, 2026. +// Please first read the full copyright statement in file COPYRIGHT.html +package org.w3c.css.properties.css3; + +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; + +/** + * @spec https://www.w3.org/TR/2025/WD-css-overflow-3-20251007/#propdef-overflow-block + * @see CssOverflow + */ +public class CssOverflowBlock extends org.w3c.css.properties.css.CssOverflowBlock { + + /** + * Create a new CssOverflowBlock + */ + public CssOverflowBlock() { + value = initial; + } + + /** + * Creates a new CssOverflowBlock + * + * @param expression The expression for this property + * @throws InvalidParamException + * Expressions are incorrect + */ + public CssOverflowBlock(ApplContext ac, CssExpression expression, boolean check) + throws InvalidParamException { + setByUser(); + value = CssOverflow.checkOverflowAxis(ac, expression, check, this); + } + + public CssOverflowBlock(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + + +} + diff --git a/org/w3c/css/properties/css3/CssOverflowClipMargin.java b/org/w3c/css/properties/css3/CssOverflowClipMargin.java new file mode 100644 index 000000000..931e7b160 --- /dev/null +++ b/org/w3c/css/properties/css3/CssOverflowClipMargin.java @@ -0,0 +1,127 @@ +// +// Author: Yves Lafon +// +// (c) COPYRIGHT W3C, 2026. +// Please first read the full copyright statement in file COPYRIGHT.html +package org.w3c.css.properties.css3; + +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssIdent; +import org.w3c.css.values.CssTypes; +import org.w3c.css.values.CssValue; +import org.w3c.css.values.CssValueList; + +import java.util.ArrayList; + +import static org.w3c.css.values.CssOperator.SPACE; + +/** + * @spec https://www.w3.org/TR/2025/WD-css-overflow-3-20251007/#propdef-overflow-clip-margin + */ +public class CssOverflowClipMargin extends org.w3c.css.properties.css.CssOverflowClipMargin { + + private static CssIdent[] visual_box_values; + + static { + String id_values[] = {"content-box", "padding-box", "border-box"}; + visual_box_values = new CssIdent[id_values.length]; + int i = 0; + for (String s : id_values) { + visual_box_values[i++] = CssIdent.getIdent(s); + } + } + + public static CssIdent getVisualBoxIdent(CssIdent ident) { + for (CssIdent id : visual_box_values) { + if (id.equals(ident)) { + return id; + } + } + return null; + } + + /** + * Create a new CssOverflowClipMargin + */ + public CssOverflowClipMargin() { + value = initial; + } + + /** + * Creates a new CssOverflowClipMargin + * + * @param expression The expression for this property + * @throws InvalidParamException Expressions are incorrect + */ + public CssOverflowClipMargin(ApplContext ac, CssExpression expression, boolean check) + throws InvalidParamException { + setByUser(); + + boolean got_length = false; + boolean got_visualbox = false; + CssValue val; + char op; + + if (check && expression.getCount() > 2) { + throw new InvalidParamException("unrecognize", ac); + } + + ArrayList v = new ArrayList(); + + while (!expression.end()) { + val = expression.getValue(); + op = expression.getOperator(); + + switch (val.getType()) { + case CssTypes.CSS_NUMBER: + val.getCheckableValue().checkEqualsZero(ac, this); + case CssTypes.CSS_LENGTH: + val.getCheckableValue().checkPositiveness(ac, this); + if (got_length) { + throw new InvalidParamException("value", val, getPropertyName(), ac); + } + v.add(val); + got_length = true; + break; + case CssTypes.CSS_IDENT: + CssIdent id = val.getIdent(); + if (CssIdent.isCssWide(id)) { + if (expression.getCount() > 1) { + throw new InvalidParamException("value", val, + getPropertyName(), ac); + } + v.add(val); + break; + } + if (getVisualBoxIdent(id) != null) { + if (got_visualbox) { + throw new InvalidParamException("value", val, + getPropertyName(), ac); + } + v.add(val); + got_visualbox = true; + break; + } + default: + throw new InvalidParamException("value", val, + getPropertyName(), ac); + } + if (op != SPACE) { + throw new InvalidParamException("operator", val, + getPropertyName(), ac); + } + expression.next(); + } + value = (v.size() == 1) ? v.get(0) : new CssValueList(v); + } + + public CssOverflowClipMargin(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + + +} + diff --git a/org/w3c/css/properties/css3/CssOverflowInline.java b/org/w3c/css/properties/css3/CssOverflowInline.java new file mode 100644 index 000000000..d7dc532ec --- /dev/null +++ b/org/w3c/css/properties/css3/CssOverflowInline.java @@ -0,0 +1,45 @@ +// +// Author: Yves Lafon +// +// (c) COPYRIGHT W3C, 2026. +// Please first read the full copyright statement in file COPYRIGHT.html +package org.w3c.css.properties.css3; + +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; + +/** + * @spec https://www.w3.org/TR/2025/WD-css-overflow-3-20251007/#propdef-overflow-inline + * @see CssOverflow + */ +public class CssOverflowInline extends org.w3c.css.properties.css.CssOverflowInline { + + /** + * Create a new CssOverflowInline + */ + public CssOverflowInline() { + value = initial; + } + + /** + * Creates a new CssOverflowInline + * + * @param expression The expression for this property + * @throws InvalidParamException + * Expressions are incorrect + */ + public CssOverflowInline(ApplContext ac, CssExpression expression, boolean check) + throws InvalidParamException { + setByUser(); + value = CssOverflow.checkOverflowAxis(ac, expression, check, this); + } + + public CssOverflowInline(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + + +} + diff --git a/org/w3c/css/properties/css3/CssScrollbarGutter.java b/org/w3c/css/properties/css3/CssScrollbarGutter.java new file mode 100644 index 000000000..b5eccfbd9 --- /dev/null +++ b/org/w3c/css/properties/css3/CssScrollbarGutter.java @@ -0,0 +1,116 @@ +// +// Author: Yves Lafon +// +// (c) COPYRIGHT W3C, 2026. +// Please first read the full copyright statement in file COPYRIGHT.html +package org.w3c.css.properties.css3; + +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssIdent; +import org.w3c.css.values.CssTypes; +import org.w3c.css.values.CssValue; +import org.w3c.css.values.CssValueList; + +import java.util.ArrayList; + +import static org.w3c.css.values.CssOperator.SPACE; + +/** + * @spec https://www.w3.org/TR/2025/WD-css-overflow-3-20251007/#propdef-scrollbar-gutter + */ +public class CssScrollbarGutter extends org.w3c.css.properties.css.CssScrollbarGutter { + + private static CssIdent auto, stable, both_edges; + + static { + auto = new CssIdent("auto"); + stable = new CssIdent("stable"); + both_edges = new CssIdent("both-edges"); + } + + /** + * Create a new CssScrollbarGutter + */ + public CssScrollbarGutter() { + value = initial; + } + + /** + * Creates a new CssScrollbarGutter + * + * @param expression The expression for this property + * @throws InvalidParamException Expressions are incorrect + */ + public CssScrollbarGutter(ApplContext ac, CssExpression expression, boolean check) + throws InvalidParamException { + setByUser(); + + boolean got_stable = false; + boolean got_both_edges = false; + CssValue val; + char op; + + if (check && expression.getCount() > 2) { + throw new InvalidParamException("unrecognize", ac); + } + + ArrayList v = new ArrayList(); + + while (!expression.end()) { + val = expression.getValue(); + op = expression.getOperator(); + + switch (val.getType()) { + case CssTypes.CSS_IDENT: + CssIdent id = val.getIdent(); + if (CssIdent.isCssWide(id) || auto.equals(id)) { + if (expression.getCount() > 1) { + throw new InvalidParamException("value", val, + getPropertyName(), ac); + } + v.add(val); + break; + } + if (stable.equals(id)) { + if (!got_stable) { + v.add(val); + got_stable = true; + break; + } + } + if (both_edges.equals(id)) { + if (!got_both_edges) { + v.add(val); + got_both_edges = true; + break; + } + } + // let it fail + default: + throw new InvalidParamException("value", val, + getPropertyName(), ac); + } + if (op != SPACE) { + throw new InvalidParamException("operator", val, + getPropertyName(), ac); + } + expression.next(); + } + // per grammar, both-edges cannot be alone + if (got_both_edges && !got_stable) { + throw new InvalidParamException("value", both_edges, + getPropertyName(), ac); + } + value = (v.size() == 1) ? v.get(0) : new CssValueList(v); + } + + public CssScrollbarGutter(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + + +} +