|
31 | 31 | import io.sf.carte.doc.style.css.om.BaseCSSStyleDeclaration; |
32 | 32 | import io.sf.carte.doc.style.css.om.CSSOMBridge; |
33 | 33 | import io.sf.carte.doc.style.css.parser.ParseHelper; |
| 34 | +import io.sf.carte.doc.style.css.property.LexicalValue; |
34 | 35 | import io.sf.carte.doc.style.css.property.NumberValue; |
35 | 36 | import io.sf.carte.doc.style.css.property.PropertyDatabase; |
36 | 37 | import io.sf.carte.doc.style.css.property.StyleValue; |
37 | 38 | import io.sf.carte.doc.style.css.property.URIValue; |
38 | | -import io.sf.carte.doc.style.css.property.ValueFactory; |
39 | 39 | import io.sf.carte.doc.style.css.property.ValueList; |
40 | | -import io.sf.carte.doc.style.css.property.VarValue; |
41 | 40 |
|
42 | 41 | class ValueComparator { |
43 | 42 |
|
@@ -251,31 +250,23 @@ && similarAlphaValue(color.getAlpha(), otherColor.getAlpha())) { |
251 | 250 | && otherValue.getCssValueType() == CssType.PROXY) { |
252 | 251 | Type ptype = value.getPrimitiveType(); |
253 | 252 | Type otype = otherValue.getPrimitiveType(); |
254 | | - if (ptype == Type.VAR && otype == Type.VAR) { |
255 | | - VarValue var = (VarValue) value; |
256 | | - VarValue varOther = (VarValue) otherValue; |
257 | | - if (var.getName().equals(varOther.getName())) { |
258 | | - LexicalUnit fb = var.getFallback(); |
259 | | - LexicalUnit fbOther = varOther.getFallback(); |
260 | | - if (fb == null) { |
261 | | - if (fbOther == null) { |
| 253 | + if (ptype == Type.LEXICAL && otype == Type.LEXICAL) { |
| 254 | + LexicalValue var = (LexicalValue) value; |
| 255 | + LexicalValue varOther = (LexicalValue) otherValue; |
| 256 | + LexicalUnit lu = var.getLexicalUnit().getParameters(); |
| 257 | + LexicalUnit luOther = varOther.getLexicalUnit().getParameters(); |
| 258 | + do { |
| 259 | + lu = lu.getNextLexicalUnit(); |
| 260 | + luOther = luOther.getNextLexicalUnit(); |
| 261 | + if (lu == null) { |
| 262 | + if (luOther == null) { |
262 | 263 | return 1; |
263 | 264 | } |
264 | | - } else if (fbOther != null) { |
265 | | - if (fb.equals(fbOther)) { |
266 | | - return 1; |
267 | | - } |
268 | | - ValueFactory vf = new ValueFactory(); |
269 | | - StyleValue fbOm, fbOtherOm; |
270 | | - try { |
271 | | - fbOm = vf.createCSSValue(fb); |
272 | | - fbOtherOm = vf.createCSSValue(fbOther); |
273 | | - } catch (DOMException e) { |
274 | | - return 2; |
275 | | - } |
276 | | - return testDifferentValue(fbOm, fbOtherOm); |
| 265 | + break; |
| 266 | + } else if (luOther != null && !lu.equals(luOther)) { |
| 267 | + break; |
277 | 268 | } |
278 | | - } |
| 269 | + } while (true); |
279 | 270 | } |
280 | 271 | return 2; |
281 | 272 | } else if (value.getCssValueType() == CssType.LIST |
|
0 commit comments