diff --git a/AppKit/CPColor.j b/AppKit/CPColor.j index cd6ad01e9..57ea1a9d4 100644 --- a/AppKit/CPColor.j +++ b/AppKit/CPColor.j @@ -563,9 +563,10 @@ var cachedBlackColor, { // Fix to avoid a problem when compiling a theme (missing the alpha component as theme compiler doesn't have CSS rgba capability) var hasAlpha = YES; -#if PLATFORM(DOM) - hasAlpha = CPFeatureIsCompatible(CPCSSRGBAFeature) && _components[3] != 1.0; -#endif + if (CPDOMAvailable) + { + hasAlpha = CPFeatureIsCompatible(CPCSSRGBAFeature) && _components[3] != 1.0; + } _cssString = (hasAlpha ? "rgba(" : "rgb(") + parseInt(_components[0] * 255.0) + ", " + diff --git a/AppKit/CPScreen.j b/AppKit/CPScreen.j index e4a763088..fceb68276 100644 --- a/AppKit/CPScreen.j +++ b/AppKit/CPScreen.j @@ -42,11 +42,10 @@ */ - (CGRect)visibleFrame { -#if PLATFORM(DOM) - return CGRectMake(window.screen.availLeft, window.screen.availTop, window.screen.availWidth, window.screen.availHeight); -#else + if (CPDOMAvailable) + return CGRectMake(window.screen.availLeft, window.screen.availTop, window.screen.availWidth, window.screen.availHeight); + return CGRectMakeZero(); -#endif } @end