Skip to content

Commit b7153af

Browse files
committed
More complete fix for #387
As SVGTinyStyle inherit from CSS3 and as image-rendering is present in CSS3 it is better to define it in Css3Style, and move all the casts from SVGBasicStyle to Css3Style
1 parent ebabe74 commit b7153af

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

org/w3c/css/properties/css/CssImageRendering.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package org.w3c.css.properties.css;
77

88
import org.w3c.css.parser.CssStyle;
9-
import org.w3c.css.properties.svg.SVGBasicStyle;
9+
import org.w3c.css.properties.css3.Css3Style;
1010
import org.w3c.css.util.ApplContext;
1111
import org.w3c.css.util.InvalidParamException;
1212
import org.w3c.css.values.CssExpression;
@@ -78,7 +78,7 @@ public String toString() {
7878
* @param style The CssStyle
7979
*/
8080
public void addToStyle(ApplContext ac, CssStyle style) {
81-
SVGBasicStyle s = (SVGBasicStyle) style;
81+
Css3Style s = (Css3Style) style;
8282
if (s.cssImageRendering != null) {
8383
style.addRedefinitionWarning(ac, this);
8484
}
@@ -105,9 +105,9 @@ public boolean equals(CssProperty property) {
105105
*/
106106
public CssProperty getPropertyInStyle(CssStyle style, boolean resolve) {
107107
if (resolve) {
108-
return ((SVGBasicStyle) style).getImageRendering();
108+
return ((Css3Style) style).getImageRendering();
109109
} else {
110-
return ((SVGBasicStyle) style).cssImageRendering;
110+
return ((Css3Style) style).cssImageRendering;
111111
}
112112
}
113113
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import org.w3c.css.properties.css.CssBorderBlockWidth;
5353
import org.w3c.css.properties.css.CssBorderEndEndRadius;
5454
import org.w3c.css.properties.css.CssBorderEndStartRadius;
55+
import org.w3c.css.properties.css.CssImageRendering;
5556
import org.w3c.css.properties.css.CssBorderImageSource;
5657
import org.w3c.css.properties.css.CssBorderInline;
5758
import org.w3c.css.properties.css.CssBorderInlineColor;
@@ -566,6 +567,7 @@ public class Css3Style extends ATSCStyle {
566567
public CssObjectPosition cssObjectPosition;
567568
public CssImageOrientation cssImageOrientation;
568569
public CssImageResolution cssImageResolution;
570+
public CssImageRendering cssImageRendering;
569571

570572
CssRubySpan cssRubySpan;
571573

@@ -1797,6 +1799,13 @@ public org.w3c.css.properties.css.counterstyle.CssNegative getCounterStyleCssNeg
17971799
return counterStyleCssNegative;
17981800
}
17991801

1802+
public CssImageRendering getImageRendering() {
1803+
if (cssImageRendering == null) {
1804+
cssImageRendering = (CssImageRendering) style.CascadingOrder(new CssImageRendering(), style, selector);
1805+
}
1806+
return cssImageRendering;
1807+
}
1808+
18001809
public CssBorderImageSource getBorderImageSource() {
18011810
if (cssBorder.borderImage.source == null) {
18021811
cssBorder.borderImage.source = (CssBorderImageSource) style.CascadingOrder(new CssBorderImageSource(), style, selector);

org/w3c/css/properties/svg/SVGBasicStyle.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import org.w3c.css.properties.css.CssFillOpacity;
1818
import org.w3c.css.properties.css.CssGlyphOrientationHorizontal;
1919
import org.w3c.css.properties.css.CssGlyphOrientationVertical;
20-
import org.w3c.css.properties.css.CssImageRendering;
2120
import org.w3c.css.properties.css.CssKerning;
2221
import org.w3c.css.properties.css.CssMask;
2322
import org.w3c.css.properties.css.CssPointerEvents;
@@ -34,7 +33,6 @@ public class SVGBasicStyle extends SVGTinyStyle {
3433
public CssColorRendering cssColorRendering;
3534
public CssShapeRendering cssShapeRendering;
3635
public CssTextRendering cssTextRendering;
37-
public CssImageRendering cssImageRendering;
3836
public CssTextAnchor cssTextAnchor;
3937
public CssFillOpacity cssFillOpacity;
4038
public CssStrokeOpacity cssStrokeOpacity;
@@ -59,15 +57,6 @@ public CssColorInterpolation getColorInterpolation() {
5957
return cssColorInterpolation;
6058
}
6159

62-
public CssImageRendering getImageRendering() {
63-
if (cssImageRendering == null) {
64-
cssImageRendering =
65-
(CssImageRendering) style.CascadingOrder(new CssImageRendering(),
66-
style, selector);
67-
}
68-
return cssImageRendering;
69-
}
70-
7160
public CssColorRendering getColorRendering() {
7261
if (cssColorRendering == null) {
7362
cssColorRendering =

0 commit comments

Comments
 (0)