2010-02-24 02:39:05 +08:00
|
|
|
|
|
|
|
node.Element = function Element(combinator, value) {
|
|
|
|
this.combinator = combinator;
|
|
|
|
this.value = value.trim();
|
|
|
|
};
|
|
|
|
node.Element.prototype.toCSS = function () {
|
2010-02-28 14:05:27 +08:00
|
|
|
var css = (this.combinator ? this.combinator.toCSS() : ' ') + this.value;
|
2010-02-24 02:39:05 +08:00
|
|
|
return css;
|
|
|
|
};
|
|
|
|
|
|
|
|
node.Combinator = function Combinator(value) {
|
|
|
|
this.value = value.trim();
|
|
|
|
};
|
|
|
|
node.Combinator.prototype.toCSS = function () {
|
|
|
|
switch (this.value) {
|
|
|
|
case '&': return "";
|
|
|
|
case ':': return ' :';
|
|
|
|
case '>': return ' > ';
|
|
|
|
default: return ' ' + this.value;
|
|
|
|
}
|
|
|
|
};
|