File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/test/java/org/htmlunit/cssparser/dom Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1515package org .htmlunit .cssparser .dom ;
1616
1717import static org .junit .jupiter .api .Assertions .assertEquals ;
18+ import static org .junit .jupiter .api .Assertions .assertNull ;
1819
1920import java .io .StringReader ;
2021
@@ -40,6 +41,18 @@ public void getCssText() throws Exception {
4041 assertEquals ("h1 { color: blue; }" , value .toString ());
4142 }
4243
44+ /**
45+ * @throws Exception if any error occurs
46+ */
47+ @ Test
48+ public void parentRule () throws Exception {
49+ final CSSStyleRuleImpl value = parseStyleRule ("h1 { color: blue; background: green }" );
50+ final CSSStyleDeclarationImpl style = value .getStyle ();
51+
52+ assertNull (value .getParentRule ());
53+ assertEquals (value , style .getParentRule ());
54+ }
55+
4356 /**
4457 * @throws Exception if any error occurs
4558 */
You can’t perform that action at this time.
0 commit comments