Skip to content

Commit 9a19bec

Browse files
authored
Merge pull request #205 from w3c/yl-css-align-3
css align 3
2 parents 04086cf + 4813cb6 commit 9a19bec

25 files changed

+2208
-290
lines changed

org/w3c/css/properties/CSS3Properties.properties

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,27 @@ grid-auto-flow: org.w3c.css.properties.css3.CssGridAutoF
9393
grid-auto-rows: org.w3c.css.properties.css3.CssGridAutoRows
9494
grid-column: org.w3c.css.properties.css3.CssGridColumn
9595
grid-column-end: org.w3c.css.properties.css3.CssGridColumnEnd
96-
grid-column-gap: org.w3c.css.properties.css3.CssGridColumnGap
96+
grid-column-gap: org.w3c.css.properties.css3.CssColumnGap
9797
grid-column-start: org.w3c.css.properties.css3.CssGridColumnStart
98-
grid-gap: org.w3c.css.properties.css3.CssGridGap
98+
grid-gap: org.w3c.css.properties.css3.CssGap
9999
grid-row: org.w3c.css.properties.css3.CssGridRow
100100
grid-row-end: org.w3c.css.properties.css3.CssGridRowEnd
101-
grid-row-gap: org.w3c.css.properties.css3.CssGridRowGap
101+
grid-row-gap: org.w3c.css.properties.css3.CssRowGap
102102
grid-row-start: org.w3c.css.properties.css3.CssGridRowStart
103103
grid-template: org.w3c.css.properties.css3.CssGridTemplate
104104
grid-template-areas: org.w3c.css.properties.css3.CssGridTemplateAreas
105105
grid-template-columns: org.w3c.css.properties.css3.CssGridTemplateColumns
106106
grid-template-rows: org.w3c.css.properties.css3.CssGridTemplateRows
107107

108+
# align
109+
row-gap: org.w3c.css.properties.css3.CssRowGap
110+
gap: org.w3c.css.properties.css3.CssGap
111+
justify-items: org.w3c.css.properties.css3.CssJustifyItems
112+
justify-self: org.w3c.css.properties.css3.CssJustifySelf
113+
place-content: org.w3c.css.properties.css3.CssPlaceContent
114+
place-items: org.w3c.css.properties.css3.CssPlaceItems
115+
place-self: org.w3c.css.properties.css3.CssPlaceSelf
116+
108117
# text properties
109118

110119
text-shadow: org.w3c.css.properties.css3.CssTextShadow

org/w3c/css/properties/CSS3SVGProperties.properties

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,18 +150,27 @@ grid-auto-flow: org.w3c.css.properties.css3.CssGridAutoF
150150
grid-auto-rows: org.w3c.css.properties.css3.CssGridAutoRows
151151
grid-column: org.w3c.css.properties.css3.CssGridColumn
152152
grid-column-end: org.w3c.css.properties.css3.CssGridColumnEnd
153-
grid-column-gap: org.w3c.css.properties.css3.CssGridColumnGap
153+
grid-column-gap: org.w3c.css.properties.css3.CssColumnGap
154154
grid-column-start: org.w3c.css.properties.css3.CssGridColumnStart
155-
grid-gap: org.w3c.css.properties.css3.CssGridGap
155+
grid-gap: org.w3c.css.properties.css3.CssGap
156156
grid-row: org.w3c.css.properties.css3.CssGridRow
157157
grid-row-end: org.w3c.css.properties.css3.CssGridRowEnd
158-
grid-row-gap: org.w3c.css.properties.css3.CssGridRowGap
158+
grid-row-gap: org.w3c.css.properties.css3.CssRowGap
159159
grid-row-start: org.w3c.css.properties.css3.CssGridRowStart
160160
grid-template: org.w3c.css.properties.css3.CssGridTemplate
161161
grid-template-areas: org.w3c.css.properties.css3.CssGridTemplateAreas
162162
grid-template-columns: org.w3c.css.properties.css3.CssGridTemplateColumns
163163
grid-template-rows: org.w3c.css.properties.css3.CssGridTemplateRows
164164

165+
# align
166+
row-gap: org.w3c.css.properties.css3.CssRowGap
167+
gap: org.w3c.css.properties.css3.CssGap
168+
justify-items: org.w3c.css.properties.css3.CssJustifyItems
169+
justify-self: org.w3c.css.properties.css3.CssJustifySelf
170+
place-content: org.w3c.css.properties.css3.CssPlaceContent
171+
place-items: org.w3c.css.properties.css3.CssPlaceItems
172+
place-self: org.w3c.css.properties.css3.CssPlaceSelf
173+
165174
# text properties
166175

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

0 commit comments

Comments
 (0)