docs: function checkDimensions(child) {
    if (!child.boxObject)
      return [];
    var childBox = child.boxObject;
    var parent = childBox.parentBox;
  
    // toplevel element or hidden elements, like script tags
    if (!parent || parent == child.element || !parent.boxObject) {
      return [];
    }
    var parentBox = parent.boxObject;
  
    var badRects = [];
  
    // check width
    if (childBox.height && childBox.screenX < parentBox.screenX) {
      badRects.push([childBox.x, childBox.y, parentBox.x - childBox.x,
                     childBox.height]);
      jumlib.assert(false, 'Node is cut off at the left: ' +
                    _reportNode(child) + '. Parent node: ' + _reportNode(parent));
    }
    if (childBox.height && childBox.screenX + childBox.width >
        parentBox.screenX + parentBox.width) {
      badRects.push([parentBox.x + parentBox.width, childBox.y,
                     childBox.x + childBox.width - parentBox.x - parentBox.width,
                     childBox.height]);
      jumlib.assert(false, 'Node is cut off at the right: ' +
                    _reportNode(child) + '. Parent node: ' + _reportNode(parent));
    }
  
    // check height
    // We don't want to test menupopup's, as they always report the full height
    // of all items in the popup
    if (child.nodeName != 'menupopup' && parent.nodeName != 'menupopup') {
      if (childBox.width && childBox.screenY < parentBox.screenY) {
        badRects.push([childBox.x, childBox.y, parentBox.y - childBox.y,
                       childBox.width]);
        jumlib.assert(false, 'Node is cut off at the top: ' +
                      _reportNode(child) + '. Parent node: ' + _reportNode(parent));
      }
      if (childBox.width && childBox.screenY + childBox.height >
          parentBox.screenY + parentBox.height) {
        badRects.push([childBox.x, parentBox.y + parentBox.height,
                       childBox.width,
                       childBox.y + childBox.height - parentBox.y - parentBox.height]);
        jumlib.assert(false, 'Node is cut off at the bottom: ' +
                      _reportNode(child) + '. Parent node: ' + _reportNode(parent));
      }
    }
  
    return badRects;
  }