From b325aad4d220c8ee734ad91298b9782a87cbd292 Mon Sep 17 00:00:00 2001 From: Blair McBride Date: Mon, 16 Nov 2009 09:27:44 +0100 Subject: [PATCH] Bug 528792 - :-moz-lwtheme incorrectly depends on the lwthemetextcolor attribute. r=dbaron --- content/base/public/nsIDocument.h | 8 +++++--- content/xul/document/src/nsXULDocument.cpp | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 64f7701d4ae4..45c92b904bbf 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -1178,14 +1178,16 @@ public: enum DocumentTheme { Doc_Theme_Uninitialized, // not determined yet Doc_Theme_None, + Doc_Theme_Neutral, Doc_Theme_Dark, Doc_Theme_Bright }; /** - * Returns Doc_Theme_None if there is no lightweight theme specified, Doc_Theme_Dark - * for a dark theme and Doc_Theme_Bright for a light theme. This is used to - * determine the state of the pseudoclasses :-moz-lwtheme and :-moz-lwtheme-text. + * Returns Doc_Theme_None if there is no lightweight theme specified, + * Doc_Theme_Dark for a dark theme, Doc_Theme_Bright for a light theme, and + * Doc_Theme_Neutral for any other theme. This is used to determine the state + * of the pseudoclasses :-moz-lwtheme and :-moz-lwtheme-text. */ virtual int GetDocumentLWTheme() { return Doc_Theme_None; } diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index c74032ce740d..280c3ef34f90 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -4759,6 +4759,7 @@ nsXULDocument::GetDocumentLWTheme() content->GetAttr(kNameSpaceID_None, nsGkAtoms::lwtheme, hasLWTheme) && !(hasLWTheme.IsEmpty()) && hasLWTheme.EqualsLiteral("true")) { + mDocLWTheme = Doc_Theme_Neutral; nsAutoString lwTheme; content->GetAttr(kNameSpaceID_None, nsGkAtoms::lwthemetextcolor, lwTheme); if (!(lwTheme.IsEmpty())) {