Fix bug 32904 Asserts at startup in nsScriptSecurityManager.cpp

r=mstoltz
This commit is contained in:
norris%netscape.com 2000-03-23 23:42:46 +00:00
Родитель bc735403b0
Коммит 07a6acc61f
4 изменённых файлов: 81 добавлений и 60 удалений

Просмотреть файл

@ -1595,6 +1595,14 @@ nsScriptSecurityManager::InitFromPrefs()
NS_ASSERTION(NS_DOM_PROP_MAX == sizeof(domPropNames)/sizeof(domPropNames[0]),
"mismatch in property name count");
// The DOM property names had better be sorted for binary search to work
#ifdef DEBUG
for (unsigned i=1; i < sizeof(domPropNames)/sizeof(domPropNames[0]); i++) {
NS_ASSERTION(strcmp(domPropNames[i-1], domPropNames[i]) < 0,
"DOM properties are not properly sorted");
}
#endif
nsresult rv;
NS_WITH_SERVICE(nsIPref, prefs, kPrefServiceCID, &rv);
if (NS_FAILED(rv))

Просмотреть файл

@ -68,14 +68,27 @@ print OUT <<'EOF';
#define NS_DOM_PROP_NAMES \
EOF
$last = "";
while (<IN>) {
if (/NS_DOM_PROP_MAX/) {
last;
}
$save = $_;
s/,.*/", \\/;
s/NS_DOM_PROP_/"/;
s/_/./;
s/,.*/", \\/;
print OUT lc($_);
$_ = lc($_);
print OUT $_;
# Check order of names and make sure they are sorted.
# It's important we check after the subsitution of '.' for '_'
# since it's the sort order of the names we care about and '.'
# and '_' sort differently with respect to letters.
if ($last ne "" && ($last gt $_)) {
die "Name $lastsave and $save are out of order in nsDOMPropEnums.h.\n";
}
$last = $_;
$lastsave = $save;
}
print OUT <<EOF;

Просмотреть файл

@ -218,19 +218,19 @@ enum nsDOMProp {
NS_DOM_PROP_DOCUMENT_GETELEMENTSBYTAGNAME,
NS_DOM_PROP_DOCUMENT_IMPLEMENTATION,
NS_DOM_PROP_DOCUMENTTYPE_ENTITIES,
NS_DOM_PROP_DOCUMENTTYPE_INTERNALSUBSET,
NS_DOM_PROP_DOCUMENTTYPE_NAME,
NS_DOM_PROP_DOCUMENTTYPE_NOTATIONS,
NS_DOM_PROP_DOCUMENTTYPE_PUBLICID,
NS_DOM_PROP_DOCUMENTTYPE_SYSTEMID,
NS_DOM_PROP_DOCUMENTTYPE_INTERNALSUBSET,
NS_DOM_PROP_DOMEXCEPTION_CODE,
NS_DOM_PROP_DOMEXCEPTION_MESSAGE,
NS_DOM_PROP_DOMEXCEPTION_NAME,
NS_DOM_PROP_DOMEXCEPTION_RESULT,
NS_DOM_PROP_DOMEXCEPTION_TOSTRING,
NS_DOM_PROP_DOMIMPLEMENTATION_HASFEATURE,
NS_DOM_PROP_DOMIMPLEMENTATION_CREATEDOCUMENTTYPE,
NS_DOM_PROP_DOMIMPLEMENTATION_CREATEDOCUMENT,
NS_DOM_PROP_DOMIMPLEMENTATION_CREATEDOCUMENTTYPE,
NS_DOM_PROP_DOMIMPLEMENTATION_HASFEATURE,
NS_DOM_PROP_ELEMENT_GETATTRIBUTE,
NS_DOM_PROP_ELEMENT_GETATTRIBUTENODE,
NS_DOM_PROP_ELEMENT_GETELEMENTSBYTAGNAME,
@ -356,6 +356,8 @@ enum nsDOMProp {
NS_DOM_PROP_HTMLFONTELEMENT_COLOR,
NS_DOM_PROP_HTMLFONTELEMENT_FACE,
NS_DOM_PROP_HTMLFONTELEMENT_SIZE,
NS_DOM_PROP_HTMLFORMCONTROLLIST_ITEM,
NS_DOM_PROP_HTMLFORMCONTROLLIST_NAMEDITEM,
NS_DOM_PROP_HTMLFORMELEMENT_ACCEPTCHARSET,
NS_DOM_PROP_HTMLFORMELEMENT_ACTION,
NS_DOM_PROP_HTMLFORMELEMENT_ELEMENTS,
@ -366,8 +368,6 @@ enum nsDOMProp {
NS_DOM_PROP_HTMLFORMELEMENT_RESET,
NS_DOM_PROP_HTMLFORMELEMENT_SUBMIT,
NS_DOM_PROP_HTMLFORMELEMENT_TARGET,
NS_DOM_PROP_HTMLFORMCONTROLLIST_ITEM,
NS_DOM_PROP_HTMLFORMCONTROLLIST_NAMEDITEM,
NS_DOM_PROP_HTMLFRAMEELEMENT_FRAMEBORDER,
NS_DOM_PROP_HTMLFRAMEELEMENT_LONGDESC,
NS_DOM_PROP_HTMLFRAMEELEMENT_MARGINHEIGHT,
@ -656,17 +656,17 @@ enum nsDOMProp {
NS_DOM_PROP_NAVIGATOR_JAVAENABLED,
NS_DOM_PROP_NAVIGATOR_LANGUAGE,
NS_DOM_PROP_NAVIGATOR_MIMETYPES,
NS_DOM_PROP_NAVIGATOR_PLATFORM,
NS_DOM_PROP_NAVIGATOR_VENDOR,
NS_DOM_PROP_NAVIGATOR_VENDORSUB,
NS_DOM_PROP_NAVIGATOR_PRODUCT,
NS_DOM_PROP_NAVIGATOR_PRODUCTSUB,
NS_DOM_PROP_NAVIGATOR_OSCPU,
NS_DOM_PROP_NAVIGATOR_PLATFORM,
NS_DOM_PROP_NAVIGATOR_PLUGINS,
NS_DOM_PROP_NAVIGATOR_PREFERENCE,
NS_DOM_PROP_NAVIGATOR_PRODUCT,
NS_DOM_PROP_NAVIGATOR_PRODUCTSUB,
NS_DOM_PROP_NAVIGATOR_SECURITYPOLICY,
NS_DOM_PROP_NAVIGATOR_TAINTENABLED,
NS_DOM_PROP_NAVIGATOR_USERAGENT,
NS_DOM_PROP_NAVIGATOR_VENDOR,
NS_DOM_PROP_NAVIGATOR_VENDORSUB,
NS_DOM_PROP_NODE_APPENDCHILD,
NS_DOM_PROP_NODE_ATTRIBUTES,
NS_DOM_PROP_NODE_CHILDNODES,
@ -694,21 +694,21 @@ enum nsDOMProp {
NS_DOM_PROP_NSDOCUMENT_HEIGHT,
NS_DOM_PROP_NSDOCUMENT_STYLESHEETS,
NS_DOM_PROP_NSDOCUMENT_WIDTH,
NS_DOM_PROP_NSHTMLANCHORELEMENT_PROTOCOL,
NS_DOM_PROP_NSHTMLANCHORELEMENT_HASH,
NS_DOM_PROP_NSHTMLANCHORELEMENT_HOST,
NS_DOM_PROP_NSHTMLANCHORELEMENT_HOSTNAME,
NS_DOM_PROP_NSHTMLANCHORELEMENT_PATHNAME,
NS_DOM_PROP_NSHTMLANCHORELEMENT_SEARCH,
NS_DOM_PROP_NSHTMLANCHORELEMENT_PORT,
NS_DOM_PROP_NSHTMLANCHORELEMENT_HASH,
NS_DOM_PROP_NSHTMLANCHORELEMENT_PROTOCOL,
NS_DOM_PROP_NSHTMLANCHORELEMENT_SEARCH,
NS_DOM_PROP_NSHTMLANCHORELEMENT_TEXT,
NS_DOM_PROP_NSHTMLAREAELEMENT_PROTOCOL,
NS_DOM_PROP_NSHTMLAREAELEMENT_HASH,
NS_DOM_PROP_NSHTMLAREAELEMENT_HOST,
NS_DOM_PROP_NSHTMLAREAELEMENT_HOSTNAME,
NS_DOM_PROP_NSHTMLAREAELEMENT_PATHNAME,
NS_DOM_PROP_NSHTMLAREAELEMENT_SEARCH,
NS_DOM_PROP_NSHTMLAREAELEMENT_PORT,
NS_DOM_PROP_NSHTMLAREAELEMENT_HASH,
NS_DOM_PROP_NSHTMLAREAELEMENT_PROTOCOL,
NS_DOM_PROP_NSHTMLAREAELEMENT_SEARCH,
NS_DOM_PROP_NSHTMLBUTTONELEMENT_BLUR,
NS_DOM_PROP_NSHTMLBUTTONELEMENT_FOCUS,
NS_DOM_PROP_NSHTMLDOCUMENT_ALINKCOLOR,
@ -798,7 +798,6 @@ enum nsDOMProp {
NS_DOM_PROP_SCREEN_PIXELDEPTH,
NS_DOM_PROP_SCREEN_WIDTH,
NS_DOM_PROP_SELECTION_ADDRANGE,
NS_DOM_PROP_SELECTION_REMOVERANGE,
NS_DOM_PROP_SELECTION_ADDSELECTIONLISTENER,
NS_DOM_PROP_SELECTION_ANCHORNODE,
NS_DOM_PROP_SELECTION_ANCHOROFFSET,
@ -807,17 +806,18 @@ enum nsDOMProp {
NS_DOM_PROP_SELECTION_COLLAPSETOEND,
NS_DOM_PROP_SELECTION_COLLAPSETOSTART,
NS_DOM_PROP_SELECTION_CONTAINSNODE,
NS_DOM_PROP_SELECTION_SETHINT,
NS_DOM_PROP_SELECTION_GETHINT,
NS_DOM_PROP_SELECTION_DELETEFROMDOCUMENT,
NS_DOM_PROP_SELECTION_ENDBATCHCHANGES,
NS_DOM_PROP_SELECTION_EXTEND,
NS_DOM_PROP_SELECTION_FOCUSNODE,
NS_DOM_PROP_SELECTION_FOCUSOFFSET,
NS_DOM_PROP_SELECTION_GETHINT,
NS_DOM_PROP_SELECTION_GETRANGEAT,
NS_DOM_PROP_SELECTION_ISCOLLAPSED,
NS_DOM_PROP_SELECTION_RANGECOUNT,
NS_DOM_PROP_SELECTION_REMOVERANGE,
NS_DOM_PROP_SELECTION_REMOVESELECTIONLISTENER,
NS_DOM_PROP_SELECTION_SETHINT,
NS_DOM_PROP_SELECTION_STARTBATCHCHANGES,
NS_DOM_PROP_SELECTION_TOSTRING,
NS_DOM_PROP_SELECTIONLISTENER_NOTIFYSELECTIONCHANGED,
@ -851,7 +851,6 @@ enum nsDOMProp {
NS_DOM_PROP_WINDOW_CLOSED,
NS_DOM_PROP_WINDOW_CONFIRM,
NS_DOM_PROP_WINDOW_CONTENT,
NS_DOM_PROP_WINDOW_SIDEBAR,
NS_DOM_PROP_WINDOW_CONTROLLERS,
NS_DOM_PROP_WINDOW_DEFAULTSTATUS,
NS_DOM_PROP_WINDOW_DIRECTORIES,
@ -904,6 +903,7 @@ enum nsDOMProp {
NS_DOM_PROP_WINDOW_SELF,
NS_DOM_PROP_WINDOW_SETINTERVAL,
NS_DOM_PROP_WINDOW_SETTIMEOUT,
NS_DOM_PROP_WINDOW_SIDEBAR,
NS_DOM_PROP_WINDOW_SIZETOCONTENT,
NS_DOM_PROP_WINDOW_STATUS,
NS_DOM_PROP_WINDOW_STATUSBAR,
@ -916,6 +916,7 @@ enum nsDOMProp {
NS_DOM_PROP_WINDOWCOLLECTION_ITEM,
NS_DOM_PROP_WINDOWCOLLECTION_LENGTH,
NS_DOM_PROP_WINDOWCOLLECTION_NAMEDITEM,
NS_DOM_PROP_XULBROWSERELEMENT_WEBBROWSER,
NS_DOM_PROP_XULCHECKBOXELEMENT_ACCESSKEY,
NS_DOM_PROP_XULCHECKBOXELEMENT_CHECKED,
NS_DOM_PROP_XULCHECKBOXELEMENT_CROP,
@ -939,14 +940,12 @@ enum nsDOMProp {
NS_DOM_PROP_XULDOCUMENT_PERSIST,
NS_DOM_PROP_XULDOCUMENT_POPUPNODE,
NS_DOM_PROP_XULDOCUMENT_TOOLTIPNODE,
NS_DOM_PROP_XULIFRAMEELEMENT_DOCSHELL,
NS_DOM_PROP_XULBROWSERELEMENT_WEBBROWSER,
NS_DOM_PROP_XULEDITORELEMENT_EDITORSHELL,
NS_DOM_PROP_XULELEMENT_ADDBROADCASTLISTENER,
NS_DOM_PROP_XULELEMENT_ANONYMOUSCONTENT,
NS_DOM_PROP_XULELEMENT_BLUR,
NS_DOM_PROP_XULELEMENT_CLICK,
NS_DOM_PROP_XULELEMENT_CLASSNAME,
NS_DOM_PROP_XULELEMENT_CLICK,
NS_DOM_PROP_XULELEMENT_CONTROLLERS,
NS_DOM_PROP_XULELEMENT_DATABASE,
NS_DOM_PROP_XULELEMENT_DOCOMMAND,
@ -956,6 +955,7 @@ enum nsDOMProp {
NS_DOM_PROP_XULELEMENT_REMOVEBROADCASTLISTENER,
NS_DOM_PROP_XULELEMENT_RESOURCE,
NS_DOM_PROP_XULELEMENT_STYLE,
NS_DOM_PROP_XULIFRAMEELEMENT_DOCSHELL,
NS_DOM_PROP_XULMENULISTELEMENT_CROP,
NS_DOM_PROP_XULMENULISTELEMENT_DATA,
NS_DOM_PROP_XULMENULISTELEMENT_DISABLED,
@ -963,9 +963,8 @@ enum nsDOMProp {
NS_DOM_PROP_XULMENULISTELEMENT_SELECTEDITEM,
NS_DOM_PROP_XULMENULISTELEMENT_SRC,
NS_DOM_PROP_XULMENULISTELEMENT_VALUE,
NS_DOM_PROP_XULPOPUPELEMENT_OPENPOPUP,
NS_DOM_PROP_XULPOPUPELEMENT_CLOSEPOPUP,
NS_DOM_PROP_XULRADIOGROUPELEMENT_SELECTEDITEM,
NS_DOM_PROP_XULPOPUPELEMENT_OPENPOPUP,
NS_DOM_PROP_XULRADIOELEMENT_ACCESSKEY,
NS_DOM_PROP_XULRADIOELEMENT_CHECKED,
NS_DOM_PROP_XULRADIOELEMENT_CROP,
@ -973,6 +972,7 @@ enum nsDOMProp {
NS_DOM_PROP_XULRADIOELEMENT_IMGALIGN,
NS_DOM_PROP_XULRADIOELEMENT_SRC,
NS_DOM_PROP_XULRADIOELEMENT_VALUE,
NS_DOM_PROP_XULRADIOGROUPELEMENT_SELECTEDITEM,
NS_DOM_PROP_XULTITLEDBUTTONELEMENT_ACCESSKEY,
NS_DOM_PROP_XULTITLEDBUTTONELEMENT_CROP,
NS_DOM_PROP_XULTITLEDBUTTONELEMENT_DISABLED,
@ -983,6 +983,10 @@ enum nsDOMProp {
NS_DOM_PROP_XULTREEELEMENT_ADDITEMTOSELECTION,
NS_DOM_PROP_XULTREEELEMENT_CLEARCELLSELECTION,
NS_DOM_PROP_XULTREEELEMENT_CLEARITEMSELECTION,
NS_DOM_PROP_XULTREEELEMENT_CURRENTCELL,
NS_DOM_PROP_XULTREEELEMENT_CURRENTITEM,
NS_DOM_PROP_XULTREEELEMENT_ENSUREELEMENTISVISIBLE,
NS_DOM_PROP_XULTREEELEMENT_GETROWINDEXOF,
NS_DOM_PROP_XULTREEELEMENT_INVERTSELECTION,
NS_DOM_PROP_XULTREEELEMENT_REMOVECELLFROMSELECTION,
NS_DOM_PROP_XULTREEELEMENT_REMOVEITEMFROMSELECTION,
@ -991,14 +995,10 @@ enum nsDOMProp {
NS_DOM_PROP_XULTREEELEMENT_SELECTCELLRANGE,
NS_DOM_PROP_XULTREEELEMENT_SELECTEDCELLS,
NS_DOM_PROP_XULTREEELEMENT_SELECTEDITEMS,
NS_DOM_PROP_XULTREEELEMENT_CURRENTITEM,
NS_DOM_PROP_XULTREEELEMENT_CURRENTCELL,
NS_DOM_PROP_XULTREEELEMENT_SELECTITEM,
NS_DOM_PROP_XULTREEELEMENT_SELECTITEMRANGE,
NS_DOM_PROP_XULTREEELEMENT_TOGGLECELLSELECTION,
NS_DOM_PROP_XULTREEELEMENT_TOGGLEITEMSELECTION,
NS_DOM_PROP_XULTREEELEMENT_ENSUREELEMENTISVISIBLE,
NS_DOM_PROP_XULTREEELEMENT_GETROWINDEXOF,
NS_DOM_PROP_MAX
};

Просмотреть файл

@ -217,19 +217,19 @@
"document.getelementsbytagname", \
"document.implementation", \
"documenttype.entities", \
"documenttype.internalsubset", \
"documenttype.name", \
"documenttype.notations", \
"documenttype.publicid", \
"documenttype.systemid", \
"documenttype.internalsubset", \
"domexception.code", \
"domexception.message", \
"domexception.name", \
"domexception.result", \
"domexception.tostring", \
"domimplementation.hasfeature", \
"domimplementation.createdocumenttype", \
"domimplementation.createdocument", \
"domimplementation.createdocumenttype", \
"domimplementation.hasfeature", \
"element.getattribute", \
"element.getattributenode", \
"element.getelementsbytagname", \
@ -355,6 +355,8 @@
"htmlfontelement.color", \
"htmlfontelement.face", \
"htmlfontelement.size", \
"htmlformcontrollist.item", \
"htmlformcontrollist.nameditem", \
"htmlformelement.acceptcharset", \
"htmlformelement.action", \
"htmlformelement.elements", \
@ -365,8 +367,6 @@
"htmlformelement.reset", \
"htmlformelement.submit", \
"htmlformelement.target", \
"htmlformcontrollist.item", \
"htmlformcontrollist.nameditem", \
"htmlframeelement.frameborder", \
"htmlframeelement.longdesc", \
"htmlframeelement.marginheight", \
@ -655,17 +655,17 @@
"navigator.javaenabled", \
"navigator.language", \
"navigator.mimetypes", \
"navigator.platform", \
"navigator.vendor", \
"navigator.vendorsub", \
"navigator.product", \
"navigator.productsub", \
"navigator.oscpu", \
"navigator.platform", \
"navigator.plugins", \
"navigator.preference", \
"navigator.product", \
"navigator.productsub", \
"navigator.securitypolicy", \
"navigator.taintenabled", \
"navigator.useragent", \
"navigator.vendor", \
"navigator.vendorsub", \
"node.appendchild", \
"node.attributes", \
"node.childnodes", \
@ -693,21 +693,21 @@
"nsdocument.height", \
"nsdocument.stylesheets", \
"nsdocument.width", \
"nshtmlanchorelement.protocol", \
"nshtmlanchorelement.hash", \
"nshtmlanchorelement.host", \
"nshtmlanchorelement.hostname", \
"nshtmlanchorelement.pathname", \
"nshtmlanchorelement.search", \
"nshtmlanchorelement.port", \
"nshtmlanchorelement.hash", \
"nshtmlanchorelement.protocol", \
"nshtmlanchorelement.search", \
"nshtmlanchorelement.text", \
"nshtmlareaelement.protocol", \
"nshtmlareaelement.hash", \
"nshtmlareaelement.host", \
"nshtmlareaelement.hostname", \
"nshtmlareaelement.pathname", \
"nshtmlareaelement.search", \
"nshtmlareaelement.port", \
"nshtmlareaelement.hash", \
"nshtmlareaelement.protocol", \
"nshtmlareaelement.search", \
"nshtmlbuttonelement.blur", \
"nshtmlbuttonelement.focus", \
"nshtmldocument.alinkcolor", \
@ -797,7 +797,6 @@
"screen.pixeldepth", \
"screen.width", \
"selection.addrange", \
"selection.removerange", \
"selection.addselectionlistener", \
"selection.anchornode", \
"selection.anchoroffset", \
@ -806,17 +805,18 @@
"selection.collapsetoend", \
"selection.collapsetostart", \
"selection.containsnode", \
"selection.sethint", \
"selection.gethint", \
"selection.deletefromdocument", \
"selection.endbatchchanges", \
"selection.extend", \
"selection.focusnode", \
"selection.focusoffset", \
"selection.gethint", \
"selection.getrangeat", \
"selection.iscollapsed", \
"selection.rangecount", \
"selection.removerange", \
"selection.removeselectionlistener", \
"selection.sethint", \
"selection.startbatchchanges", \
"selection.tostring", \
"selectionlistener.notifyselectionchanged", \
@ -850,7 +850,6 @@
"window.closed", \
"window.confirm", \
"window.content", \
"window.sidebar", \
"window.controllers", \
"window.defaultstatus", \
"window.directories", \
@ -903,6 +902,7 @@
"window.self", \
"window.setinterval", \
"window.settimeout", \
"window.sidebar", \
"window.sizetocontent", \
"window.status", \
"window.statusbar", \
@ -915,6 +915,7 @@
"windowcollection.item", \
"windowcollection.length", \
"windowcollection.nameditem", \
"xulbrowserelement.webbrowser", \
"xulcheckboxelement.accesskey", \
"xulcheckboxelement.checked", \
"xulcheckboxelement.crop", \
@ -938,14 +939,12 @@
"xuldocument.persist", \
"xuldocument.popupnode", \
"xuldocument.tooltipnode", \
"xuliframeelement.docshell", \
"xulbrowserelement.webbrowser", \
"xuleditorelement.editorshell", \
"xulelement.addbroadcastlistener", \
"xulelement.anonymouscontent", \
"xulelement.blur", \
"xulelement.click", \
"xulelement.classname", \
"xulelement.click", \
"xulelement.controllers", \
"xulelement.database", \
"xulelement.docommand", \
@ -955,6 +954,7 @@
"xulelement.removebroadcastlistener", \
"xulelement.resource", \
"xulelement.style", \
"xuliframeelement.docshell", \
"xulmenulistelement.crop", \
"xulmenulistelement.data", \
"xulmenulistelement.disabled", \
@ -962,9 +962,8 @@
"xulmenulistelement.selecteditem", \
"xulmenulistelement.src", \
"xulmenulistelement.value", \
"xulpopupelement.openpopup", \
"xulpopupelement.closepopup", \
"xulradiogroupelement.selecteditem", \
"xulpopupelement.openpopup", \
"xulradioelement.accesskey", \
"xulradioelement.checked", \
"xulradioelement.crop", \
@ -972,6 +971,7 @@
"xulradioelement.imgalign", \
"xulradioelement.src", \
"xulradioelement.value", \
"xulradiogroupelement.selecteditem", \
"xultitledbuttonelement.accesskey", \
"xultitledbuttonelement.crop", \
"xultitledbuttonelement.disabled", \
@ -982,6 +982,10 @@
"xultreeelement.additemtoselection", \
"xultreeelement.clearcellselection", \
"xultreeelement.clearitemselection", \
"xultreeelement.currentcell", \
"xultreeelement.currentitem", \
"xultreeelement.ensureelementisvisible", \
"xultreeelement.getrowindexof", \
"xultreeelement.invertselection", \
"xultreeelement.removecellfromselection", \
"xultreeelement.removeitemfromselection", \
@ -990,13 +994,9 @@
"xultreeelement.selectcellrange", \
"xultreeelement.selectedcells", \
"xultreeelement.selecteditems", \
"xultreeelement.currentitem", \
"xultreeelement.currentcell", \
"xultreeelement.selectitem", \
"xultreeelement.selectitemrange", \
"xultreeelement.togglecellselection", \
"xultreeelement.toggleitemselection", \
"xultreeelement.ensureelementisvisible", \
"xultreeelement.getrowindexof", \
#endif // nsDOMPropNames_h__