Bug 528792 - :-moz-lwtheme incorrectly depends on the lwthemetextcolor attribute. r=dbaron

This commit is contained in:
Blair McBride 2009-11-16 09:27:44 +01:00
parent efd1c0daa3
commit b325aad4d2
2 changed files with 6 additions and 3 deletions

View File

@ -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; }

View File

@ -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())) {