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) :
12121212 locator = createLocator(token);
12131213 }
12141214
1215- t = <IDENT>
1215+ ( t = <IDENT> | t = <INHERIT> )
12161216 {
12171217 if (pseudoElementFound) { throw pe; }
12181218 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 {
45254525 assertEquals ("h1::link { color: red; }" , rule .getCssText ());
45264526 }
45274527
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+
45284545//
45294546// /**
45304547// * @throws Exception if any error occurs
You can’t perform that action at this time.
0 commit comments