Index: src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 14455)
+++ src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(working copy)
@@ -471,22 +471,22 @@
                 MapCSSRule optRule = new MapCSSRule(r.selector.optimizedBaseCheck(), r.declaration);
                 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);
                         wayNoAreaRules.add(optRule);
@@ -493,11 +493,11 @@
                         relationRules.add(optRule);
                         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:
                         final RuntimeException e = new JosmRuntimeException(MessageFormat.format("Unknown MapCSS base selector {0}", base));
@@ -556,7 +556,7 @@
      * load meta info from a selector "meta"
      */
     private void loadMeta() {
-        Cascade c = constructSpecial("meta");
+        Cascade c = constructSpecial(Selector.BASE_META);
         String pTitle = c.get("title", null, String.class);
         if (title == null) {
             title = pTitle;
@@ -568,7 +568,7 @@
     }
 
     private void loadCanvas() {
-        Cascade c = constructSpecial("canvas");
+        Cascade c = constructSpecial(Selector.BASE_CANVAS);
         backgroundColorOverride = c.get("fill-color", null, Color.class);
     }
 
@@ -585,7 +585,7 @@
         for (MapCSSRule r : rules) {
             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;
                     }
@@ -737,7 +737,7 @@
             MapCSSRule x = it.next();
             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: src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
===================================================================
--- src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 14455)
+++ src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(working copy)
@@ -50,6 +50,27 @@
  */
 public interface Selector {
 
+    /** selector base that matches anything. */
+    public static final String BASE_ANY = "*";
+    /** selector base that matches on OSM object node. */
+    public static final String BASE_NODE = "node";
+    /** selector base that matches on OSM object way. */
+    public static final String BASE_WAY = "way";
+    /** selector base that matches on OSM object relation. */
+    public static final 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.*/
+    public static final String BASE_AREA = "area";
+
+    /** selector base for special rules containing meta information. */
+    public static final String BASE_META = "meta";
+
+    /** selector base for style information not specific to nodes, ways or relations. */
+    public static final String BASE_CANVAS = "canvas";
+
+    /** selector base for artificial bases created to use preferences. */
+    public static final String BASE_SETTING = "setting";
+
     /**
      * Apply the selector to the primitive and check if it matches.
      *
@@ -575,7 +596,7 @@
 
         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;
                 int b = zoom.b == null ? Integer.MAX_VALUE : zoom.b;
@@ -592,7 +613,7 @@
 
         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;
         }
@@ -611,19 +632,39 @@
             return range;
         }
 
+        /**
+         * 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;
         }
 
         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;
         }
@@ -633,9 +674,9 @@
                 return false;
             } 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;
                     }
                 }
