Skip to content

Commit c0809a9

Browse files
committed
Remove the leftover SAC references after the value-record migration
Follow-up to 5a8b668, which deleted the tkuiTestsToRefactor legacy sources but left Import-Package: org.w3c.css.sac in the org.eclipse.e4.ui.tests.css.swt manifest, plus stale SAC/Batik mentions in two css.core Javadoc comments. Nothing on the build path uses SAC anymore, so drop the import and rewrite the comments. The org.w3c.css.sac library can now leave the target platform once no bundle outside this repo needs it.
1 parent 444e263 commit c0809a9

10 files changed

Lines changed: 26 additions & 36 deletions

File tree

bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/dom/CssValues.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
/**
2727
* The internal CSS value model produced by the parser. A small sealed hierarchy
2828
* of immutable values that replaces the former {@code Measure} / {@code
29-
* RGBColorImpl} / {@code CSSValueListImpl} wrappers and removes the last SAC
30-
* dependency ({@code LexicalUnit}).
29+
* RGBColorImpl} / {@code CSSValueListImpl} wrappers.
3130
*
3231
* <p>
3332
* Consumers pattern-match on the record variants ({@link CssNumber},
@@ -258,7 +257,7 @@ public String getCssText() {
258257

259258
/**
260259
* A separator (currently only {@code ,}) carried inside a value list, kept
261-
* for parity with the former SAC behaviour where the comma was a list item.
260+
* for parity with the historical behaviour where the comma was a list item.
262261
*/
263262
public record CssOperator(String text) implements CssPrimitive {
264263
@Override

bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/CSSEngineImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,9 @@ private void applyConditionalPseudoStyle(ExtendedCSSRule parentRule, String pseu
477477
* Returns {@code true} if {@code selector} carries a pseudo-class or
478478
* attribute selector (anywhere in a compound or descendant combinator)
479479
* whose target value equals {@code pseudoInstance}. Mirrors the legacy
480-
* SAC walker, which handled both {@code :selected} (a pseudo-class) and
481-
* {@code Shell[active='true']} (an attribute) through SAC's shared
482-
* {@code AttributeCondition} interface.
480+
* walker, which handled both {@code :selected} (a pseudo-class) and
481+
* {@code Shell[active='true']} (an attribute) through a shared
482+
* condition interface.
483483
*/
484484
private static boolean matchesPseudoInstanceAttribute(Selectors.Selector selector, String pseudoInstance) {
485485
if (selector instanceof Selectors.PseudoClass pc) {

bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/selector/SelectorMatcher.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
*
3737
* <p>
3838
* Every method is static; the matcher carries no state. Callers pass the
39-
* element being tested plus an optional pseudo-element string (the same
40-
* argument the SAC engine carried) so that pseudo-class matching can defer
41-
* to the existing {@link CSSStylableElement#isPseudoInstanceOf} contract.
39+
* element being tested plus an optional pseudo-element string so that
40+
* pseudo-class matching can defer to the existing
41+
* {@link CSSStylableElement#isPseudoInstanceOf} contract.
4242
* </p>
4343
*
4444
* <p>
45-
* Tag-name comparison is case sensitive, matching the existing SAC matcher
46-
* (Phase 1 test {@code testTagNameCaseSensitivity} in {@code CSSEngineTest}
45+
* Tag-name comparison is case sensitive, preserving the historical matcher
46+
* behaviour (Phase 1 test {@code testTagNameCaseSensitivity} in {@code CSSEngineTest}
4747
* locks this in). Pseudo-class semantics also follow the existing engine:
4848
* the static-pseudo-instance carve-out from
4949
* {@code CSSPseudoClassConditionImpl} is preserved so cascade behaviour

bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/selector/Selectors.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,10 @@
1919
* Internal CSS selector AST.
2020
*
2121
* <p>
22-
* The engine historically exposed W3C SAC selectors
23-
* ({@code org.w3c.css.sac.Selector} and friends) and matched against them
24-
* through a hierarchy of vendored Batik wrapper classes under
25-
* {@code impl/sac/*}. This package replaces both with a small set of records
26-
* that the engine owns end to end. The W3C SAC types stay only as long as
27-
* the parser still emits them; a translator turns the SAC selector tree
28-
* produced by the Batik SAC parser into one of these records before it
29-
* reaches the engine matcher.
22+
* This package is the engine's own selector model: a small set of records
23+
* the parser builds directly and the matcher consumes end to end. It
24+
* replaced an earlier layer of vendored selector wrapper classes that the
25+
* engine no longer depends on.
3026
* </p>
3127
*
3228
* <p>
@@ -312,12 +308,12 @@ public List<Selector> alternatives() {
312308
return alternatives;
313309
}
314310

315-
/** Number of alternatives in the list. SAC-style accessor for callers iterating the list. */
311+
/** Number of alternatives in the list. Indexed accessor for callers iterating the list. */
316312
public int getLength() {
317313
return alternatives.size();
318314
}
319315

320-
/** {@code i}-th alternative. SAC-style accessor for callers iterating the list. */
316+
/** {@code i}-th alternative. Indexed accessor for callers iterating the list. */
321317
public Selector item(int i) {
322318
return alternatives.get(i);
323319
}

bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/parser/CssParseException.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616
/**
1717
* Thrown by the hand-written CSS parser when the input cannot be parsed.
18-
* Replaces {@code org.w3c.css.sac.CSSException} for the internal parser, which
19-
* like its SAC predecessor is unchecked.
18+
* Unchecked so it can surface from the parser without checked-exception plumbing.
2019
*/
2120
public class CssParseException extends RuntimeException {
2221

bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/parser/CssParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ private Selector compound() {
413413
case COLON:
414414
advance();
415415
if (peek().kind == Kind.COLON) {
416-
advance(); // pseudo-element ::, modelled as a pseudo-class like the SAC path
416+
advance(); // pseudo-element ::, modelled as a pseudo-class
417417
}
418418
conditions.add(new PseudoClass(expect(Kind.IDENT).text));
419419
break;
@@ -430,8 +430,8 @@ private Selector compound() {
430430
for (int i = conditions.size() - 2; i >= 0; i--) {
431431
conditionTree = new And(conditions.get(i), conditionTree);
432432
}
433-
// A universal element before conditions is dropped, matching the SAC
434-
// translator: '.foo' and '*[a]' carry no element-type contribution.
433+
// A universal element before conditions is dropped: '.foo' and '*[a]'
434+
// carry no element-type contribution.
435435
return element instanceof ElementType ? new And(element, conditionTree) : conditionTree;
436436
}
437437

tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/selector/SelectorMatcherTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838

3939
/**
4040
* Unit tests for {@link SelectorMatcher}. The cases mirror those in the
41-
* Phase 1 {@code CSSEngineTest}, but go through the new internal selector
42-
* AST instead of SAC. When Phase 3 Step 1 wires the engine to use this
43-
* matcher, the SAC-based duplicate tests can be retired.
41+
* Phase 1 {@code CSSEngineTest}, but go through the internal selector AST.
4442
*/
4543
class SelectorMatcherTest {
4644

tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/CSSEngineTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,9 @@ void testSelectorListMatch() throws Exception {
261261

262262
@Test
263263
void testTagNameCaseSensitivity() throws Exception {
264-
// Locks in current case-sensitive matching of the SAC engine. If the
265-
// parser swap moves to case-insensitive (closer to HTML semantics), this
266-
// test must be updated together with that change.
264+
// Locks in current case-sensitive matching. If the matching ever moves
265+
// to case-insensitive (closer to HTML semantics), this test must be
266+
// updated together with that change.
267267
TestCSSEngine engine = new TestCSSEngine();
268268
Selector capital = parse(engine, "Button");
269269
Selector lower = parse(engine, "button");

tests/org.eclipse.e4.ui.tests.css.core/src/org/eclipse/e4/ui/tests/css/core/parser/CssParserTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ void testAttributeAndPseudoSelectors() {
9191

9292
@Test
9393
void testUniversalElementDroppedBeforeConditions() {
94-
// '.foo' and '*[a]' carry no element-type contribution, matching the
95-
// previous SAC translator.
94+
// '.foo' and '*[a]' carry no element-type contribution.
9695
assertInstanceOf(Selectors.ClassSelector.class, firstSelector(".foo"));
9796
assertInstanceOf(Selectors.AttributeSelector.class, firstSelector("*[a]"));
9897
}

tests/org.eclipse.e4.ui.tests.css.swt/META-INF/MANIFEST.MF

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ Import-Package: org.eclipse.core.runtime;version="3.5.0",
1616
org.junit.jupiter.api.function;version="[5.14.0,6.0.0)",
1717
org.junit.platform.suite.api;version="[1.14.0,2.0.0)",
1818
org.osgi.framework;version="[1.7.0,2.0.0)",
19-
org.osgi.service.event;version="[1.3.0,2.0.0)",
20-
org.w3c.css.sac;version="1.3.0"
19+
org.osgi.service.event;version="[1.3.0,2.0.0)"
2120
Eclipse-BundleShape: dir
2221
Automatic-Module-Name: org.eclipse.e4.ui.tests.css.swt
2322
Bundle-Vendor: %Bundle-Vendor

0 commit comments

Comments
 (0)