Index: trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 16781)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 16784)
@@ -939,31 +939,61 @@
 
         if (partialSelection && !tested.isEmpty()) {
-            // #14287: see https://josm.openstreetmap.de/ticket/14287#comment:15
-            // execute tests for objects which might contain or cross previously tested elements
-
-            // rebuild index with a reduced set of rules (those that use ChildOrParentSelector) and thus may have left selectors
-            // matching the previously tested elements
-            indexData = createMapCSSTagCheckerIndex(currentCheck, includeOtherSeverityChecks(), ONLY_SELECTED_TESTS);
-
-            if (surrounding.isEmpty()) {
-                for (OsmPrimitive p : tested) {
-                    if (p.getDataSet() != null) {
-                        surrounding.addAll(p.getDataSet().searchWays(p.getBBox()));
-                        surrounding.addAll(p.getDataSet().searchRelations(p.getBBox()));
-                    }
-                }
-            }
-
-            final boolean includeOtherSeverity = includeOtherSeverityChecks();
-            for (OsmPrimitive p : surrounding) {
-                if (tested.contains(p))
-                    continue;
-                Collection<TestError> additionalErrors = getErrorsForPrimitive(p, includeOtherSeverity);
-                for (TestError e : additionalErrors) {
-                    if (e.getPrimitives().stream().anyMatch(tested::contains))
-                        addIfNotSimilar(e, errors);
-                }
-            }
-        }
+            testPartial(currentCheck, tested, surrounding);
+        }
+    }
+
+    private void testPartial(MultiMap<String, TagCheck> currentCheck, Set<OsmPrimitive> tested,
+            Set<OsmPrimitive> surrounding) {
+
+        // #14287: see https://josm.openstreetmap.de/ticket/14287#comment:15
+        // execute tests for objects which might contain or cross previously tested elements
+
+        final boolean includeOtherSeverity = includeOtherSeverityChecks();
+        // rebuild index with a reduced set of rules (those that use ChildOrParentSelector) and thus may have left selectors
+        // matching the previously tested elements
+        indexData = createMapCSSTagCheckerIndex(currentCheck, includeOtherSeverity, ONLY_SELECTED_TESTS);
+        if (indexData.isEmpty())
+            return; // performance: some *.mapcss rule files don't use ChildOrParentSelector
+
+        if (surrounding.isEmpty()) {
+            for (OsmPrimitive p : tested) {
+                if (p.getDataSet() != null) {
+                    surrounding.addAll(p.getDataSet().searchWays(p.getBBox()));
+                    surrounding.addAll(p.getDataSet().searchRelations(p.getBBox()));
+                }
+            }
+        }
+
+        for (OsmPrimitive p : surrounding) {
+            if (tested.contains(p))
+                continue;
+            Collection<TestError> additionalErrors = getErrorsForPrimitive(p, includeOtherSeverity);
+            for (TestError e : additionalErrors) {
+                if (e.getPrimitives().stream().anyMatch(tested::contains))
+                    addIfNotSimilar(e, errors);
+            }
+        }
+
+    }
+
+    /**
+     * Execute only the rules for the rules matching the given file name. See #19180
+     * @param ruleFile the name of the mapcss file, e.g. deprecated.mapcss
+     * @param selection collection of primitives
+     * @since 16784
+     */
+    public void runOnly(String ruleFile, Collection<OsmPrimitive> selection) {
+        mpAreaCache.clear();
+
+        Set<OsmPrimitive> surrounding = new HashSet<>();
+        for (Entry<String, Set<TagCheck>> entry : checks.entrySet()) {
+            if (isCanceled()) {
+                break;
+            }
+            if (entry.getKey().endsWith(ruleFile)) {
+                visit(entry.getKey(), entry.getValue(), selection, surrounding);
+            }
+        }
+
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 16781)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 16784)
@@ -18,4 +18,5 @@
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
@@ -45,4 +46,5 @@
 import org.openstreetmap.josm.data.osm.Tagged;
 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper;
+import org.openstreetmap.josm.data.validation.OsmValidator;
 import org.openstreetmap.josm.data.validation.Severity;
 import org.openstreetmap.josm.data.validation.Test.TagTest;
@@ -100,4 +102,6 @@
     /** The preferences prefix */
     protected static final String PREFIX = ValidatorPrefHelper.PREFIX + "." + TagChecker.class.getSimpleName();
+
+    MapCSSTagChecker deprecatedChecker;
 
     /**
@@ -894,5 +898,4 @@
             // use Levenshtein distance to find typical typos
             int minDist = MAX_LEVENSHTEIN_DISTANCE + 1;
-            String closest = null;
             for (Set<String> possibleValues: sets) {
                 for (String possibleVal : possibleValues) {
@@ -911,5 +914,4 @@
                     }
                     if (dist < minDist) {
-                        closest = possibleVal;
                         minDist = dist;
                         fixVals.clear();
@@ -920,9 +922,10 @@
                 }
             }
-
+            filterDeprecatedTags(p, key, fixVals);
             if (minDist <= MAX_LEVENSHTEIN_DISTANCE && maxPresetValueLen > MAX_LEVENSHTEIN_DISTANCE
+                    && !fixVals.isEmpty()
                     && (harmonizedValue.length() > 3 || minDist < MAX_LEVENSHTEIN_DISTANCE)) {
                 if (fixVals.size() < 2) {
-                    fixedValue = closest;
+                    fixedValue = fixVals.get(0);
                 } else {
                     Collections.sort(fixVals);
@@ -958,4 +961,32 @@
     }
 
+    // see #19180
+    private void filterDeprecatedTags(OsmPrimitive p, String key, List<String> fixVals) {
+        if (fixVals.isEmpty() || deprecatedChecker == null)
+            return;
+
+        String origVal = p.get(key);
+        try {
+            int unchangedDeprecated = countDeprecated(p);
+            Iterator<String> iter = fixVals.iterator();
+            while (iter.hasNext()) {
+                p.put(key, iter.next());
+                if (countDeprecated(p) > unchangedDeprecated)
+                    iter.remove();
+            }
+        } finally {
+            // restore original value
+            p.put(key, origVal);
+        }
+    }
+
+    private int countDeprecated(OsmPrimitive p) {
+        if (deprecatedChecker == null)
+            return 0;
+        deprecatedChecker.getErrors().clear();
+        deprecatedChecker.runOnly("deprecated.mapcss", Collections.singleton(p));
+        return deprecatedChecker.getErrors().size();
+    }
+
     private static boolean isNum(String harmonizedValue) {
         try {
@@ -1008,4 +1039,11 @@
             checkPresetsTypes = checkPresetsTypes && Config.getPref().getBoolean(PREF_CHECK_PRESETS_TYPES_BEFORE_UPLOAD, true);
         }
+        deprecatedChecker = OsmValidator.getTest(MapCSSTagChecker.class);
+    }
+
+    @Override
+    public void endTest() {
+        deprecatedChecker = null;
+        super.endTest();
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRuleIndex.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRuleIndex.java	(revision 16781)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSRuleIndex.java	(revision 16784)
@@ -247,3 +247,12 @@
         remaining.clear();
     }
+
+    /**
+     * Check if this index is empty.
+     * @return true if this index is empty.
+     * @since 16784
+     */
+    public boolean isEmpty() {
+        return rules.isEmpty();
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleIndex.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleIndex.java	(revision 16781)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleIndex.java	(revision 16784)
@@ -173,3 +173,13 @@
         return get(osm).getRuleCandidates(osm);
     }
+
+    /**
+     * Check if this index is empty.
+     * @return true if this index is empty.
+     * @since 16784
+     */
+    public boolean isEmpty() {
+        return nodeRules.isEmpty() && wayRules.isEmpty() && wayNoAreaRules.isEmpty() && relationRules.isEmpty()
+                && multipolygonRules.isEmpty() && canvasRules.isEmpty();
+    }
 }
