Skip to content

Commit

Permalink
Upgrade to css4j 4.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosame committed Nov 19, 2023
1 parent 2445fa8 commit 2c36f00
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
15 changes: 5 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ java {
dependencies {
api('io.sf.carte:css4j') {
version {
strictly '[3.9.0,)'
prefer '4.2.1'
strictly '[4.2.2,)'
prefer '4.2.2'
}
}
useragentImplementation('io.sf.carte:css4j-agent') {
Expand All @@ -48,17 +48,12 @@ dependencies {
xmlpullImplementation 'xmlpull:xmlpull:1.2.0'
xmlpullImplementation 'xpp3:xpp3_min:1.2.0'
testImplementation group: 'io.sf.carte', name: 'css4j', classifier: 'tests',
version: '4.2.1'
version: '4.2.2'
testImplementation 'jaxen:jaxen:1.2.0'
testImplementation('org.slf4j:slf4j-api') {
version {
require '[1.7.28,)'
prefer '2.0.9'
}
}
testImplementation 'org.slf4j:slf4j-api:2.0.9'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// css4j 4.0 tests still use JUnit 4
// css4j 4.x tests still use JUnit 4
testImplementation 'org.junit.vintage:junit-vintage-engine:5.10.1'
}

Expand Down
9 changes: 8 additions & 1 deletion src/io/sf/carte/doc/dom4j/CSSStylableElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import io.sf.carte.doc.style.css.SelectorMatcher;
import io.sf.carte.doc.style.css.nsac.CombinatorSelector;
import io.sf.carte.doc.style.css.nsac.Condition;
import io.sf.carte.doc.style.css.nsac.Selector;
import io.sf.carte.doc.style.css.nsac.SelectorList;
import io.sf.carte.doc.style.css.nsac.SimpleSelector;
import io.sf.carte.doc.style.css.om.AbstractSelectorMatcher;
Expand Down Expand Up @@ -777,7 +778,13 @@ protected boolean scopeMatchDescendant(CombinatorSelector selector) {
return scopeMatchRecursive(list, desc);
}

private boolean scopeMatchRecursive(NodeList list, SimpleSelector desc) {
@Override
public boolean matchesRelational(Selector selector) {
NodeList list = getChildNodes();
return scopeMatchRecursive(list, selector);
}

private boolean scopeMatchRecursive(NodeList list, Selector desc) {
int sz = list.getLength();
for (int i = 0; i < sz; i++) {
Node node = list.item(i);
Expand Down

0 comments on commit 2c36f00

Please sign in to comment.