diff --git a/org/w3c/css/parser/analyzer/CssParser.java b/org/w3c/css/parser/analyzer/CssParser.java index dc76d5a3..acc975dd 100644 --- a/org/w3c/css/parser/analyzer/CssParser.java +++ b/org/w3c/css/parser/analyzer/CssParser.java @@ -6245,7 +6245,12 @@ final public void pseudo(CssSelectors s) throws ParseException { {if (true) throw new InvalidParamException("notforcss1", "inherit", ac);} } if (values == null) { - values = new CssExpression(); + if (string_property.startsWith("--")) { + values = new CssExpression(); + } else { + // old behaviour for empty properties + {if (true) throw new ParseException();} + } } if (values.getCount() != 0 || string_property.startsWith("--")) { CssProperty p = handleDeclaration(string_property.toLowerCase(), @@ -6259,9 +6264,6 @@ final public void pseudo(CssSelectors s) throws ParseException { // ok, return the new property {if ("" != null) return p;} } - } else if (values.getCount() == 0) { - // old behaviour throw when a property has an empty expression - {if (true) throw new ParseException();} } } catch (InvalidParamException e) { incompatible_error = false; @@ -9204,14 +9206,9 @@ private boolean jj_2_29(int xla) finally { jj_save(28, xla); } } - private boolean jj_3R_279() + private boolean jj_3R_452() { - if (jj_3R_240()) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_19()) { jj_scanpos = xsp; break; } - } + if (jj_3R_238()) return true; return false; } @@ -9221,15 +9218,21 @@ private boolean jj_3R_300() return false; } + private boolean jj_3R_451() + { + if (jj_scan_token(STRING)) return true; + return false; + } + private boolean jj_3R_299() { if (jj_3R_370()) return true; return false; } - private boolean jj_3R_452() + private boolean jj_3R_450() { - if (jj_3R_238()) return true; + if (jj_scan_token(DIMEN)) return true; return false; } @@ -9239,21 +9242,21 @@ private boolean jj_3R_298() return false; } - private boolean jj_3R_451() + private boolean jj_3R_297() { - if (jj_scan_token(STRING)) return true; + if (jj_3R_368()) return true; return false; } - private boolean jj_3R_297() + private boolean jj_3R_449() { - if (jj_3R_368()) return true; + if (jj_scan_token(PERCENTAGE)) return true; return false; } - private boolean jj_3R_450() + private boolean jj_3R_448() { - if (jj_scan_token(DIMEN)) return true; + if (jj_scan_token(NUMBER)) return true; return false; } @@ -9274,18 +9277,6 @@ private boolean jj_3R_263() return false; } - private boolean jj_3R_449() - { - if (jj_scan_token(PERCENTAGE)) return true; - return false; - } - - private boolean jj_3R_448() - { - if (jj_scan_token(NUMBER)) return true; - return false; - } - private boolean jj_3R_447() { if (jj_scan_token(MINUS)) return true; @@ -9484,12 +9475,6 @@ private boolean jj_3R_384() return false; } - private boolean jj_3R_362() - { - if (jj_3R_393()) return true; - return false; - } - private boolean jj_3R_374() { if (jj_scan_token(FUNCTIONATTR)) return true; @@ -9511,21 +9496,21 @@ private boolean jj_3R_374() return false; } - private boolean jj_3R_359() + private boolean jj_3R_362() { - if (jj_3R_360()) return true; + if (jj_3R_393()) return true; return false; } - private boolean jj_3R_358() + private boolean jj_3R_359() { - if (jj_3R_374()) return true; + if (jj_3R_360()) return true; return false; } - private boolean jj_3R_430() + private boolean jj_3R_358() { - if (true) { jj_la = 0; jj_scanpos = jj_lastpos; return false;} + if (jj_3R_374()) return true; return false; } @@ -9541,6 +9526,12 @@ private boolean jj_3R_356() return false; } + private boolean jj_3R_430() + { + if (true) { jj_la = 0; jj_scanpos = jj_lastpos; return false;} + return false; + } + private boolean jj_3R_355() { if (jj_3R_371()) return true; @@ -9652,23 +9643,6 @@ private boolean jj_3R_353() return false; } - private boolean jj_3R_368() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_395()) { - jj_scanpos = xsp; - if (jj_3R_396()) return true; - } - return false; - } - - private boolean jj_3R_395() - { - if (jj_scan_token(HASHIDENT)) return true; - return false; - } - private boolean jj_3R_273() { Token xsp; @@ -9695,6 +9669,23 @@ private boolean jj_3R_273() return false; } + private boolean jj_3R_368() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_395()) { + jj_scanpos = xsp; + if (jj_3R_396()) return true; + } + return false; + } + + private boolean jj_3R_395() + { + if (jj_scan_token(HASHIDENT)) return true; + return false; + } + private boolean jj_3R_440() { if (jj_3R_238()) return true; @@ -9719,15 +9710,15 @@ private boolean jj_3R_363() return false; } - private boolean jj_3_4() + private boolean jj_3R_276() { - if (jj_3R_224()) return true; + if (jj_scan_token(S)) return true; return false; } - private boolean jj_3R_276() + private boolean jj_3_4() { - if (jj_scan_token(S)) return true; + if (jj_3R_224()) return true; return false; } @@ -9742,6 +9733,17 @@ private boolean jj_3R_429() return false; } + private boolean jj_3R_246() + { + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3R_276()) { jj_scanpos = xsp; break; } + } + if (jj_scan_token(MINUS)) return true; + return false; + } + private boolean jj_3R_282() { if (jj_scan_token(LPAREN)) return true; @@ -9758,14 +9760,23 @@ private boolean jj_3R_282() return false; } - private boolean jj_3R_246() + private boolean jj_3_28() { Token xsp; while (true) { xsp = jj_scanpos; - if (jj_3R_276()) { jj_scanpos = xsp; break; } + if (jj_scan_token(21)) { jj_scanpos = xsp; break; } } - if (jj_scan_token(MINUS)) return true; + xsp = jj_scanpos; + if (jj_scan_token(52)) { + jj_scanpos = xsp; + if (jj_scan_token(55)) return true; + } + while (true) { + xsp = jj_scanpos; + if (jj_scan_token(21)) { jj_scanpos = xsp; break; } + } + if (jj_3R_247()) return true; return false; } @@ -9789,26 +9800,6 @@ private boolean jj_3R_293() return false; } - private boolean jj_3_28() - { - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_scan_token(21)) { jj_scanpos = xsp; break; } - } - xsp = jj_scanpos; - if (jj_scan_token(52)) { - jj_scanpos = xsp; - if (jj_scan_token(55)) return true; - } - while (true) { - xsp = jj_scanpos; - if (jj_scan_token(21)) { jj_scanpos = xsp; break; } - } - if (jj_3R_247()) return true; - return false; - } - private boolean jj_3R_438() { if (jj_scan_token(COMMA)) return true; @@ -10008,6 +9999,12 @@ private boolean jj_3_7() return false; } + private boolean jj_3R_361() + { + if (jj_3R_254()) return true; + return false; + } + private boolean jj_3R_289() { if (jj_scan_token(FUNCTIONWHERE)) return true; @@ -10024,12 +10021,6 @@ private boolean jj_3R_289() return false; } - private boolean jj_3R_361() - { - if (jj_3R_254()) return true; - return false; - } - private boolean jj_3R_278() { if (jj_scan_token(LPAREN)) return true; @@ -10125,6 +10116,12 @@ private boolean jj_3R_287() return false; } + private boolean jj_3R_275() + { + if (jj_3R_360()) return true; + return false; + } + private boolean jj_3R_228() { if (jj_3R_254()) return true; @@ -10226,9 +10223,9 @@ private boolean jj_3R_261() return false; } - private boolean jj_3R_275() + private boolean jj_3R_274() { - if (jj_3R_360()) return true; + if (jj_3R_247()) return true; return false; } @@ -10241,12 +10238,6 @@ private boolean jj_3R_433() return false; } - private boolean jj_3R_274() - { - if (jj_3R_247()) return true; - return false; - } - private boolean jj_3R_408() { Token xsp; @@ -10285,12 +10276,6 @@ private boolean jj_3R_260() return false; } - private boolean jj_3R_227() - { - if (jj_3R_254()) return true; - return false; - } - private boolean jj_3R_245() { if (jj_scan_token(DIV)) return true; @@ -10307,6 +10292,12 @@ private boolean jj_3R_245() return false; } + private boolean jj_3R_227() + { + if (jj_3R_254()) return true; + return false; + } + private boolean jj_3R_244() { if (jj_scan_token(ANY)) return true; @@ -10330,17 +10321,6 @@ private boolean jj_3R_445() return false; } - private boolean jj_3_9() - { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_228()) jj_scanpos = xsp; - if (jj_scan_token(AN)) return true; - xsp = jj_scanpos; - if (jj_3_6()) jj_scanpos = xsp; - return false; - } - private boolean jj_3_26() { Token xsp; @@ -10356,6 +10336,23 @@ private boolean jj_3_26() return false; } + private boolean jj_3R_272() + { + if (jj_scan_token(S)) return true; + return false; + } + + private boolean jj_3_9() + { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_228()) jj_scanpos = xsp; + if (jj_scan_token(AN)) return true; + xsp = jj_scanpos; + if (jj_3_6()) jj_scanpos = xsp; + return false; + } + private boolean jj_3R_232() { if (jj_scan_token(COLON)) return true; @@ -10368,12 +10365,6 @@ private boolean jj_3R_232() return false; } - private boolean jj_3R_272() - { - if (jj_scan_token(S)) return true; - return false; - } - private boolean jj_3_5() { Token xsp; @@ -10495,12 +10486,6 @@ private boolean jj_3R_280() return false; } - private boolean jj_3R_284() - { - if (jj_scan_token(PLUS)) return true; - return false; - } - private boolean jj_3_25() { Token xsp; @@ -10517,6 +10502,12 @@ private boolean jj_3_25() return false; } + private boolean jj_3R_284() + { + if (jj_scan_token(PLUS)) return true; + return false; + } + private boolean jj_3R_258() { if (jj_3R_238()) return true; @@ -10830,6 +10821,12 @@ private boolean jj_3R_403() return false; } + private boolean jj_3R_432() + { + if (jj_3R_400()) return true; + return false; + } + private boolean jj_3R_266() { if (jj_3R_238()) return true; @@ -10847,12 +10844,6 @@ private boolean jj_3R_237() return false; } - private boolean jj_3R_432() - { - if (jj_3R_400()) return true; - return false; - } - private boolean jj_3R_455() { if (jj_scan_token(COMMA)) return true; @@ -10929,12 +10920,6 @@ private boolean jj_3R_416() return false; } - private boolean jj_3R_415() - { - if (jj_scan_token(SUBSTRINGMATCH)) return true; - return false; - } - private boolean jj_3R_421() { if (jj_scan_token(FUNCTIONMATHN)) return true; @@ -10956,6 +10941,12 @@ private boolean jj_3R_421() return false; } + private boolean jj_3R_415() + { + if (jj_scan_token(SUBSTRINGMATCH)) return true; + return false; + } + private boolean jj_3R_414() { if (jj_scan_token(SUFFIXMATCH)) return true; @@ -11152,6 +11143,12 @@ private boolean jj_3R_380() return false; } + private boolean jj_3R_379() + { + if (jj_3R_375()) return true; + return false; + } + private boolean jj_3R_265() { if (jj_3R_238()) return true; @@ -11169,12 +11166,6 @@ private boolean jj_3R_236() return false; } - private boolean jj_3R_379() - { - if (jj_3R_375()) return true; - return false; - } - private boolean jj_3R_347() { Token xsp; @@ -11226,6 +11217,12 @@ private boolean jj_3R_345() return false; } + private boolean jj_3R_344() + { + if (jj_scan_token(DIMEN)) return true; + return false; + } + private boolean jj_3R_235() { if (jj_3R_231()) return true; @@ -11237,12 +11234,6 @@ private boolean jj_3R_235() return false; } - private boolean jj_3R_344() - { - if (jj_scan_token(DIMEN)) return true; - return false; - } - private boolean jj_3_23() { if (jj_scan_token(NUMBER)) return true; @@ -11315,6 +11306,24 @@ private boolean jj_3R_334() return false; } + private boolean jj_3R_333() + { + if (jj_scan_token(PERCENTAGE)) return true; + return false; + } + + private boolean jj_3R_377() + { + if (jj_3R_406()) return true; + return false; + } + + private boolean jj_3R_378() + { + if (jj_scan_token(NUMBER)) return true; + return false; + } + private boolean jj_3R_409() { Token xsp; @@ -11344,24 +11353,6 @@ private boolean jj_3R_409() return false; } - private boolean jj_3R_333() - { - if (jj_scan_token(PERCENTAGE)) return true; - return false; - } - - private boolean jj_3R_377() - { - if (jj_3R_406()) return true; - return false; - } - - private boolean jj_3R_378() - { - if (jj_scan_token(NUMBER)) return true; - return false; - } - private boolean jj_3R_332() { Token xsp; @@ -11650,6 +11641,12 @@ private boolean jj_3R_316() return false; } + private boolean jj_3R_315() + { + if (jj_scan_token(PROGID)) return true; + return false; + } + private boolean jj_3R_369() { Token xsp; @@ -11668,12 +11665,6 @@ private boolean jj_3R_397() return false; } - private boolean jj_3R_315() - { - if (jj_scan_token(PROGID)) return true; - return false; - } - private boolean jj_3_14() { if (jj_3R_231()) return true; @@ -11719,6 +11710,18 @@ private boolean jj_3_15() return false; } + private boolean jj_3R_314() + { + if (jj_scan_token(DIMEN)) return true; + return false; + } + + private boolean jj_3R_313() + { + if (jj_scan_token(SPL)) return true; + return false; + } + private boolean jj_3R_230() { Token xsp; @@ -11733,18 +11736,6 @@ private boolean jj_3R_230() return false; } - private boolean jj_3R_314() - { - if (jj_scan_token(DIMEN)) return true; - return false; - } - - private boolean jj_3R_313() - { - if (jj_scan_token(SPL)) return true; - return false; - } - private boolean jj_3R_312() { if (jj_scan_token(ST)) return true; @@ -11805,6 +11796,25 @@ private boolean jj_3R_303() return false; } + private boolean jj_3R_302() + { + if (jj_scan_token(NUMBER)) return true; + return false; + } + + private boolean jj_3_21() + { + if (jj_3R_239()) return true; + if (jj_3R_242()) return true; + return false; + } + + private boolean jj_3R_301() + { + if (jj_3R_254()) return true; + return false; + } + private boolean jj_3R_238() { Token xsp; @@ -11825,25 +11835,6 @@ private boolean jj_3R_238() return false; } - private boolean jj_3R_302() - { - if (jj_scan_token(NUMBER)) return true; - return false; - } - - private boolean jj_3_21() - { - if (jj_3R_239()) return true; - if (jj_3R_242()) return true; - return false; - } - - private boolean jj_3R_301() - { - if (jj_3R_254()) return true; - return false; - } - private boolean jj_3R_268() { Token xsp; @@ -12037,6 +12028,17 @@ private boolean jj_3R_435() return false; } + private boolean jj_3R_279() + { + if (jj_3R_240()) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_19()) { jj_scanpos = xsp; break; } + } + return false; + } + /** Generated Token Manager. */ public CssParserTokenManager token_source; SimpleCharStream jj_input_stream; diff --git a/org/w3c/css/parser/analyzer/CssParser.jj b/org/w3c/css/parser/analyzer/CssParser.jj index 45caa927..1fefd837 100644 --- a/org/w3c/css/parser/analyzer/CssParser.jj +++ b/org/w3c/css/parser/analyzer/CssParser.jj @@ -2978,7 +2978,12 @@ try { throw new InvalidParamException("notforcss1", "inherit", ac); } if (values == null) { - values = new CssExpression(); + if (string_property.startsWith("--")) { + values = new CssExpression(); + } else { + // old behaviour for empty properties + throw new ParseException(); + } } if (values.getCount() != 0 || string_property.startsWith("--")) { CssProperty p = handleDeclaration(string_property.toLowerCase(), @@ -2992,9 +2997,6 @@ try { // ok, return the new property return p; } - } else if (values.getCount() == 0) { - // old behaviour throw when a property has an empty expression - throw new ParseException(); } } catch (InvalidParamException e) { incompatible_error = false;