Skip to content

Commit 92aca1d

Browse files
authored
Merge pull request #500 from w3c/sizing-4
contain-intrinsic-* per https://www.w3.org/TR/2021/WD-css-sizing-4-20…
2 parents c344c78 + 6a5bdb7 commit 92aca1d

12 files changed

Lines changed: 1060 additions & 0 deletions

org/w3c/css/properties/CSS3Properties.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,12 @@ caret-shape: org.w3c.css.properties.css3.CssCaretShap
384384
aspect-ratio: org.w3c.css.properties.css3.CssAspectRatio
385385
accent-color: org.w3c.css.properties.css3.CssAccentColor
386386

387+
contain-intrinsic-block-size: org.w3c.css.properties.css3.CssContainIntrinsicBlockSize
388+
contain-intrinsic-height: org.w3c.css.properties.css3.CssContainIntrinsicHeight
389+
contain-intrinsic-inline-size: org.w3c.css.properties.css3.CssContainIntrinsicInlineSize
390+
contain-intrinsic-size: org.w3c.css.properties.css3.CssContainIntrinsicSize
391+
contain-intrinsic-width: org.w3c.css.properties.css3.CssContainIntrinsicWidth
392+
387393
overflow-anchor: org.w3c.css.properties.css3.CssOverflowAnchor
388394

389395
word-spacing: org.w3c.css.properties.css3.CssWordSpacing
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
//
2+
// Author: Yves Lafon <ylafon@w3.org>
3+
//
4+
// (c) COPYRIGHT W3C, 2026.
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 CssContainIntrinsicBlockSize extends CssProperty {
18+
19+
20+
/**
21+
* Create a new CssContainIntrinsicBlockSize
22+
*/
23+
public CssContainIntrinsicBlockSize() {
24+
}
25+
26+
/**
27+
* Creates a new CssContainIntrinsicBlockSize
28+
*
29+
* @param expression The expression for this property
30+
* @throws InvalidParamException
31+
* Expressions are incorrect
32+
*/
33+
public CssContainIntrinsicBlockSize(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 CssContainIntrinsicBlockSize(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 "contain-intrinsic-inline-size";
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 inherit.equals(value);
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+
if (((Css3Style) style).cssContainIntrinsicBlockSize != null)
82+
style.addRedefinitionWarning(ac, this);
83+
((Css3Style) style).cssContainIntrinsicBlockSize = this;
84+
}
85+
86+
/**
87+
* Compares two properties for equality.
88+
*
89+
* @param property The other property.
90+
*/
91+
public boolean equals(CssProperty property) {
92+
return (property instanceof CssContainIntrinsicBlockSize &&
93+
value.equals(((CssContainIntrinsicBlockSize) property).value));
94+
}
95+
96+
97+
/**
98+
* Get this property in the style.
99+
*
100+
* @param style The style where the property is
101+
* @param resolve if true, resolve the style to find this property
102+
*/
103+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
104+
if (resolve) {
105+
return ((Css3Style) style).getContainIntrinsicBlockSize();
106+
} else {
107+
return ((Css3Style) style).cssContainIntrinsicBlockSize;
108+
}
109+
}
110+
}
111+
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
//
2+
// Author: Yves Lafon <ylafon@w3.org>
3+
//
4+
// (c) COPYRIGHT W3C, 2026.
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 CssContainIntrinsicHeight extends CssProperty {
18+
19+
20+
/**
21+
* Create a new CssContainIntrinsicHeight
22+
*/
23+
public CssContainIntrinsicHeight() {
24+
}
25+
26+
/**
27+
* Creates a new CssContainIntrinsicHeight
28+
*
29+
* @param expression The expression for this property
30+
* @throws InvalidParamException
31+
* Expressions are incorrect
32+
*/
33+
public CssContainIntrinsicHeight(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 CssContainIntrinsicHeight(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 "contain-intrinsic-height";
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 inherit.equals(value);
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+
if (((Css3Style) style).cssContainIntrinsicHeight != null)
82+
style.addRedefinitionWarning(ac, this);
83+
((Css3Style) style).cssContainIntrinsicHeight = this;
84+
}
85+
86+
/**
87+
* Compares two properties for equality.
88+
*
89+
* @param property The other property.
90+
*/
91+
public boolean equals(CssProperty property) {
92+
return (property instanceof CssContainIntrinsicHeight &&
93+
value.equals(((CssContainIntrinsicHeight) property).value));
94+
}
95+
96+
97+
/**
98+
* Get this property in the style.
99+
*
100+
* @param style The style where the property is
101+
* @param resolve if true, resolve the style to find this property
102+
*/
103+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
104+
if (resolve) {
105+
return ((Css3Style) style).getContainIntrinsicHeight();
106+
} else {
107+
return ((Css3Style) style).cssContainIntrinsicHeight;
108+
}
109+
}
110+
}
111+
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
//
2+
// Author: Yves Lafon <ylafon@w3.org>
3+
//
4+
// (c) COPYRIGHT W3C, 2026.
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 CssContainIntrinsicInlineSize extends CssProperty {
18+
19+
20+
/**
21+
* Create a new CssContainIntrinsicInlineSize
22+
*/
23+
public CssContainIntrinsicInlineSize() {
24+
}
25+
26+
/**
27+
* Creates a new CssContainIntrinsicInlineSize
28+
*
29+
* @param expression The expression for this property
30+
* @throws InvalidParamException
31+
* Expressions are incorrect
32+
*/
33+
public CssContainIntrinsicInlineSize(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 CssContainIntrinsicInlineSize(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 "contain-intrinsic-inline-size";
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 inherit.equals(value);
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+
if (((Css3Style) style).cssContainIntrinsicInlineSize != null)
82+
style.addRedefinitionWarning(ac, this);
83+
((Css3Style) style).cssContainIntrinsicInlineSize = this;
84+
}
85+
86+
/**
87+
* Compares two properties for equality.
88+
*
89+
* @param property The other property.
90+
*/
91+
public boolean equals(CssProperty property) {
92+
return (property instanceof CssContainIntrinsicInlineSize &&
93+
value.equals(((CssContainIntrinsicInlineSize) property).value));
94+
}
95+
96+
97+
/**
98+
* Get this property in the style.
99+
*
100+
* @param style The style where the property is
101+
* @param resolve if true, resolve the style to find this property
102+
*/
103+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
104+
if (resolve) {
105+
return ((Css3Style) style).getContainIntrinsicInlineSize();
106+
} else {
107+
return ((Css3Style) style).cssContainIntrinsicInlineSize;
108+
}
109+
}
110+
}
111+

0 commit comments

Comments
 (0)