X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=style_sheets.cpp;h=9c599826e921abace5045c2d8cbe0659b1bbfd88;hb=6bc4ef41d90923d964f58288e2a76bda7016a4a3;hp=576780055d514d5b2575c607329107628fa50c93;hpb=0acb5f1329d294faf42e247f8c2daf68d82150f6;p=videolink.git diff --git a/style_sheets.cpp b/style_sheets.cpp index 5767800..9c59982 100644 --- a/style_sheets.cpp +++ b/style_sheets.cpp @@ -1,4 +1,4 @@ -// Copyright 2005 Ben Hutchings . +// Copyright 2005 Ben Hutchings . // See the file "COPYING" for licence details. #include "style_sheets.hpp" @@ -7,7 +7,11 @@ #include #include #include -#include +#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8) +# include +#else +# include +#endif #include #include @@ -38,13 +42,21 @@ void apply_style_sheet(nsIStyleSheet * style_sheet, nsIPresShell * pres_shell) { nsCOMArray 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 } -