Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 18918)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 18921)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.data.validation.tests;
 
+import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -31,4 +32,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmUtils;
+import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.preferences.sources.ExtendedSourceEntry;
 import org.openstreetmap.josm.data.preferences.sources.ValidatorPrefHelper;
@@ -41,4 +43,5 @@
 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException;
+import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.io.OsmReader;
 import org.openstreetmap.josm.testutils.annotations.BasicPreferences;
@@ -447,3 +450,31 @@
     }
 
+    /**
+     * A water area inside a coastline, where the coastline way is oriented away from the water area
+     * (the water area is not inside the ocean).
+     */
+    @Test
+    void testTicket23308() {
+        final MapCSSTagChecker test = new MapCSSTagChecker();
+        final Way innerWay = TestUtils.newWay("natural=water",
+                new Node(new LatLon(32.775, -117.238)),
+                new Node(new LatLon(32.774, -117.238)),
+                new Node(new LatLon(32.774, -117.237)),
+                new Node(new LatLon(32.775, -117.237)));
+        final Way outerWay = TestUtils.newWay("natural=coastline",
+                new Node(new LatLon(32.779, -117.232)),
+                new Node(new LatLon(32.777, -117.241)),
+                new Node(new LatLon(32.771, -117.240)),
+                new Node(new LatLon(32.771, -117.235)));
+        final DataSet ds = new DataSet();
+        ds.addPrimitiveRecursive(innerWay);
+        ds.addPrimitiveRecursive(outerWay);
+        innerWay.addNode(innerWay.firstNode());
+        outerWay.addNode(outerWay.firstNode());
+        assertDoesNotThrow(test::initialize);
+        test.startTest(NullProgressMonitor.INSTANCE);
+        test.visit(ds.allPrimitives());
+        test.endTest();
+        assertTrue(test.getErrors().isEmpty());
+    }
 }
