#include <nsICSSLoader.h>
#include <nsICSSStyleSheet.h>
#include <nsIPresShell.h>
-#include <nsIServiceManagerUtils.h>
+#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
+# include <nsServiceManagerUtils.h>
+#else
+# include <nsIServiceManagerUtils.h>
+#endif
#include <nsIURI.h>
#include <nsNetUtil.h>
{
nsCOMArray<nsIStyleSheet> style_sheets;
check(pres_shell->GetAgentStyleSheets(style_sheets));
- check(style_sheets.InsertObjectAt(style_sheet, 0));
+ check(style_sheets.AppendObject(style_sheet));
check(pres_shell->SetAgentStyleSheets(style_sheets));
- check(pres_shell->EnablePrefStyleRules(false));
+ // FIXME: We need to find an alternative that works in Mozilla 1.8.
+# if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR < 8
+ check(pres_shell->EnablePrefStyleRules(false));
+# endif
// Update the display
- check(pres_shell->ReconstructStyleData());
- check(pres_shell->FlushPendingNotifications(true));
+# if MOZ_VERSION_MAJOR > 1 \
+ || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
+ pres_shell->ReconstructStyleData();
+ check(pres_shell->FlushPendingNotifications(Flush_Display));
+# else
+ check(pres_shell->ReconstructStyleData());
+ check(pres_shell->FlushPendingNotifications(true));
+# endif
}
-