Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 14460)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 14461)
@@ -472,20 +472,20 @@
                 final String base = ((GeneralSelector) selRightmost).getBase();
                 switch (base) {
-                    case "node":
+                    case Selector.BASE_NODE:
                         nodeRules.add(optRule);
                         break;
-                    case "way":
+                    case Selector.BASE_WAY:
                         wayNoAreaRules.add(optRule);
                         wayRules.add(optRule);
                         break;
-                    case "area":
+                    case Selector.BASE_AREA:
                         wayRules.add(optRule);
                         multipolygonRules.add(optRule);
                         break;
-                    case "relation":
+                    case Selector.BASE_RELATION:
                         relationRules.add(optRule);
                         multipolygonRules.add(optRule);
                         break;
-                    case "*":
+                    case Selector.BASE_ANY:
                         nodeRules.add(optRule);
                         wayRules.add(optRule);
@@ -494,9 +494,9 @@
                         multipolygonRules.add(optRule);
                         break;
-                    case "canvas":
+                    case Selector.BASE_CANVAS:
                         canvasRules.add(r);
                         break;
-                    case "meta":
-                    case "setting":
+                    case Selector.BASE_META:
+                    case Selector.BASE_SETTING:
                         break;
                     default:
@@ -557,5 +557,5 @@
      */
     private void loadMeta() {
-        Cascade c = constructSpecial("meta");
+        Cascade c = constructSpecial(Selector.BASE_META);
         String pTitle = c.get("title", null, String.class);
         if (title == null) {
@@ -569,5 +569,5 @@
 
     private void loadCanvas() {
-        Cascade c = constructSpecial("canvas");
+        Cascade c = constructSpecial(Selector.BASE_CANVAS);
         backgroundColorOverride = c.get("fill-color", null, Color.class);
     }
@@ -586,5 +586,5 @@
             if (r.selector instanceof GeneralSelector) {
                 GeneralSelector gs = (GeneralSelector) r.selector;
-                if ("setting".equals(gs.getBase())) {
+                if (Selector.BASE_SETTING.equals(gs.getBase())) {
                     if (!gs.matchesConditions(env)) {
                         continue;
@@ -738,5 +738,5 @@
             if (x.selector instanceof GeneralSelector) {
                 GeneralSelector gs = (GeneralSelector) x.selector;
-                if ("meta".equals(gs.base)) {
+                if (Selector.BASE_META.equals(gs.base)) {
                     it.remove();
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 14460)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 14461)
@@ -51,4 +51,28 @@
 public interface Selector {
 
+    /** selector base that matches anything. */
+    String BASE_ANY = "*";
+
+    /** selector base that matches on OSM object node. */
+    String BASE_NODE = "node";
+
+    /** selector base that matches on OSM object way. */
+    String BASE_WAY = "way";
+
+    /** selector base that matches on OSM object relation. */
+    String BASE_RELATION = "relation";
+
+    /** selector base that matches with any area regardless of whether the area border is only modelled with a single way or with a set of ways glued together with a relation.*/
+    String BASE_AREA = "area";
+
+    /** selector base for special rules containing meta information. */
+    String BASE_META = "meta";
+
+    /** selector base for style information not specific to nodes, ways or relations. */
+    String BASE_CANVAS = "canvas";
+
+    /** selector base for artificial bases created to use preferences. */
+    String BASE_SETTING = "setting";
+
     /**
      * Apply the selector to the primitive and check if it matches.
@@ -576,5 +600,5 @@
         public OptimizedGeneralSelector(String base, Pair<Integer, Integer> zoom, List<Condition> conds, Subpart subpart) {
             super(conds);
-            this.base = base;
+            this.base = checkBase(base);
             if (zoom != null) {
                 int a = zoom.a == null ? 0 : zoom.a;
@@ -593,5 +617,5 @@
         public OptimizedGeneralSelector(String base, Range range, List<Condition> conds, Subpart subpart) {
             super(conds);
-            this.base = base;
+            this.base = checkBase(base);
             this.range = range;
             this.subpart = subpart != null ? subpart : Subpart.DEFAULT_SUBPART;
@@ -612,4 +636,24 @@
         }
 
+        /**
+         * Check if this is a known base and return the corresponding string constant.
+         * @param base
+         * @return the matching String constant
+         */
+        private static String checkBase(String base) {
+            switch(base) {
+            case "*": return BASE_ANY;
+            case "node": return BASE_NODE;
+            case "way": return BASE_WAY;
+            case "relation": return BASE_RELATION;
+            case "area": return BASE_AREA;
+            case "meta": return BASE_META;
+            case "canvas": return BASE_CANVAS;
+            case "setting": return BASE_SETTING;
+            default:
+                throw new IllegalArgumentException("unknown selector " + base);
+            }
+        }
+
         public String getBase() {
             return base;
@@ -617,12 +661,12 @@
 
         public boolean matchesBase(OsmPrimitiveType type) {
-            if ("*".equals(base)) {
+            if (BASE_ANY.equals(base)) {
                 return true;
             } else if (OsmPrimitiveType.NODE == type) {
-                return "node".equals(base);
+                return BASE_NODE.equals(base);
             } else if (OsmPrimitiveType.WAY == type) {
-                return "way".equals(base) || "area".equals(base);
+                return BASE_WAY.equals(base) || BASE_AREA.equals(base);
             } else if (OsmPrimitiveType.RELATION == type) {
-                return "area".equals(base) || "relation".equals(base) || "canvas".equals(base);
+                return BASE_AREA.equals(base) || BASE_RELATION.equals(base) || BASE_CANVAS.equals(base);
             }
             return false;
@@ -634,7 +678,7 @@
             } else {
                 if (p instanceof IRelation) {
-                    if ("area".equals(base)) {
+                    if (BASE_AREA.equals(base)) {
                         return ((IRelation<?>) p).isMultipolygon();
-                    } else if ("canvas".equals(base)) {
+                    } else if (BASE_CANVAS.equals(base)) {
                         return p.get("#canvas") != null;
                     }
