Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Unified Diff: utils/css/cssworld.dart

Issue 8498020: Beginning of CSS parser using frog parsering infrastructure. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor cleanup. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)");
+ }
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698