Index: utils/css/cssworld.dart |
diff --git a/utils/css/cssworld.dart b/utils/css/cssworld.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..812fbe6c28949c879e508e5327927a4606bfea8e |
--- /dev/null |
+++ b/utils/css/cssworld.dart |
@@ -0,0 +1,26 @@ |
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+class CssWorld { |
+ List<String> classes; |
+ List<String> ids; |
+ |
+ CssWorld(this.classes, this.ids) { |
+ // Insure no private class names in our CSS world (._foo). |
+ for (aClass in classes) { |
+ if (aClass.startsWith('_')) { |
+ throw new CssSelectorException( |
+ "private class ('_' prefix) not valid for CssWorld $aClass)"); |
+ } |
+ } |
+ |
+ // Insure no private element ids in our CSS world (#_foo). |
+ for (id in ids) { |
+ if (id.startsWith('_')) { |
+ throw new CssSelectorException( |
+ "private id ('_' prefix) not valid for CssWorld $id)"); |
+ } |
+ } |
+ } |
+} |