Hi,
I am using CSS4j 0.10 version. I had a problem while using the getComputedStyle
method where in the specifity of certain styles were not handled properly.
I was looking at the DOMCSSStyleRule.java and specifity() method in the class
Specifity was not handling Selector.SAC_DESCENDANT_SELECTOR,
Selector.SAC_CHILD_SELECTOR, Selector.SAC_DIRECT_ADJACENT_SELECTOR. So i had
changed the method as follows:
private void specifity(Selector selector) {
switch (selector.getSelectorType()) {
case Selector.SAC_ELEMENT_NODE_SELECTOR:
case Selector.SAC_PSEUDO_ELEMENT_SELECTOR:
names_pseudoelements_count++;
break;
case Selector.SAC_CONDITIONAL_SELECTOR:
Condition cond =
((ConditionalSelector) selector)
.getCondition();
switch (cond.getConditionType())
{
case
Condition.SAC_CLASS_CONDITION:
case
Condition.SAC_ATTRIBUTE_CONDITION:
case
Condition.SAC_ONE_OF_ATTRIBUTE_CONDITION:
case
Condition.SAC_PSEUDO_CLASS_CONDITION:
attrib_classes_count++;
break;
case Condition.SAC_ID_CONDITION:
id_count++;
break;
}
specifity(((ConditionalSelector)
selector).getSimpleSelector());
break;
case Selector.SAC_DESCENDANT_SELECTOR:
case Selector.SAC_CHILD_SELECTOR:
specifity( ((DescendantSelector)
selector).getSimpleSelector() );
specifity( ((DescendantSelector)
selector).getAncestorSelector() );
break;
case Selector.SAC_DIRECT_ADJACENT_SELECTOR:
specifity ( ((SiblingSelector)
selector).getSiblingSelector() );
specifity ( ((SiblingSelector)
selector).getSelector() );
break;
}
}
Can this be incorporated into a patch? please help.
Looking forward for a positive reply from you.
Regards
Ravi
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
dom4j-dev mailing list
dom4j-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-dev