Skip to content

Commit dff3333

Browse files
committed
1 parent 922b16c commit dff3333

8 files changed

+652
-0
lines changed

org/w3c/css/properties/CSS3Properties.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,11 @@ initial-letter-align: org.w3c.css.properties.css3.CssInitialLe
466466
initial-letter-wrap: org.w3c.css.properties.css3.CssInitialLetterWrap
467467
inline-sizing: org.w3c.css.properties.css3.CssInlineSizing
468468

469+
# CSS Overscroll
470+
overscroll-behavior: org.w3c.css.properties.css3.CssOverscrollBehavior
471+
overscroll-behavior-x: org.w3c.css.properties.css3.CssOverscrollBehaviorX
472+
overscroll-behavior-y: org.w3c.css.properties.css3.CssOverscrollBehaviorY
473+
469474
# CSS Multi-column Layout Module
470475
# http://www.w3.org/TR/css3-multicol/
471476
columns: org.w3c.css.properties.css3.CssColumns
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 CSS2
16+
*/
17+
public class CssOverscrollBehavior extends CssProperty {
18+
19+
20+
/**
21+
* Create a new CssOverscrollBehavior
22+
*/
23+
public CssOverscrollBehavior() {
24+
}
25+
26+
/**
27+
* Creates a new CssOverscrollBehavior
28+
*
29+
* @param expression The expression for this property
30+
* @throws InvalidParamException Expressions are incorrect
31+
*/
32+
public CssOverscrollBehavior(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 CssOverscrollBehavior(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";
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).cssOverscrollBehavior != null)
81+
style.addRedefinitionWarning(ac, this);
82+
((Css3Style) style).cssOverscrollBehavior = 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 CssOverscrollBehavior &&
92+
value.equals(((CssOverscrollBehavior) 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).getOverscrollBehavior();
105+
} else {
106+
return ((Css3Style) style).cssOverscrollBehavior;
107+
}
108+
}
109+
}
110+
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 CssOverscrollBehaviorX extends CssProperty {
18+
19+
/**
20+
* Create a new CssOverscrollBehaviorX
21+
*/
22+
public CssOverscrollBehaviorX() {
23+
}
24+
25+
/**
26+
* Creates a new CssOverscrollBehaviorX
27+
*
28+
* @param expression The expression for this property
29+
* @throws InvalidParamException
30+
* Expressions are incorrect
31+
*/
32+
public CssOverscrollBehaviorX(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 CssOverscrollBehaviorX(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-x";
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).cssOverscrollBehaviorX != null)
81+
style.addRedefinitionWarning(ac, this);
82+
((Css3Style) style).cssOverscrollBehaviorX = 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 CssOverscrollBehaviorX &&
92+
value.equals(((CssOverscrollBehaviorX) 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).getOverscrollBehaviorX();
105+
} else {
106+
return ((Css3Style) style).cssOverscrollBehaviorX;
107+
}
108+
}
109+
}
110+
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 CssOverscrollBehaviorY extends CssProperty {
18+
19+
/**
20+
* Create a new CssOverscrollBehaviorY
21+
*/
22+
public CssOverscrollBehaviorY() {
23+
}
24+
25+
/**
26+
* Creates a new CssOverscrollBehaviorY
27+
*
28+
* @param expression The expression for this property
29+
* @throws InvalidParamException
30+
* Expressions are incorrect
31+
*/
32+
public CssOverscrollBehaviorY(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 CssOverscrollBehaviorY(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-y";
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).cssOverscrollBehaviorY != null)
81+
style.addRedefinitionWarning(ac, this);
82+
((Css3Style) style).cssOverscrollBehaviorY = 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 CssOverscrollBehaviorY &&
92+
value.equals(((CssOverscrollBehaviorY) 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).getOverscrollBehaviorY();
105+
} else {
106+
return ((Css3Style) style).cssOverscrollBehaviorY;
107+
}
108+
}
109+
}
110+

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@
197197
import org.w3c.css.properties.css.CssOverflowWrap;
198198
import org.w3c.css.properties.css.CssOverflowX;
199199
import org.w3c.css.properties.css.CssOverflowY;
200+
import org.w3c.css.properties.css.CssOverscrollBehavior;
201+
import org.w3c.css.properties.css.CssOverscrollBehaviorX;
202+
import org.w3c.css.properties.css.CssOverscrollBehaviorY;
200203
import org.w3c.css.properties.css.CssPaddingBlock;
201204
import org.w3c.css.properties.css.CssPaddingBlockEnd;
202205
import org.w3c.css.properties.css.CssPaddingBlockStart;
@@ -670,6 +673,37 @@ public class Css3Style extends ATSCStyle {
670673
public CssScrollbarWidth cssScrollbarWidth;
671674
public CssScrollbarColor cssScrollbarColor;
672675

676+
public CssOverscrollBehaviorX cssOverscrollBehaviorX;
677+
public CssOverscrollBehaviorY cssOverscrollBehaviorY;
678+
public CssOverscrollBehavior cssOverscrollBehavior;
679+
680+
public CssOverscrollBehavior getOverscrollBehavior() {
681+
if (cssOverscrollBehavior == null) {
682+
cssOverscrollBehavior =
683+
(CssOverscrollBehavior) style.CascadingOrder(new CssOverscrollBehavior(),
684+
style, selector);
685+
}
686+
return cssOverscrollBehavior;
687+
}
688+
689+
public CssOverscrollBehaviorX getOverscrollBehaviorX() {
690+
if (cssOverscrollBehaviorX == null) {
691+
cssOverscrollBehaviorX =
692+
(CssOverscrollBehaviorX) style.CascadingOrder(new CssOverscrollBehaviorX(),
693+
style, selector);
694+
}
695+
return cssOverscrollBehaviorX;
696+
}
697+
698+
public CssOverscrollBehaviorY getOverscrollBehaviorY() {
699+
if (cssOverscrollBehaviorY == null) {
700+
cssOverscrollBehaviorY =
701+
(CssOverscrollBehaviorY) style.CascadingOrder(new CssOverscrollBehaviorY(),
702+
style, selector);
703+
}
704+
return cssOverscrollBehaviorY;
705+
}
706+
673707
public CssScrollbarColor getScrollbarColor() {
674708
if (cssScrollbarColor == null) {
675709
cssScrollbarColor =

0 commit comments

Comments
 (0)