Skip to content

Commit 721fc68

Browse files
committed
1 parent dff3333 commit 721fc68

File tree

4 files changed

+166
-0
lines changed

4 files changed

+166
-0
lines changed

org/w3c/css/properties/CSS3Properties.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ inline-sizing: org.w3c.css.properties.css3.CssInlineSiz
470470
overscroll-behavior: org.w3c.css.properties.css3.CssOverscrollBehavior
471471
overscroll-behavior-x: org.w3c.css.properties.css3.CssOverscrollBehaviorX
472472
overscroll-behavior-y: org.w3c.css.properties.css3.CssOverscrollBehaviorY
473+
overscroll-behavior-inline: org.w3c.css.properties.css3.CssOverscrollBehaviorInline
473474

474475
# CSS Multi-column Layout Module
475476
# http://www.w3.org/TR/css3-multicol/
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
// $Id$
2+
// Author: Yves Lafon <ylafon@w3.org>
3+
//
4+
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
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 CssOverscrollBehaviorInline extends CssProperty {
18+
19+
/**
20+
* Create a new CssOverscrollBehaviorInline
21+
*/
22+
public CssOverscrollBehaviorInline() {
23+
}
24+
25+
/**
26+
* Creates a new CssOverscrollBehaviorInline
27+
*
28+
* @param expression The expression for this property
29+
* @throws InvalidParamException
30+
* Expressions are incorrect
31+
*/
32+
public CssOverscrollBehaviorInline(ApplContext ac, CssExpression expression, boolean check)
33+
throws InvalidParamException {
34+
throw new InvalidParamException("value",
35+
expression.getValue().toString(),
36+
getPropertyName(), ac);
37+
}
38+
39+
public CssOverscrollBehaviorInline(ApplContext ac, CssExpression expression)
40+
throws InvalidParamException {
41+
this(ac, expression, false);
42+
}
43+
44+
/**
45+
* Returns the value of this property
46+
*/
47+
public Object get() {
48+
return value;
49+
}
50+
51+
52+
/**
53+
* Returns the name of this property
54+
*/
55+
public final String getPropertyName() {
56+
return "overscroll-behavior-inline";
57+
}
58+
59+
/**
60+
* Returns true if this property is "softly" inherited
61+
* e.g. his value is equals to inherit
62+
*/
63+
public boolean isSoftlyInherited() {
64+
return inherit.equals(value);
65+
}
66+
67+
/**
68+
* Returns a string representation of the object.
69+
*/
70+
public String toString() {
71+
return value.toString();
72+
}
73+
74+
/**
75+
* Add this property to the CssStyle.
76+
*
77+
* @param style The CssStyle
78+
*/
79+
public void addToStyle(ApplContext ac, CssStyle style) {
80+
if (((Css3Style) style).cssOverscrollBehaviorInline != null)
81+
style.addRedefinitionWarning(ac, this);
82+
((Css3Style) style).cssOverscrollBehaviorInline = this;
83+
}
84+
85+
/**
86+
* Compares two properties for equality.
87+
*
88+
* @param property The other property.
89+
*/
90+
public boolean equals(CssProperty property) {
91+
return (property instanceof CssOverscrollBehaviorInline &&
92+
value.equals(((CssOverscrollBehaviorInline) property).value));
93+
}
94+
95+
96+
/**
97+
* Get this property in the style.
98+
*
99+
* @param style The style where the property is
100+
* @param resolve if true, resolve the style to find this property
101+
*/
102+
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
103+
if (resolve) {
104+
return ((Css3Style) style).getOverscrollBehaviorInline();
105+
} else {
106+
return ((Css3Style) style).cssOverscrollBehaviorInline;
107+
}
108+
}
109+
}
110+

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@
198198
import org.w3c.css.properties.css.CssOverflowX;
199199
import org.w3c.css.properties.css.CssOverflowY;
200200
import org.w3c.css.properties.css.CssOverscrollBehavior;
201+
import org.w3c.css.properties.css.CssOverscrollBehaviorInline;
201202
import org.w3c.css.properties.css.CssOverscrollBehaviorX;
202203
import org.w3c.css.properties.css.CssOverscrollBehaviorY;
203204
import org.w3c.css.properties.css.CssPaddingBlock;
@@ -676,6 +677,7 @@ public class Css3Style extends ATSCStyle {
676677
public CssOverscrollBehaviorX cssOverscrollBehaviorX;
677678
public CssOverscrollBehaviorY cssOverscrollBehaviorY;
678679
public CssOverscrollBehavior cssOverscrollBehavior;
680+
public CssOverscrollBehaviorInline cssOverscrollBehaviorInline;
679681

680682
public CssOverscrollBehavior getOverscrollBehavior() {
681683
if (cssOverscrollBehavior == null) {
@@ -704,6 +706,15 @@ public CssOverscrollBehaviorY getOverscrollBehaviorY() {
704706
return cssOverscrollBehaviorY;
705707
}
706708

709+
public CssOverscrollBehaviorInline getOverscrollBehaviorInline() {
710+
if (cssOverscrollBehaviorInline == null) {
711+
cssOverscrollBehaviorInline =
712+
(CssOverscrollBehaviorInline) style.CascadingOrder(new CssOverscrollBehaviorInline(),
713+
style, selector);
714+
}
715+
return cssOverscrollBehaviorInline;
716+
}
717+
707718
public CssScrollbarColor getScrollbarColor() {
708719
if (cssScrollbarColor == null) {
709720
cssScrollbarColor =
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// $Id$
2+
// Author: Yves Lafon <ylafon@w3.org>
3+
//
4+
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
5+
// Please first read the full copyright statement in file COPYRIGHT.html
6+
package org.w3c.css.properties.css3;
7+
8+
import org.w3c.css.util.ApplContext;
9+
import org.w3c.css.util.InvalidParamException;
10+
import org.w3c.css.values.CssExpression;
11+
12+
/**
13+
* @spec https://www.w3.org/TR/2019/WD-css-overscroll-1-20190606/#propdef-overscroll-behavior-inline
14+
*/
15+
public class CssOverscrollBehaviorInline extends org.w3c.css.properties.css.CssOverscrollBehaviorInline {
16+
17+
/**
18+
* Create a new CssOverscrollBehaviorInline
19+
*/
20+
public CssOverscrollBehaviorInline() {
21+
value = initial;
22+
}
23+
24+
/**
25+
* Creates a new CssOverscrollBehaviorInline
26+
*
27+
* @param expression The expression for this property
28+
* @throws InvalidParamException
29+
* Expressions are incorrect
30+
*/
31+
public CssOverscrollBehaviorInline(ApplContext ac, CssExpression expression, boolean check)
32+
throws InvalidParamException {
33+
setByUser();
34+
value = CssOverscrollBehavior.checkOverscrollBehaviorAxis(ac, expression, check, this);
35+
}
36+
37+
public CssOverscrollBehaviorInline(ApplContext ac, CssExpression expression)
38+
throws InvalidParamException {
39+
this(ac, expression, false);
40+
}
41+
42+
43+
}
44+

0 commit comments

Comments
 (0)