From ce179ee3b63b646e47f3924c32702caaed479765 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 18 Sep 2010 05:13:47 -0400 Subject: [PATCH] Prevent stylesheets from being appended to the list more than once. --- common/modules/sanitizer.jsm | 3 ++- common/modules/styles.jsm | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm index 4c0777de..6900169d 100644 --- a/common/modules/sanitizer.jsm +++ b/common/modules/sanitizer.jsm @@ -1,4 +1,5 @@ // Copyright (c) 2009 by Doug Kearns +// Copyright (c) 2009-2010 by Kris Maglione // // This work is licensed for reuse under an MIT license. Details are // given in the LICENSE.txt file included with this file. @@ -50,7 +51,7 @@ const Sanitizer = Module("sanitizer", tmp.Sanitizer, { passwords: "Saved passwords", sessions: "Authenticated sessions", }; - // These builtin methods don't support hosts or have + // These builtin methods don't support hosts or otherwise have // insufficient granularity this.addItem("cookies", { description: "Cookies", diff --git a/common/modules/styles.jsm b/common/modules/styles.jsm index 60bc319a..d38f5a37 100644 --- a/common/modules/styles.jsm +++ b/common/modules/styles.jsm @@ -107,12 +107,13 @@ const Styles = Module("Styles", { sheet.filter = filter; sheet.css = String(css); } - else + else { sheet = Sheet(name, this._id++, filter.filter(util.identity), String(css), system, agent); + sheets.push(sheet); + } if (!lazy) sheet.enabled = true; - sheets.push(sheet); if (name) names[name] = sheet;