Skip to content

Commit b95e4fc

Browse files
committed
1 parent 2fe0107 commit b95e4fc

File tree

5 files changed

+215
-170
lines changed

5 files changed

+215
-170
lines changed

org/w3c/css/properties/CSS3Properties.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@ ruby-position: org.w3c.css.properties.css3.CssRubyPosit
257257
ruby-align: org.w3c.css.properties.css3.CssRubyAlign
258258
ruby-overhang: org.w3c.css.properties.css3.CssRubyOverhang
259259
writing-mode: org.w3c.css.properties.css3.CssWritingMode
260-
dominant-baseline: org.w3c.css.properties.css3.CssDominantBaseLine
261260
alignment-baseline: org.w3c.css.properties.css3.CssAlignmentBaseLine
262261
alignment-adjust: org.w3c.css.properties.css3.CssAlignmentAdjust
263262
fit: org.w3c.css.properties.css3.CssFit
264263
handheld.background-clip: org.w3c.css.properties.css3.CssBackgroundClip
265264

266265
# CSS Inline
267266
baseline-shift: org.w3c.css.properties.css3.CssBaselineShift
267+
dominant-baseline: org.w3c.css.properties.css3.CssDominantBaseline
268268

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

org/w3c/css/properties/css3/Css3Style.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.w3c.css.properties.css.CssColumnSpan;
4646
import org.w3c.css.properties.css.CssColumnWidth;
4747
import org.w3c.css.properties.css.CssColumns;
48+
import org.w3c.css.properties.css.CssDominantBaseline;
4849
import org.w3c.css.properties.css.CssFilter;
4950
import org.w3c.css.properties.css.CssFlex;
5051
import org.w3c.css.properties.css.CssFlexBasis;
@@ -153,10 +154,10 @@ public class Css3Style extends ATSCStyle {
153154
CssWritingMode cssWritingMode;
154155
CssGlyphOrVert cssGlyphOrVert;
155156
CssGlyphHor cssGlyphHor;
156-
CssDominantBaseLine cssDominantBaseLine;
157157
CssAlignmentBaseLine cssAlignmentBaseLine;
158158
CssAlignmentAdjust cssAlignmentAdjust;
159159
public CssBaselineShift cssBaselineShift;
160+
public CssDominantBaseline cssDominantBaseline;
160161
CssFit cssFit;
161162

162163
public CssOpacity cssOpacity;
@@ -399,13 +400,13 @@ public CssTextAlignLast getTextAlignLast() {
399400
return cssTextAlignLast;
400401
}
401402

402-
public CssDominantBaseLine getDominantBaseLine() {
403-
if (cssDominantBaseLine == null) {
404-
cssDominantBaseLine =
405-
(CssDominantBaseLine) style.CascadingOrder(
406-
new CssDominantBaseLine(), style, selector);
403+
public CssDominantBaseline getDominantBaseline() {
404+
if (cssDominantBaseline == null) {
405+
cssDominantBaseline =
406+
(CssDominantBaseline) style.CascadingOrder(
407+
new CssDominantBaseline(), style, selector);
407408
}
408-
return cssDominantBaseLine;
409+
return cssDominantBaseline;
409410
}
410411

411412
public CssAlignmentBaseLine getAlignmentBaseLine() {

org/w3c/css/properties/css3/CssDominantBaseLine.java

Lines changed: 0 additions & 162 deletions
This file was deleted.

0 commit comments

Comments
 (0)