Backed out changeset 2d981ccf4c2e (bug 1298328) for failing X tests on /experiments/test/xpcshell/test_conditions.js on a CLOSED TREE

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- *//* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */#ifndef __nsXPLookAndFeel#define __nsXPLookAndFeel#include"mozilla/LookAndFeel.h"#include"nsTArray.h"classnsLookAndFeel;structnsLookAndFeelIntPref{constchar*name;mozilla::LookAndFeel::IntIDid;boolisSet;int32_tintVar;};structnsLookAndFeelFloatPref{constchar*name;mozilla::LookAndFeel::FloatIDid;boolisSet;floatfloatVar;};#define CACHE_BLOCK(x) ((x) >> 5)#define CACHE_BIT(x) (1 << ((x) & 31))#define COLOR_CACHE_SIZE (CACHE_BLOCK(LookAndFeel::eColorID_LAST_COLOR) + 1)#define IS_COLOR_CACHED(x) (CACHE_BIT(x) & nsXPLookAndFeel::sCachedColorBits[CACHE_BLOCK(x)])#define CLEAR_COLOR_CACHE(x) nsXPLookAndFeel::sCachedColors[(x)] =0; \ nsXPLookAndFeel::sCachedColorBits[CACHE_BLOCK(x)] &= ~(CACHE_BIT(x));#define CACHE_COLOR(x, y) nsXPLookAndFeel::sCachedColors[(x)] = y; \ nsXPLookAndFeel::sCachedColorBits[CACHE_BLOCK(x)] |= CACHE_BIT(x);classnsXPLookAndFeel:publicmozilla::LookAndFeel{public:virtual~nsXPLookAndFeel();staticnsXPLookAndFeel*GetInstance();staticvoidShutdown();voidInit();//// All these routines will return NS_OK if they have a value,// in which case the nsLookAndFeel should use that value;// otherwise we'll return NS_ERROR_NOT_AVAILABLE, in which case, the// platform-specific nsLookAndFeel should use its own values instead.//nsresultGetColorImpl(ColorIDaID,boolaUseStandinsForNativeColors,nscolor&aResult);virtualnsresultGetIntImpl(IntIDaID,int32_t&aResult);virtualnsresultGetFloatImpl(FloatIDaID,float&aResult);// This one is different: there are no override prefs (fixme?), so// there is no XP implementation, only per-system impls.virtualboolGetFontImpl(FontIDaID,nsString&aName,gfxFontStyle&aStyle,floataDevPixPerCSSPixel)=0;virtualvoidRefreshImpl();virtualchar16_tGetPasswordCharacterImpl(){returnchar16_t('*');}virtualboolGetEchoPasswordImpl(){returnfalse;}virtualuint32_tGetPasswordMaskDelayImpl(){return600;}virtualnsTArray<LookAndFeelInt>GetIntCacheImpl();virtualvoidSetIntCacheImpl(constnsTArray<LookAndFeelInt>&aLookAndFeelIntCache){}virtualvoidNativeInit()=0;protected:nsXPLookAndFeel();staticvoidIntPrefChanged(nsLookAndFeelIntPref*data);staticvoidFloatPrefChanged(nsLookAndFeelFloatPref*data);staticvoidColorPrefChanged(unsignedintindex,constchar*prefName);voidInitFromPref(nsLookAndFeelIntPref*aPref);voidInitFromPref(nsLookAndFeelFloatPref*aPref);voidInitColorFromPref(int32_taIndex);virtualnsresultNativeGetColor(ColorIDaID,nscolor&aResult)=0;boolIsSpecialColor(ColorIDaID,nscolor&aColor);boolColorIsNotCSSAccessible(ColorIDaID);nscolorGetStandinForNativeColor(ColorIDaID);staticvoidOnPrefChanged(constchar*aPref,void*aClosure);staticboolsInitialized;staticnsLookAndFeelIntPrefsIntPrefs[];staticnsLookAndFeelFloatPrefsFloatPrefs[];/* this length must not be shorter than the length of the longest string in the array * see nsXPLookAndFeel.cpp */staticconstcharsColorPrefs[][41];staticint32_tsCachedColors[LookAndFeel::eColorID_LAST_COLOR];staticint32_tsCachedColorBits[COLOR_CACHE_SIZE];staticboolsUseNativeColors;staticboolsUseStandinsForNativeColors;staticboolsFindbarModalHighlight;staticnsXPLookAndFeel*sInstance;staticboolsShutdown;};#endif