diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index 0bd94fa0bb3..6bcc88c8dee 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -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?");