j is the counter for the CSSStyleDeclaration of the rule's
k is the counter for CSSValueImpl's containing more then 1 item
With this atempt I do always get the CSSValueImpl of the first background
element. So in each loop over the 3 backgrounds the output on the screen is
url("/firstUrl.file").
I already thought that the j counter should be included anyhow within the
whole construct? Any idea, how this could be realized?
Regards
icke
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there,
I have used CSS Parser for searching all URL's within one CSS file and found a
problem with following CSS construct:
body {
margin : 0;
(...)
background : #123456 url("/firstUrl.file") no-repeat;
background : #123456 url("/secondUrl.file") no-repeat;
background : #123456 url("/thirdUrl.file") no-repeat;
}
h1 {(...)}
I tried to access all three url's within the 3 backgrounds with looping over
all rules, contained styles and properties and their values:
property = styleDeclaration.item(j);
System.out.println(((CSSValueImpl)((CSSValueImpl)((CSSStyleRule)ruleList.item(
i)).getStyle().getPropertyCSSValue(property)).item(k)).getValue());
i is the counter for the CSSStyleRule's
j is the counter for the CSSStyleDeclaration of the rule's
k is the counter for CSSValueImpl's containing more then 1 item
With this atempt I do always get the CSSValueImpl of the first background
element. So in each loop over the 3 backgrounds the output on the screen is
url("/firstUrl.file").
I already thought that the j counter should be included anyhow within the
whole construct? Any idea, how this could be realized?
Regards
icke
Hi
I have the same problem.
I download the source code and fix that issue in method getPropertyDeclaration
at CSSStyleDeclarationImpl
The code:
Could you attach a JUnit test or some other piece of compilable code that
exhibits the behavior?