Weird error, completely reproducible, requiring minor code change...
We have a page with a child combinator in the CSS that throws a class cast exception during a JavaScript function that iterates up the offset parent of the DOM. You can open up the attached sample HTML page using the WebClient to reproduce.
It reaches the HtmlHtml element on the page and attempts to get its parent. The following code snippet in the selects() function of the Stylesheet class does a check and fixes it for us locally:
case Selector.SAC_CHILD_SELECTOR:
final DescendantSelector cs = (DescendantSelector) selector;
if (element.getParentNode() instanceof HtmlElement) {
final HtmlElement parent = (HtmlElement) element.getParentNode();
return selects(cs.getSimpleSelector(), element) && parent != null
&& selects(cs.getAncestorSelector(), parent);
} else {
return false;
}
Reproduces class cast exception in Stylesheet class.
Logged In: YES
user_id=402164
Originator: NO
Now fixed in SVN. Thanks for reporting.