Commit f284769
committed
Replace Batik with an internal hand-written CSS parser and drop SAC
Introduce an internal recursive-descent CSS parser under impl/parser (a
tokenizer, a LexicalUnit implementation, and CssParser) and wire it into
CSSEngineImpl, removing the Batik/SAC parser stack in the same change so
no intermediate state ships an unused parser.
The parser produces the same model the SAC/Batik path produced
(CSSStyleSheetImpl with CSSStyleRuleImpl / CSSImportRuleImpl rules,
internal Selectors selector trees, and CSSValueFactory values). It is
scoped to the subset the engine uses: type / class / id / attribute /
pseudo selectors, child / descendant / adjacent combinators, length /
percentage / number / colour / identifier / string / url() / rgb()
values, !important, and @import. @media, @font-face and @page are parsed
and discarded. Selector trees mirror the previous SAC translator so
specificity and matching are unchanged.
parseStyleSheet, parseStyleDeclaration, parsePropertyValue and
parseSelectors now go through the internal parser; the InputSource-based
overloads are gone, replaced by a parseStyleSheet(InputStream, uri)
method that carries the base location for relative @import resolution.
Deleted: the vendored SAC plumbing (impl/sac, core/sac), the SAC-backed
CSSParser / AbstractCSSParser / parser factories, SacTranslator and
SACConstants. The org.apache.batik.css Require-Bundle is removed. The
only remaining SAC type is the LexicalUnit interface used by the
impl/dom value model, which Phase 4 replaces.
ThemeEngine and the test helpers move off InputSource; the css.swt
margin/padding handlers throw IllegalArgumentException instead of the
SAC CSSException. A malformed, unterminated at-rule block is now
rejected. Verified by the full css.core (119) and css.swt (210) test
suites, by CssParserTest, and by a differential comparison against Batik
over all shipped Eclipse themes.1 parent 8a0d043 commit f284769
38 files changed
Lines changed: 1304 additions & 1365 deletions
File tree
- bundles
- org.eclipse.e4.ui.css.core
- META-INF
- src/org/eclipse/e4/ui/css/core
- dom/parsers
- engine
- impl
- dom
- parsers
- engine
- selector
- parser
- sac
- sac
- org.eclipse.e4.ui.css.swt.theme
- META-INF
- src/org/eclipse/e4/ui/css/swt/internal/theme
- org.eclipse.e4.ui.css.swt
- META-INF
- src/org/eclipse/e4/ui/css/swt/properties/css2
- tests
- org.eclipse.e4.ui.tests.css.core
- META-INF
- src/org/eclipse/e4/ui/tests/css/core
- parser
- util
- org.eclipse.e4.ui.tests.css.swt/src/org/eclipse/e4/ui/tests/css/swt
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
35 | | - | |
| 33 | + | |
36 | 34 | | |
37 | | - | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 38 | + | |
| 39 | + | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 0 additions & 125 deletions
This file was deleted.
Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 3 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | | - | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | 75 | | |
81 | 76 | | |
82 | 77 | | |
| |||
94 | 89 | | |
95 | 90 | | |
96 | 91 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | 92 | | |
103 | 93 | | |
104 | 94 | | |
105 | 95 | | |
106 | 96 | | |
107 | 97 | | |
108 | 98 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 99 | | |
115 | 100 | | |
116 | 101 | | |
| |||
162 | 147 | | |
163 | 148 | | |
164 | 149 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | 150 | | |
171 | 151 | | |
172 | 152 | | |
| |||
Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
| |||
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 27 | | |
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
| 27 | + | |
29 | 28 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 29 | | |
35 | 30 | | |
36 | 31 | | |
| |||
0 commit comments