code: function assertElementVisible(controller, elem, expectedVisibility) {
    var element = elem.getNode();
    var visible;
  
    switch (element.nodeName) {
      case 'panel':
        visible = (element.state == 'open');
        break;
      default:
        var style = controller.window.getComputedStyle(element, '');
        var state = style.getPropertyValue('visibility');
        visible = (state == 'visible');
    }
  
    controller.assertJS('subject.visible == subject.expectedVisibility', {
      visible: visible,
      expectedVisibility: expectedVisibility
    });
  }
docs: Checks the visibility of an element.
  XXX: Mozmill doesn't check if an element is visible and also operates on
  elements which are invisible. (Bug 490548)
  
  @param {MozmillController} controller
  MozMillController of the window to operate on
  @param {ElemBase} elem
  Element to check its visibility
  @param {boolean} expectedVisibility
  Expected visibility state of the element