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
Родитель 770f0634e4
Коммит 831e32541e
1 изменённых файлов: 4 добавлений и 11 удалений

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

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