Changeset 6736 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r6670 r6736 174 174 public void apply(MultiCascade mc, OsmPrimitive osm, double scale, OsmPrimitive multipolyOuterWay, boolean pretendWayIsClosed) { 175 175 Environment env = new Environment(osm, mc, null, this); 176 for (MapCSSRule r : rules) { 176 RULE: for (MapCSSRule r : rules) { 177 177 for (Selector s : r.selectors) { 178 178 env.clearSelectorMatchingInformation(); … … 200 200 env.layer = sub; 201 201 r.execute(env); 202 continue RULE; 202 203 } 203 204 } -
trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParserTest.groovy
r6561 r6736 3 3 import org.junit.Before 4 4 import org.junit.Test 5 import org.openstreetmap.TestUtils 5 6 import org.openstreetmap.josm.Main 6 7 import org.openstreetmap.josm.data.Preferences … … 181 182 assert !c2.applies(new Environment().withPrimitive(w2)) 182 183 } 184 185 @Test 186 public void testTicket8568() throws Exception { 187 def sheet = new MapCSSStyleSource("") 188 getParser("" + 189 "way { width: 5; }\n" + 190 "way[keyA], way[keyB] { width: eval(prop(width)+10); }").sheet(sheet) 191 def mc = new MultiCascade() 192 sheet.apply(mc, TestUtils.createPrimitive("way foo=bar"), 20, null, false) 193 assert mc.getCascade(Environment.DEFAULT_LAYER).get("width") == 5 194 sheet.apply(mc, TestUtils.createPrimitive("way keyA=true"), 20, null, false) 195 assert mc.getCascade(Environment.DEFAULT_LAYER).get("width") == 15 196 sheet.apply(mc, TestUtils.createPrimitive("way keyB=true"), 20, null, false) 197 assert mc.getCascade(Environment.DEFAULT_LAYER).get("width") == 15 198 sheet.apply(mc, TestUtils.createPrimitive("way keyA=true keyB=true"), 20, null, false) 199 assert mc.getCascade(Environment.DEFAULT_LAYER).get("width") == 15 200 } 183 201 }
Note:
See TracChangeset
for help on using the changeset viewer.