Bustage fixes for bug 221316 no longer needed thanks to bug 221525.

This commit is contained in:
dbaron%dbaron.org 2003-10-07 23:21:50 +00:00
Родитель 3ca027dcc3
Коммит 512f12a16d
1 изменённых файлов: 4 добавлений и 11 удалений

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

@ -1221,24 +1221,19 @@ nsHTMLDocument::InternalAddStyleSheet(nsIStyleSheet* aSheet, PRUint32 aFlags)
{
if (aSheet == mAttrStyleSheet) { // always first
NS_ASSERTION(mStyleSheets.Count() == 0 ||
mAttrStyleSheet !=
NS_STATIC_CAST(nsIStyleSheet*, mStyleSheets[0]),
mAttrStyleSheet != mStyleSheets[0],
"Adding attr sheet twice!");
mStyleSheets.InsertObjectAt(aSheet, 0);
}
else if (aSheet == mStyleAttrStyleSheet) { // always last
NS_ASSERTION(mStyleSheets.Count() == 0 ||
NS_STATIC_CAST(nsIStyleSheet*,
mStyleSheets[mStyleSheets.Count() - 1]) !=
mStyleAttrStyleSheet,
mStyleSheets[mStyleSheets.Count() - 1] != mStyleAttrStyleSheet,
"Adding style attr sheet twice!");
mStyleSheets.AppendObject(aSheet);
}
else {
PRInt32 count = mStyleSheets.Count();
if (count != 0 &&
mStyleAttrStyleSheet ==
NS_STATIC_CAST(nsIStyleSheet*, mStyleSheets[count - 1])) {
if (count != 0 && mStyleAttrStyleSheet == mStyleSheets[count - 1]) {
// keep attr sheet last
mStyleSheets.InsertObjectAt(aSheet, count - 1);
}
@ -1287,9 +1282,7 @@ PRInt32
nsHTMLDocument::InternalGetNumberOfStyleSheets()
{
PRInt32 count = mStyleSheets.Count();
if (count != 0 &&
mStyleAttrStyleSheet ==
NS_STATIC_CAST(nsIStyleSheet*, mStyleSheets[count - 1]))
if (count != 0 && mStyleAttrStyleSheet == mStyleSheets[count - 1])
--count;
--count; // for the attr sheet
NS_ASSERTION(count >= 0, "Why did we end up with a negative count?");