var crassObjects = require('crass').objects;


// `cb` gets called with rulesets
exports.walk = function(stylesheet, cb) {

    function walkObject(obj) {
        if (obj instanceof crassObjects.Media) {
            obj.content.forEach(walkObject);
        } else if (obj instanceof crassObjects.Page) {
            obj.content.forEach(walkObject);
        } else if (obj instanceof crassObjects.FontFace) {
            obj.content.forEach(walkObject);
        } else if (obj instanceof crassObjects.Keyframes) {
            obj.content.forEach(walkObject);
        } else if (obj instanceof crassObjects.Supports) {
            obj.blocks.forEach(walkObject);
        } else if (obj instanceof crassObjects.Ruleset ||
                   obj instanceof crassObjects.PageMargin ||
                   obj instanceof crassObjects.Keyframe) {
            cb(obj);
        }
    }

    stylesheet.content.forEach(walkObject);
};

@@ -45,40 +45,270 @@
 %0A%0A%0A/
-/ %60cb%60 gets called with rulesets
+**%0A * Walks a CSS parse tree and calls a callback when any ruleset-like%0A * node is encountered.%0A * @param %7BStylesheet%7D stylesheet A CSS stylesheet object to traverse%0A * @param %7Bfunction%7D cb A callback to fire when a ruleset is encountered.%0A * @returns %7Bvoid%7D%0A */
 %0Aexp
@@ -327,16 +327,21 @@
 function
+ walk
 (stylesh
@@ -1149,11 +1149,12 @@
 bject);%0A
+%0A
 %7D;%0A

Clean up /lib/walker.js