File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
test/java/org/htmlunit/cssparser/parser Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1212,7 +1212,7 @@ Condition _class(boolean pseudoElementFound) :
1212
1212
locator = createLocator(token);
1213
1213
}
1214
1214
1215
- t = <IDENT>
1215
+ ( t = <IDENT> | t = <INHERIT> )
1216
1216
{
1217
1217
if (pseudoElementFound) { throw pe; }
1218
1218
return new ClassCondition(unescape(t.image, false), locator);
Original file line number Diff line number Diff line change @@ -4525,6 +4525,23 @@ public void doubleColonsPseudoClass() throws Exception {
4525
4525
assertEquals ("h1::link { color: red; }" , rule .getCssText ());
4526
4526
}
4527
4527
4528
+ /**
4529
+ * @throws Exception if the test fails
4530
+ */
4531
+ @ Test
4532
+ public void inheritClassName () throws Exception {
4533
+ final String css = ".inherit { color: red }\n " ;
4534
+
4535
+ final CSSStyleSheetImpl sheet = parse (css );
4536
+ final CSSRuleListImpl rules = sheet .getCssRules ();
4537
+
4538
+ assertEquals (1 , rules .getLength ());
4539
+
4540
+ final AbstractCSSRuleImpl rule = rules .getRules ().get (0 );
4541
+ assertEquals ("*.inherit { color: red; }" , rule .toString ());
4542
+ assertEquals ("*.inherit { color: red; }" , rule .getCssText ());
4543
+ }
4544
+
4528
4545
//
4529
4546
// /**
4530
4547
// * @throws Exception if any error occurs
You can’t perform that action at this time.
0 commit comments