From 3d6a5e08bdc30a68a1b9c2962abe41684282baa6 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Sat, 10 May 2014 02:02:00 -0400 Subject: [PATCH] Bug 966579 - Tweaks to mutation observer usage for fix intermittent chat orange. r=mixedpuppy --- browser/base/content/test/social/head.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/browser/base/content/test/social/head.js b/browser/base/content/test/social/head.js index 2369533ade9..53cc7e25c41 100644 --- a/browser/base/content/test/social/head.js +++ b/browser/base/content/test/social/head.js @@ -543,17 +543,18 @@ function resizeAndCheckWidths(first, second, third, checks, cb) { } ok(true, count + ": " + "correct number of chats visible"); info(">> Check " + count); - resizeAndCheckWidths(first, second, third, checks, cb); - return true; + executeSoon(function() { + resizeAndCheckWidths(first, second, third, checks, cb); + }); } - return false; - } - if (!collapsedObserver()) { - let m = new MutationObserver(collapsedObserver); - m.observe(first, {attributes: true }); - m.observe(second, {attributes: true }); - m.observe(third, {attributes: true }); } + let m = new MutationObserver(collapsedObserver); + m.observe(first, {attributes: true }); + m.observe(second, {attributes: true }); + m.observe(third, {attributes: true }); + // and just in case we are already at the right size, explicitly call the + // observer. + collapsedObserver(undefined, m); }, count); }