blob: 281b2b7b0a54380ad3be6da534d38254cf11fcc3 [file] [log] [blame]
// 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 (final 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 (final id in ids) {
if (id.startsWith('_')) {
throw new CssSelectorException(
"private id ('_' prefix) not valid for CssWorld $id)");
}
}
}
}