add:  if (insertNew) InsertElementAroundSelection(fieldsetElement); else editorShell.SelectElement(fieldsetElement);  editorShell.CloneAttributes(legendElement, globalElement); 
context: function onAccept(){  // All values are valid - copy to actual element in doc  // ValidateData();  editorShell.BeginBatchChanges();  try {    editorShell.CloneAttributes(legendElement, globalElement);      if (insertNew)      InsertElementAroundSelection(fieldsetElement);      if (gDialog.editText.checked)    {      if (gDialog.legendText.value)      {        var editor = editorShell.editor;        if (newLegend)          editorShell.InsertElement(legendElement, fieldsetElement, 0, true);        else while (legendElement.firstChild)          editor.DeleteNode(legendElement.firstChild);        editor.InsertNode(document.createTextNode(gDialog.legendText.value), legendElement, 0);      }      else if (!newLegend)        editorShell.DeleteElement(legendElement);    }  }  finally {    editorShell.EndBatchChanges();  }  SaveWindowLocation();  return true;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/e47926563562a0f6c56b89db30df0ccf595b1f02/EdFieldSetProps.js/clean/editor/ui/dialogs/content/EdFieldSetProps.js