Enable Jquery Containment without using position: relative
In Firefox Dev edition your original code worked fine unless I a) resized the dialog or b) the body was too small for the dialog. The fix for each is to set the containment on the resizable widget too and don't let the dialog start out larger than the body to begin with, respectively.

var maxWidth = $('body').width() - 20;
var maxHeight = $('body').height() - 20;
$("#dialog").dialog({
  autoOpen: false,
  height: maxHeight &gt; 300 ? 300 : maxHeight,
  width: maxWidth &gt; 830 ? 830 : maxWidth,
  dialogClass: 'myTitleClass',
  modal: true,
  draggable: true,
  title: "Carpe Diem. Nunca Acredito Posteiro",
  closeOnEscape: false,
  open: function(event, ui) {
    $('.ui-dialog-titlebar-close', ui.dialog | ui);
  },
  buttons: {
    "Save": function() {
      $(this).trigger(updateKeyword());
    }
  }
}).draggable({
  containment: 'body'
}).resizable({
  containment: 'body'
});


Here's the updated fiddle.