From 693f1f58409c68e429d57e67cb9cf832e319e15b Mon Sep 17 00:00:00 2001 From: Vivien Nicolas <21@vingtetun.org> Date: Fri, 11 Feb 2011 16:50:11 -0500 Subject: [PATCH] Bug 629038 - Disabling reflow zoom requires a browser restart; r=dougt a=blocking-fennec --- dom/ipc/ContentParent.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 34cdd2380b4..c983ab0bbc5 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -381,9 +381,22 @@ ContentParent::Observe(nsISupports* aSubject, nsCOMPtr prefService = do_GetService("@mozilla.org/preferences-service;1"); - PRBool prefHasValue; - prefService->PrefHasUserValue(strData, &prefHasValue); - if (prefHasValue) { + PRBool prefNeedUpdate; + prefService->PrefHasUserValue(strData, &prefNeedUpdate); + + // If the pref does not have a user value, check if it exist on the + // default branch or not + if (!prefNeedUpdate) { + nsCOMPtr defaultBranch; + nsCOMPtr prefsService = do_QueryInterface(prefService); + prefsService->GetDefaultBranch(nsnull, getter_AddRefs(defaultBranch)); + + PRInt32 prefType = nsIPrefBranch::PREF_INVALID; + defaultBranch->GetPrefType(strData.get(), &prefType); + prefNeedUpdate = (prefType != nsIPrefBranch::PREF_INVALID); + } + + if (prefNeedUpdate) { // Pref was created, or previously existed and its value // changed. PrefTuple pref;