diff options
author | Brian Smith <brian@dbsoft.org> | 2022-04-26 09:34:34 -0500 |
---|---|---|
committer | Brian Smith <brian@dbsoft.org> | 2022-04-26 10:19:00 -0500 |
commit | 378738aaa9924d0b95e2c57f27cbad2b2e644282 (patch) | |
tree | 34ce9c4ce3995576604fb4bc47d9405e661daf39 /toolkit | |
parent | 82f11ad8aaeff395629c3a3f72ece43712fd8e72 (diff) | |
download | uxp-378738aaa9924d0b95e2c57f27cbad2b2e644282.tar.gz |
Issue #1829 - Revert “Issue #1751 - Remove Mac code behind MOZ_WIDGET_TOOLKIT == 'cocoa’”
This reverts commit 1fe9c19305dadf2d5bcaa0e589fcd250389dfa8a.
Diffstat (limited to 'toolkit')
259 files changed, 9713 insertions, 15 deletions
diff --git a/toolkit/components/parentalcontrols/moz.build b/toolkit/components/parentalcontrols/moz.build index 6c8bd9a8ce..577162945b 100644 --- a/toolkit/components/parentalcontrols/moz.build +++ b/toolkit/components/parentalcontrols/moz.build @@ -10,6 +10,8 @@ XPIDL_MODULE = 'parentalcontrols' if not CONFIG['MOZ_DISABLE_PARENTAL_CONTROLS']: if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': SOURCES += ['nsParentalControlsServiceWin.cpp'] + elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + UNIFIED_SOURCES += ['nsParentalControlsServiceCocoa.mm'] else: SOURCES += ['nsParentalControlsServiceDefault.cpp'] diff --git a/toolkit/components/parentalcontrols/nsParentalControlsServiceCocoa.mm b/toolkit/components/parentalcontrols/nsParentalControlsServiceCocoa.mm new file mode 100644 index 0000000000..0eb0184001 --- /dev/null +++ b/toolkit/components/parentalcontrols/nsParentalControlsServiceCocoa.mm @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 2; 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/. */ + +#include "nsParentalControlsService.h" +#include "nsString.h" +#include "nsIFile.h" + +#import <Cocoa/Cocoa.h> + +NS_IMPL_ISUPPORTS(nsParentalControlsService, nsIParentalControlsService) + +nsParentalControlsService::nsParentalControlsService() : + mEnabled(false) +{ + mEnabled = CFPreferencesAppValueIsForced(CFSTR("restrictWeb"), + CFSTR("com.apple.familycontrols.contentfilter")); +} + +nsParentalControlsService::~nsParentalControlsService() +{ +} + +NS_IMETHODIMP +nsParentalControlsService::GetParentalControlsEnabled(bool *aResult) +{ + *aResult = mEnabled; + return NS_OK; +} + +NS_IMETHODIMP +nsParentalControlsService::GetBlockFileDownloadsEnabled(bool *aResult) +{ + *aResult = false; + return NS_OK; +} + +NS_IMETHODIMP +nsParentalControlsService::GetLoggingEnabled(bool *aResult) +{ + *aResult = false; + return NS_OK; +} + +NS_IMETHODIMP +nsParentalControlsService::Log(int16_t aEntryType, + bool blocked, + nsIURI *aSource, + nsIFile *aTarget) +{ + // silently drop on the floor + return NS_OK; +} + +NS_IMETHODIMP +nsParentalControlsService::RequestURIOverride(nsIURI *aTarget, + nsIInterfaceRequestor *aWindowContext, + bool *_retval) +{ + return NS_ERROR_NOT_AVAILABLE; +} + +NS_IMETHODIMP +nsParentalControlsService::RequestURIOverrides(nsIArray *aTargets, + nsIInterfaceRequestor *aWindowContext, + bool *_retval) +{ + return NS_ERROR_NOT_AVAILABLE; +} + +NS_IMETHODIMP +nsParentalControlsService::IsAllowed(int16_t aAction, + nsIURI *aUri, + bool *_retval) +{ + return NS_ERROR_NOT_AVAILABLE; +} + diff --git a/toolkit/components/startup/moz.build b/toolkit/components/startup/moz.build index 7ee23d9ce8..b12fe9a534 100644 --- a/toolkit/components/startup/moz.build +++ b/toolkit/components/startup/moz.build @@ -7,7 +7,7 @@ DIRS += ['public'] EXPORTS.mozilla += ['StartupTimeline.h'] -SOURCES += [ +UNIFIED_SOURCES += [ 'nsAppStartup.cpp', 'StartupTimeline.cpp', ] @@ -16,7 +16,9 @@ if CONFIG['MOZ_USERINFO']: if CONFIG['OS_ARCH'] == 'WINNT': # This file cannot be built in unified mode because of name clashes with Windows headers. SOURCES += ['nsUserInfoWin.cpp'] + elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + UNIFIED_SOURCES += ['nsUserInfoMac.mm'] else: - SOURCES += ['nsUserInfoUnix.cpp'] + UNIFIED_SOURCES += ['nsUserInfoUnix.cpp'] FINAL_LIBRARY = 'xul' diff --git a/toolkit/components/startup/nsUserInfoMac.h b/toolkit/components/startup/nsUserInfoMac.h new file mode 100644 index 0000000000..822e0edd5d --- /dev/null +++ b/toolkit/components/startup/nsUserInfoMac.h @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 2; 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 __nsUserInfoMac_h +#define __nsUserInfoMac_h + +#include "nsIUserInfo.h" +#include "nsReadableUtils.h" + +class nsUserInfo: public nsIUserInfo +{ +public: + nsUserInfo(); + + NS_DECL_ISUPPORTS + NS_DECL_NSIUSERINFO + + nsresult GetPrimaryEmailAddress(nsCString &aEmailAddress); + +protected: + virtual ~nsUserInfo() {} +}; + +#endif /* __nsUserInfo_h */ diff --git a/toolkit/components/startup/nsUserInfoMac.mm b/toolkit/components/startup/nsUserInfoMac.mm new file mode 100644 index 0000000000..1895cf1773 --- /dev/null +++ b/toolkit/components/startup/nsUserInfoMac.mm @@ -0,0 +1,84 @@ +/* -*- Mode: Objective-C++; tab-width: 2; 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/. */ + + +#include "nsUserInfoMac.h" +#include "nsObjCExceptions.h" +#include "nsString.h" + +#import <Cocoa/Cocoa.h> +#import <AddressBook/AddressBook.h> + +NS_IMPL_ISUPPORTS(nsUserInfo, nsIUserInfo) + +nsUserInfo::nsUserInfo() {} + +NS_IMETHODIMP +nsUserInfo::GetFullname(char16_t **aFullname) +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT + + NS_ConvertUTF8toUTF16 fullName([NSFullUserName() UTF8String]); + *aFullname = ToNewUnicode(fullName); + return NS_OK; + + NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT +} + +NS_IMETHODIMP +nsUserInfo::GetUsername(char **aUsername) +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT + + nsAutoCString username([NSUserName() UTF8String]); + *aUsername = ToNewCString(username); + return NS_OK; + + NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT +} + +nsresult +nsUserInfo::GetPrimaryEmailAddress(nsCString &aEmailAddress) +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT + + // Try to get this user's primary email from the system addressbook's "me card" + // (if they've filled it) + ABPerson *me = [[ABAddressBook sharedAddressBook] me]; + ABMultiValue *emailAddresses = [me valueForProperty:kABEmailProperty]; + if ([emailAddresses count] > 0) { + // get the index of the primary email, in case there are more than one + int primaryEmailIndex = [emailAddresses indexForIdentifier:[emailAddresses primaryIdentifier]]; + aEmailAddress.Assign([[emailAddresses valueAtIndex:primaryEmailIndex] UTF8String]); + return NS_OK; + } + + return NS_ERROR_FAILURE; + + NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT +} + +NS_IMETHODIMP +nsUserInfo::GetEmailAddress(char **aEmailAddress) +{ + nsAutoCString email; + if (NS_SUCCEEDED(GetPrimaryEmailAddress(email))) + *aEmailAddress = ToNewCString(email); + return NS_OK; +} + +NS_IMETHODIMP +nsUserInfo::GetDomain(char **aDomain) +{ + nsAutoCString email; + if (NS_SUCCEEDED(GetPrimaryEmailAddress(email))) { + int32_t index = email.FindChar('@'); + if (index != -1) { + // chop off everything before, and including the '@' + *aDomain = ToNewCString(Substring(email, index + 1)); + } + } + return NS_OK; +} diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build index 81f07be661..c2f12b7763 100644 --- a/toolkit/library/moz.build +++ b/toolkit/library/moz.build @@ -12,8 +12,14 @@ def Libxul_defines(): @template def Libxul(name): - GeckoSharedLibrary(name, linkage=None) - SHARED_LIBRARY_NAME = 'xul' + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'): + # This is going to be a framework named "XUL", not an ordinary library named + # "libxul.dylib" + GeckoFramework(name, linkage=None) + SHARED_LIBRARY_NAME = 'XUL' + else: + GeckoSharedLibrary(name, linkage=None) + SHARED_LIBRARY_NAME = 'xul' DELAYLOAD_DLLS += [ 'comdlg32.dll', @@ -121,6 +127,9 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT'] or \ 'freetype', ] +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + CXXFLAGS += CONFIG['TK_CFLAGS'] + if CONFIG['MOZ_WEBRTC']: if CONFIG['OS_TARGET'] == 'WINNT': OS_LIBS += [ @@ -134,6 +143,19 @@ if CONFIG['MOZ_WEBRTC']: 'wininet', ] +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + OS_LIBS += [ + '-framework OpenGL', + '-framework SystemConfiguration', + '-framework AVFoundation', + '-framework CoreMedia', + '-framework IOKit', + '-F%s' % CONFIG['MACOS_PRIVATE_FRAMEWORKS_DIR'], + '-framework CoreUI', + '-framework CoreSymbolication', + 'cups', + ] + if CONFIG['MOZ_WMF']: OS_LIBS += [ 'mfuuid', @@ -191,6 +213,9 @@ if 'rtsp' in CONFIG['NECKO_PROTOCOLS']: OS_LIBS += CONFIG['ICONV_LIBS'] +if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'): + OS_LIBS += CONFIG['TK_LIBS'] + if CONFIG['MOZ_SNDIO']: OS_LIBS += [ 'sndio', @@ -276,11 +301,14 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': ] if CONFIG['COMPILE_ENVIRONMENT']: - full_libname = '%s%s%s' % ( - CONFIG['DLL_PREFIX'], - LIBRARY_NAME, - CONFIG['DLL_SUFFIX'] - ) + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('cocoa', 'uikit'): + full_libname = SHARED_LIBRARY_NAME + else: + full_libname = '%s%s%s' % ( + CONFIG['DLL_PREFIX'], + LIBRARY_NAME, + CONFIG['DLL_SUFFIX'] + ) GENERATED_FILES += ['dependentlibs.list'] GENERATED_FILES['dependentlibs.list'].script = 'dependentlibs.py:gen_list' GENERATED_FILES['dependentlibs.list'].inputs = [ diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build index e38b1b0b75..836fd66b36 100644 --- a/toolkit/modules/moz.build +++ b/toolkit/modules/moz.build @@ -94,7 +94,7 @@ EXTRA_PP_JS_MODULES += [ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3'): DEFINES['MENUBAR_CAN_AUTOHIDE'] = 1 -if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3'): +if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3', 'cocoa'): DEFINES['HAVE_SHELL_SERVICE'] = 1 EXTRA_PP_JS_MODULES += [ diff --git a/toolkit/moz.build b/toolkit/moz.build index 9bf579bb26..9e05b2a4fb 100644 --- a/toolkit/moz.build +++ b/toolkit/moz.build @@ -39,5 +39,7 @@ DIRS += ['xre'] if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'): DIRS += ['system/unixproxy'] +elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + DIRS += ['system/osxproxy'] elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': DIRS += ['system/windowsproxy'] diff --git a/toolkit/moz.configure b/toolkit/moz.configure index e3d3eca63d..643b4fbe34 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -48,7 +48,7 @@ set_config('L10NBASEDIR', l10n_base) # reason. option('--enable-default-toolkit', nargs=1, choices=('cairo-windows', 'cairo-gtk2', 'cairo-gtk2-x11', 'cairo-gtk3', - 'cairo-uikit'), + 'cairo-cocoa', 'cairo-uikit'), help='Select default toolkit') @depends('--enable-default-toolkit', target) @@ -58,6 +58,8 @@ def toolkit(value, target): os = target.os if target.os == 'WINNT': platform_choices = ('cairo-windows',) + elif target.os == 'OSX': + platform_choices = ('cairo-cocoa',) elif target.os == 'iOS': platform_choices = ('cairo-uikit',) else: @@ -180,7 +182,7 @@ option(env='MOZ_INSTRUMENT_EVENT_LOOP', @depends('MOZ_INSTRUMENT_EVENT_LOOP', toolkit) def instrument_event_loop(value, toolkit): - if value or (toolkit in ('windows', 'gtk2', 'gtk3') and value.origin == 'default'): + if value or (toolkit in ('windows', 'gtk2', 'gtk3', 'cocoa') and value.origin == 'default'): return True set_config('MOZ_INSTRUMENT_EVENT_LOOP', instrument_event_loop) @@ -266,7 +268,7 @@ add_old_configure_assignment('FT2_CFLAGS', # ============================================================== @depends(toolkit) def applemedia(toolkit): - if toolkit in ('uikit'): + if toolkit in ('cocoa', 'uikit'): return True set_config('MOZ_APPLEMEDIA', applemedia) diff --git a/toolkit/mozapps/update/updater/Makefile.in b/toolkit/mozapps/update/updater/Makefile.in index c1cfcead7e..84a843d185 100644 --- a/toolkit/mozapps/update/updater/Makefile.in +++ b/toolkit/mozapps/update/updater/Makefile.in @@ -14,3 +14,16 @@ endif endif include $(topsrcdir)/config/rules.mk + +ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) +export:: + sed -e 's/%MOZ_MACBUNDLE_ID%/$(MOZ_MACBUNDLE_ID)/' $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/bin/Info.plist +libs:: + $(NSINSTALL) -D $(DIST)/bin/updater.app + rsync -a -C --exclude '*.in' $(srcdir)/macbuild/Contents $(DIST)/bin/updater.app + rsync -a -C $(DIST)/bin/Info.plist $(DIST)/bin/updater.app/Contents + sed -e 's/%APP_NAME%/$(MOZ_APP_DISPLAYNAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | \ + iconv -f UTF-8 -t UTF-16 > $(DIST)/bin/updater.app/Contents/Resources/English.lproj/InfoPlist.strings + $(NSINSTALL) -D $(DIST)/bin/updater.app/Contents/MacOS + $(NSINSTALL) $(DIST)/bin/org.mozilla.updater $(DIST)/bin/updater.app/Contents/MacOS +endif diff --git a/toolkit/mozapps/update/updater/launchchild_osx.mm b/toolkit/mozapps/update/updater/launchchild_osx.mm new file mode 100644 index 0000000000..5a36ae6237 --- /dev/null +++ b/toolkit/mozapps/update/updater/launchchild_osx.mm @@ -0,0 +1,384 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* 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/. */ + +#include <Cocoa/Cocoa.h> +#include <CoreServices/CoreServices.h> +#include <crt_externs.h> +#include <stdlib.h> +#include <stdio.h> +#include <spawn.h> +#include <SystemConfiguration/SystemConfiguration.h> +#include "readstrings.h" + +class MacAutoreleasePool { +public: + MacAutoreleasePool() + { + mPool = [[NSAutoreleasePool alloc] init]; + } + ~MacAutoreleasePool() + { + [mPool release]; + } + +private: + NSAutoreleasePool* mPool; +}; + +void LaunchChild(int argc, const char** argv) +{ + MacAutoreleasePool pool; + + @try { + NSString* launchPath = [NSString stringWithUTF8String:argv[0]]; + NSMutableArray* arguments = [NSMutableArray arrayWithCapacity:argc - 1]; + for (int i = 1; i < argc; i++) { + [arguments addObject:[NSString stringWithUTF8String:argv[i]]]; + } + [NSTask launchedTaskWithLaunchPath:launchPath + arguments:arguments]; + } @catch (NSException* e) { + NSLog(@"%@: %@", e.name, e.reason); + } +} + +void +LaunchMacPostProcess(const char* aAppBundle) +{ + MacAutoreleasePool pool; + + // Launch helper to perform post processing for the update; this is the Mac + // analogue of LaunchWinPostProcess (PostUpdateWin). + NSString* iniPath = [NSString stringWithUTF8String:aAppBundle]; + iniPath = + [iniPath stringByAppendingPathComponent:@"Contents/Resources/updater.ini"]; + + NSFileManager* fileManager = [NSFileManager defaultManager]; + if (![fileManager fileExistsAtPath:iniPath]) { + // the file does not exist; there is nothing to run + return; + } + + int readResult; + char values[2][MAX_TEXT_LEN]; + readResult = ReadStrings([iniPath UTF8String], + "ExeRelPath\0ExeArg\0", + 2, + values, + "PostUpdateMac"); + if (readResult) { + return; + } + + NSString *exeRelPath = [NSString stringWithUTF8String:values[0]]; + NSString *exeArg = [NSString stringWithUTF8String:values[1]]; + if (!exeArg || !exeRelPath) { + return; + } + + // The path must not traverse directories and it must be a relative path. + if ([exeRelPath rangeOfString:@".."].location != NSNotFound || + [exeRelPath rangeOfString:@"./"].location != NSNotFound || + [exeRelPath rangeOfString:@"/"].location == 0) { + return; + } + + NSString* exeFullPath = [NSString stringWithUTF8String:aAppBundle]; + exeFullPath = [exeFullPath stringByAppendingPathComponent:exeRelPath]; + + char optVals[1][MAX_TEXT_LEN]; + readResult = ReadStrings([iniPath UTF8String], + "ExeAsync\0", + 1, + optVals, + "PostUpdateMac"); + + NSTask *task = [[NSTask alloc] init]; + [task setLaunchPath:exeFullPath]; + [task setArguments:[NSArray arrayWithObject:exeArg]]; + [task launch]; + if (!readResult) { + NSString *exeAsync = [NSString stringWithUTF8String:optVals[0]]; + if ([exeAsync isEqualToString:@"false"]) { + [task waitUntilExit]; + } + } + // ignore the return value of the task, there's nothing we can do with it + [task release]; +} + +id ConnectToUpdateServer() +{ + MacAutoreleasePool pool; + + id updateServer = nil; + BOOL isConnected = NO; + int currTry = 0; + const int numRetries = 10; // Number of IPC connection retries before + // giving up. + while (!isConnected && currTry < numRetries) { + @try { + updateServer = (id)[NSConnection + rootProxyForConnectionWithRegisteredName: + @"org.mozilla.updater.server" + host:nil + usingNameServer:[NSSocketPortNameServer sharedInstance]]; + if (!updateServer || + ![updateServer respondsToSelector:@selector(abort)] || + ![updateServer respondsToSelector:@selector(getArguments)] || + ![updateServer respondsToSelector:@selector(shutdown)]) { + NSLog(@"Server doesn't exist or doesn't provide correct selectors."); + sleep(1); // Wait 1 second. + currTry++; + } else { + isConnected = YES; + } + } @catch (NSException* e) { + NSLog(@"Encountered exception, retrying: %@: %@", e.name, e.reason); + sleep(1); // Wait 1 second. + currTry++; + } + } + if (!isConnected) { + NSLog(@"Failed to connect to update server after several retries."); + return nil; + } + return updateServer; +} + +void CleanupElevatedMacUpdate(bool aFailureOccurred) +{ + MacAutoreleasePool pool; + + id updateServer = ConnectToUpdateServer(); + if (updateServer) { + @try { + if (aFailureOccurred) { + [updateServer performSelector:@selector(abort)]; + } else { + [updateServer performSelector:@selector(shutdown)]; + } + } @catch (NSException* e) { } + } + + NSFileManager* manager = [NSFileManager defaultManager]; + [manager removeItemAtPath:@"/Library/PrivilegedHelperTools/org.mozilla.updater" + error:nil]; + [manager removeItemAtPath:@"/Library/LaunchDaemons/org.mozilla.updater.plist" + error:nil]; + const char* launchctlArgs[] = {"/bin/launchctl", + "remove", + "org.mozilla.updater"}; + // The following call will terminate the current process due to the "remove" + // argument in launchctlArgs. + LaunchChild(3, launchctlArgs); +} + +// Note: Caller is responsible for freeing argv. +bool ObtainUpdaterArguments(int* argc, char*** argv) +{ + MacAutoreleasePool pool; + + id updateServer = ConnectToUpdateServer(); + if (!updateServer) { + // Let's try our best and clean up. + CleanupElevatedMacUpdate(true); + return false; // Won't actually get here due to CleanupElevatedMacUpdate. + } + + @try { + NSArray* updaterArguments = + [updateServer performSelector:@selector(getArguments)]; + *argc = [updaterArguments count]; + char** tempArgv = (char**)malloc(sizeof(char*) * (*argc)); + for (int i = 0; i < *argc; i++) { + int argLen = [[updaterArguments objectAtIndex:i] length] + 1; + tempArgv[i] = (char*)malloc(argLen); + strncpy(tempArgv[i], [[updaterArguments objectAtIndex:i] UTF8String], + argLen); + } + *argv = tempArgv; + } @catch (NSException* e) { + // Let's try our best and clean up. + CleanupElevatedMacUpdate(true); + return false; // Won't actually get here due to CleanupElevatedMacUpdate. + } + return true; +} + +/** + * The ElevatedUpdateServer is launched from a non-elevated updater process. + * It allows an elevated updater process (usually a privileged helper tool) to + * connect to it and receive all the necessary arguments to complete a + * successful update. + */ +@interface ElevatedUpdateServer : NSObject +{ + NSArray* mUpdaterArguments; + BOOL mShouldKeepRunning; + BOOL mAborted; +} +- (id)initWithArgs:(NSArray*)args; +- (BOOL)runServer; +- (NSArray*)getArguments; +- (void)abort; +- (BOOL)wasAborted; +- (void)shutdown; +- (BOOL)shouldKeepRunning; +@end + +@implementation ElevatedUpdateServer + +- (id)initWithArgs:(NSArray*)args +{ + self = [super init]; + if (!self) { + return nil; + } + mUpdaterArguments = args; + mShouldKeepRunning = YES; + mAborted = NO; + return self; +} + +- (BOOL)runServer +{ + NSPort* serverPort = [NSSocketPort port]; + NSConnection* server = [NSConnection connectionWithReceivePort:serverPort + sendPort:serverPort]; + [server setRootObject:self]; + if ([server registerName:@"org.mozilla.updater.server" + withNameServer:[NSSocketPortNameServer sharedInstance]] == NO) { + NSLog(@"Unable to register as DirectoryServer."); + NSLog(@"Is another copy running?"); + return NO; + } + + while ([self shouldKeepRunning] && + [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode + beforeDate:[NSDate distantFuture]]); + return ![self wasAborted]; +} + +- (NSArray*)getArguments +{ + return mUpdaterArguments; +} + +- (void)abort +{ + mAborted = YES; + [self shutdown]; +} + +- (BOOL)wasAborted +{ + return mAborted; +} + +- (void)shutdown +{ + mShouldKeepRunning = NO; +} + +- (BOOL)shouldKeepRunning +{ + return mShouldKeepRunning; +} + +@end + +bool ServeElevatedUpdate(int argc, const char** argv) +{ + MacAutoreleasePool pool; + + NSMutableArray* updaterArguments = [NSMutableArray arrayWithCapacity:argc]; + for (int i = 0; i < argc; i++) { + [updaterArguments addObject:[NSString stringWithUTF8String:argv[i]]]; + } + + ElevatedUpdateServer* updater = + [[ElevatedUpdateServer alloc] initWithArgs:[updaterArguments copy]]; + bool didSucceed = [updater runServer]; + + [updater release]; + return didSucceed; +} + +bool IsOwnedByGroupAdmin(const char* aAppBundle) +{ + MacAutoreleasePool pool; + + NSString* appDir = [NSString stringWithUTF8String:aAppBundle]; + NSFileManager* fileManager = [NSFileManager defaultManager]; + + NSDictionary* attributes = [fileManager attributesOfItemAtPath:appDir + error:nil]; + bool isOwnedByAdmin = false; + if (attributes && + [[attributes valueForKey:NSFileGroupOwnerAccountID] intValue] == 80) { + isOwnedByAdmin = true; + } + return isOwnedByAdmin; +} + +void SetGroupOwnershipAndPermissions(const char* aAppBundle) +{ + MacAutoreleasePool pool; + + NSString* appDir = [NSString stringWithUTF8String:aAppBundle]; + NSFileManager* fileManager = [NSFileManager defaultManager]; + NSError* error = nil; + NSArray* paths = + [fileManager subpathsOfDirectoryAtPath:appDir + error:&error]; + if (error) { + return; + } + + // Set group ownership of Firefox.app to 80 ("admin") and permissions to + // 0775. + if (![fileManager setAttributes:@{ NSFileGroupOwnerAccountID: @(80), + NSFilePosixPermissions: @(0775) } + ofItemAtPath:appDir + error:&error] || error) { + return; + } + + NSArray* permKeys = [NSArray arrayWithObjects:NSFileGroupOwnerAccountID, + NSFilePosixPermissions, + nil]; + // For all descendants of Firefox.app, set group ownership to 80 ("admin") and + // ensure write permission for the group. + for (NSString* currPath in paths) { + NSString* child = [appDir stringByAppendingPathComponent:currPath]; + NSDictionary* oldAttributes = + [fileManager attributesOfItemAtPath:child + error:&error]; + if (error) { + return; + } + // Skip symlinks, since they could be pointing to files outside of the .app + // bundle. + if ([oldAttributes fileType] == NSFileTypeSymbolicLink) { + continue; + } + NSNumber* oldPerms = + (NSNumber*)[oldAttributes valueForKey:NSFilePosixPermissions]; + NSArray* permObjects = + [NSArray arrayWithObjects: + [NSNumber numberWithUnsignedLong:80], + [NSNumber numberWithUnsignedLong:[oldPerms shortValue] | 020], + nil]; + NSDictionary* attributes = [NSDictionary dictionaryWithObjects:permObjects + forKeys:permKeys]; + if (![fileManager setAttributes:attributes + ofItemAtPath:child + error:&error] || error) { + return; + } + } +} diff --git a/toolkit/mozapps/update/updater/macbuild/Contents/Info.plist.in b/toolkit/mozapps/update/updater/macbuild/Contents/Info.plist.in new file mode 100644 index 0000000000..a9b9fcba9d --- /dev/null +++ b/toolkit/mozapps/update/updater/macbuild/Contents/Info.plist.in @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>org.mozilla.updater</string> + <key>CFBundleIconFile</key> + <string>updater.icns</string> + <key>CFBundleIdentifier</key> + <string>org.mozilla.updater</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>1.0</string> + <key>NSMainNibFile</key> + <string>MainMenu</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> + <key>LSMinimumSystemVersion</key> + <string>10.5</string> + <key>LSMinimumSystemVersionByArchitecture</key> + <dict> + <key>i386</key> + <string>10.5.0</string> + <key>x86_64</key> + <string>10.6.0</string> + </dict> + <key>SMAuthorizedClients</key> + <array> + <string>identifier "%MOZ_MACBUNDLE_ID%" and ((anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]) or (anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] and certificate leaf[field.1.2.840.113635.100.6.1.13] and certificate leaf[subject.OU] = "43AQ936H96"))</string> + </array> +</dict> +</plist> diff --git a/toolkit/mozapps/update/updater/macbuild/Contents/PkgInfo b/toolkit/mozapps/update/updater/macbuild/Contents/PkgInfo new file mode 100644 index 0000000000..bd04210fb4 --- /dev/null +++ b/toolkit/mozapps/update/updater/macbuild/Contents/PkgInfo @@ -0,0 +1 @@ +APPL????
\ No newline at end of file diff --git a/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in b/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in new file mode 100644 index 0000000000..bca4022e75 --- /dev/null +++ b/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in @@ -0,0 +1,7 @@ +/* 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/. */ + +/* Localized versions of Info.plist keys */ + +CFBundleName = "%APP_NAME% Software Update"; diff --git a/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/classes.nib b/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/classes.nib new file mode 100644 index 0000000000..6cfb50406b --- /dev/null +++ b/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/classes.nib @@ -0,0 +1,19 @@ +{ + IBClasses = ( + { + CLASS = FirstResponder; + LANGUAGE = ObjC; + SUPERCLASS = NSObject; +}, + { + CLASS = UpdaterUI; + LANGUAGE = ObjC; + OUTLETS = { + progressBar = NSProgressIndicator; + progressTextField = NSTextField; + }; + SUPERCLASS = NSObject; +} + ); + IBVersion = 1; +}
\ No newline at end of file diff --git a/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/info.nib b/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/info.nib new file mode 100644 index 0000000000..1509178370 --- /dev/null +++ b/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/info.nib @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>IBDocumentLocation</key> + <string>111 162 356 240 0 0 1440 878 </string> + <key>IBEditorPositions</key> + <dict> + <key>29</key> + <string>106 299 84 44 0 0 1440 878 </string> + </dict> + <key>IBFramework Version</key> + <string>489.0</string> + <key>IBOpenObjects</key> + <array> + <integer>21</integer> + <integer>29</integer> + </array> + <key>IBSystem Version</key> + <string>10J567</string> +</dict> +</plist> diff --git a/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib b/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib Binary files differnew file mode 100644 index 0000000000..61ff026009 --- /dev/null +++ b/toolkit/mozapps/update/updater/macbuild/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib diff --git a/toolkit/mozapps/update/updater/macbuild/Contents/Resources/updater.icns b/toolkit/mozapps/update/updater/macbuild/Contents/Resources/updater.icns Binary files differnew file mode 100644 index 0000000000..d7499c6692 --- /dev/null +++ b/toolkit/mozapps/update/updater/macbuild/Contents/Resources/updater.icns diff --git a/toolkit/mozapps/update/updater/moz.build b/toolkit/mozapps/update/updater/moz.build index 6cf377afef..4dc557ea34 100644 --- a/toolkit/mozapps/update/updater/moz.build +++ b/toolkit/mozapps/update/updater/moz.build @@ -3,13 +3,26 @@ # 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/. -Program('updater') +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + Program('org.mozilla.updater') +else: + Program('updater') updater_rel_path = '' include('updater-common.build') CXXFLAGS += CONFIG['MOZ_BZ2_CFLAGS'] +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + LDFLAGS += ['-sectcreate', + '__TEXT', + '__info_plist', + TOPOBJDIR + '/dist/bin/Info.plist', + '-sectcreate', + '__TEXT', + '__launchd_plist', + SRCDIR + '/Launchd.plist'] + GENERATED_FILES = [ 'primaryCert.h', 'secondaryCert.h', diff --git a/toolkit/mozapps/update/updater/progressui_osx.mm b/toolkit/mozapps/update/updater/progressui_osx.mm new file mode 100644 index 0000000000..54c9c41b72 --- /dev/null +++ b/toolkit/mozapps/update/updater/progressui_osx.mm @@ -0,0 +1,144 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* 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/. */ + +#import <Cocoa/Cocoa.h> +#include <stdio.h> +#include <unistd.h> +#include "mozilla/Sprintf.h" +#include "progressui.h" +#include "readstrings.h" +#include "errors.h" + +#define TIMER_INTERVAL 0.2 + +static float sProgressVal; // between 0 and 100 +static BOOL sQuit = NO; +static BOOL sIndeterminate = NO; +static StringTable sLabels; +static const char *sUpdatePath; + +@interface UpdaterUI : NSObject +{ + IBOutlet NSProgressIndicator *progressBar; + IBOutlet NSTextField *progressTextField; +} +@end + +@implementation UpdaterUI + +-(void)awakeFromNib +{ + NSWindow *w = [progressBar window]; + + [w setTitle:[NSString stringWithUTF8String:sLabels.title]]; + [progressTextField setStringValue:[NSString stringWithUTF8String:sLabels.info]]; + + NSRect origTextFrame = [progressTextField frame]; + [progressTextField sizeToFit]; + + int widthAdjust = progressTextField.frame.size.width - origTextFrame.size.width; + + if (widthAdjust > 0) { + NSRect f; + f.size.width = w.frame.size.width + widthAdjust; + f.size.height = w.frame.size.height; + [w setFrame:f display:YES]; + } + + [w center]; + + [progressBar setIndeterminate:sIndeterminate]; + [progressBar setDoubleValue:0.0]; + + [[NSTimer scheduledTimerWithTimeInterval:TIMER_INTERVAL target:self + selector:@selector(updateProgressUI:) + userInfo:nil repeats:YES] retain]; + + // Make sure we are on top initially + [NSApp activateIgnoringOtherApps:YES]; +} + +// called when the timer goes off +-(void)updateProgressUI:(NSTimer *)aTimer +{ + if (sQuit) { + [aTimer invalidate]; + [aTimer release]; + + // It seems to be necessary to activate and hide ourselves before we stop, + // otherwise the "run" method will not return until the user focuses some + // other app. The activate step is necessary if we are not the active app. + // This is a big hack, but it seems to do the trick. + [NSApp activateIgnoringOtherApps:YES]; + [NSApp hide:self]; + [NSApp stop:self]; + } + + float progress = sProgressVal; + + [progressBar setDoubleValue:(double)progress]; +} + +// leave this as returning a BOOL instead of NSApplicationTerminateReply +// for backward compatibility +- (BOOL)applicationShouldTerminate:(NSApplication *)sender +{ + return sQuit; +} + +@end + +int +InitProgressUI(int *pargc, char ***pargv) +{ + sUpdatePath = (*pargv)[1]; + + return 0; +} + +int +ShowProgressUI(bool indeterminate) +{ + // Only show the Progress UI if the process is taking a significant amount of + // time where a significant amount of time is defined as .5 seconds after + // ShowProgressUI is called sProgress is less than 70. + usleep(500000); + + if (sQuit || sProgressVal > 70.0f) + return 0; + + char path[PATH_MAX]; + SprintfLiteral(path, "%s/updater.ini", sUpdatePath); + if (ReadStrings(path, &sLabels) != OK) + return -1; + + // Continue the update without showing the Progress UI if any of the supplied + // strings are larger than MAX_TEXT_LEN (Bug 628829). + if (!(strlen(sLabels.title) < MAX_TEXT_LEN - 1 && + strlen(sLabels.info) < MAX_TEXT_LEN - 1)) + return -1; + + sIndeterminate = indeterminate; + [NSApplication sharedApplication]; + [NSBundle loadNibNamed:@"MainMenu" owner:NSApp]; + [NSApp run]; + + return 0; +} + +// Called on a background thread +void +QuitProgressUI() +{ + sQuit = YES; +} + +// Called on a background thread +void +UpdateProgressUI(float progress) +{ + sProgressVal = progress; // 32-bit writes are atomic +} diff --git a/toolkit/mozapps/update/updater/updater-common.build b/toolkit/mozapps/update/updater/updater-common.build index 1ace8fcc71..ce4a219001 100644 --- a/toolkit/mozapps/update/updater/updater-common.build +++ b/toolkit/mozapps/update/updater/updater-common.build @@ -73,6 +73,24 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: 'progressui_gtk.cpp', ] +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + have_progressui = 1 + srcs += [ + 'launchchild_osx.mm', + 'progressui_osx.mm', + ] + OS_LIBS += [ + '-framework Cocoa', + '-framework Security', + '-framework SystemConfiguration', + ] + UNIFIED_SOURCES += [ + '/toolkit/xre/updaterfileutils_osx.mm', + ] + LOCAL_INCLUDES += [ + '/toolkit/xre', + ] + if have_progressui == 0: srcs += [ 'progressui_null.cpp', diff --git a/toolkit/system/osxproxy/ProxyUtils.h b/toolkit/system/osxproxy/ProxyUtils.h new file mode 100644 index 0000000000..d6e5ddbd45 --- /dev/null +++ b/toolkit/system/osxproxy/ProxyUtils.h @@ -0,0 +1,21 @@ +/* -*- Mode: C++; tab-width: 2; 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 mozilla_toolkit_system_osxproxy_ProxyUtils_h +#define mozilla_toolkit_system_osxproxy_ProxyUtils_h + +#include "nsStringGlue.h" + +namespace mozilla { +namespace toolkit { +namespace system { + +bool IsHostProxyEntry(const nsACString& aHost, const nsACString& aOverride); + +} // namespace system +} // namespace toolkit +} // namespace mozilla + +#endif // mozilla_toolkit_system_osxproxy_ProxyUtils_h diff --git a/toolkit/system/osxproxy/ProxyUtils.mm b/toolkit/system/osxproxy/ProxyUtils.mm new file mode 100644 index 0000000000..4e59f226a0 --- /dev/null +++ b/toolkit/system/osxproxy/ProxyUtils.mm @@ -0,0 +1,182 @@ +/* -*- Mode: C++; tab-width: 2; 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/. */ + +#include "ProxyUtils.h" +#include "nsTArray.h" +#include "prnetdb.h" +#include "prtypes.h" + +namespace mozilla { +namespace toolkit { +namespace system { + +/** + * Normalize the short IP form into the complete form. + * For example, it converts "192.168" into "192.168.0.0" + */ +static bool +NormalizeAddr(const nsACString& aAddr, nsCString& aNormalized) +{ + nsTArray<nsCString> addr; + if (!ParseString(aAddr, '.', addr)) { + return false; + } + aNormalized = ""; + for (uint32_t i = 0; i < 4; ++i) { + if (i != 0) { + aNormalized.Append("."); + } + if (i < addr.Length()) { + aNormalized.Append(addr[i]); + } else { + aNormalized.Append("0"); + } + } + return true; +} + +static PRUint32 +MaskIPv4Addr(PRUint32 aAddr, uint16_t aMaskLen) +{ + if (aMaskLen == 32) { + return aAddr; + } + return PR_htonl(PR_ntohl(aAddr) & (~0L << (32 - aMaskLen))); +} + +static void +MaskIPv6Addr(PRIPv6Addr& aAddr, uint16_t aMaskLen) +{ + if (aMaskLen == 128) { + return; + } + + if (aMaskLen > 96) { + aAddr.pr_s6_addr32[3] = PR_htonl( + PR_ntohl(aAddr.pr_s6_addr32[3]) & (~0L << (128 - aMaskLen))); + } else if (aMaskLen > 64) { + aAddr.pr_s6_addr32[3] = 0; + aAddr.pr_s6_addr32[2] = PR_htonl( + PR_ntohl(aAddr.pr_s6_addr32[2]) & (~0L << (96 - aMaskLen))); + } else if (aMaskLen > 32) { + aAddr.pr_s6_addr32[3] = 0; + aAddr.pr_s6_addr32[2] = 0; + aAddr.pr_s6_addr32[1] = PR_htonl( + PR_ntohl(aAddr.pr_s6_addr32[1]) & (~0L << (64 - aMaskLen))); + } else { + aAddr.pr_s6_addr32[3] = 0; + aAddr.pr_s6_addr32[2] = 0; + aAddr.pr_s6_addr32[1] = 0; + aAddr.pr_s6_addr32[0] = PR_htonl( + PR_ntohl(aAddr.pr_s6_addr32[0]) & (~0L << (32 - aMaskLen))); + } + + return; +} + +static bool +IsMatchMask(const nsACString& aHost, const nsACString& aOverride) +{ + nsresult rv; + + auto tokenEnd = aOverride.FindChar('/'); + if (tokenEnd == -1) { + return false; + } + + nsAutoCString prefixStr(Substring(aOverride, + tokenEnd + 1, + aOverride.Length() - tokenEnd - 1)); + auto maskLen = prefixStr.ToInteger(&rv); + if (NS_WARN_IF(NS_FAILED(rv))) { + return false; + } + + nsAutoCString override(aOverride); + if (!NormalizeAddr(Substring(aOverride, 0, tokenEnd), override)) { + return false; + } + + PRNetAddr prAddrHost; + PRNetAddr prAddrOverride; + if (PR_SUCCESS != PR_StringToNetAddr(PromiseFlatCString(aHost).get(), + &prAddrHost) || + PR_SUCCESS != PR_StringToNetAddr(override.get(), + &prAddrOverride)) { + return false; + } + + if (prAddrHost.raw.family == PR_AF_INET && + prAddrOverride.raw.family == PR_AF_INET) { + return MaskIPv4Addr(prAddrHost.inet.ip, maskLen) == + MaskIPv4Addr(prAddrOverride.inet.ip, maskLen); + } + else if (prAddrHost.raw.family == PR_AF_INET6 && + prAddrOverride.raw.family == PR_AF_INET6) { + MaskIPv6Addr(prAddrHost.ipv6.ip, maskLen); + MaskIPv6Addr(prAddrOverride.ipv6.ip, maskLen); + + return memcmp(&prAddrHost.ipv6.ip, + &prAddrOverride.ipv6.ip, + sizeof(PRIPv6Addr)) == 0; + } + + return false; +} + +static bool +IsMatchWildcard(const nsACString& aHost, const nsACString& aOverride) +{ + nsAutoCString host(aHost); + nsAutoCString override(aOverride); + + int32_t overrideLength = override.Length(); + int32_t tokenStart = 0; + int32_t offset = 0; + bool star = false; + + while (tokenStart < overrideLength) { + int32_t tokenEnd = override.FindChar('*', tokenStart); + if (tokenEnd == tokenStart) { + // Star is the first character in the token. + star = true; + tokenStart++; + // If the character following the '*' is a '.' character then skip + // it so that "*.foo.com" allows "foo.com". + if (override.FindChar('.', tokenStart) == tokenStart) { + nsAutoCString token(Substring(override, + tokenStart + 1, + overrideLength - tokenStart - 1)); + if (host.Equals(token)) { + return true; + } + } + } else { + if (tokenEnd == -1) { + tokenEnd = overrideLength; // no '*' char, match rest of string + } + nsAutoCString token(Substring(override, tokenStart, tokenEnd - tokenStart)); + offset = host.Find(token, offset); + if (offset == -1 || (!star && offset)) { + return false; + } + star = false; + tokenStart = tokenEnd; + offset += token.Length(); + } + } + + return (star || (offset == static_cast<int32_t>(host.Length()))); +} + +bool +IsHostProxyEntry(const nsACString& aHost, const nsACString& aOverride) +{ + return IsMatchMask(aHost, aOverride) || IsMatchWildcard(aHost, aOverride); +} + +} // namespace system +} // namespace toolkit +} // namespace mozilla diff --git a/toolkit/system/osxproxy/moz.build b/toolkit/system/osxproxy/moz.build new file mode 100644 index 0000000000..64a01ce6b8 --- /dev/null +++ b/toolkit/system/osxproxy/moz.build @@ -0,0 +1,13 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# 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/. + +TEST_DIRS += ['tests/gtest'] + +SOURCES += [ + 'nsOSXSystemProxySettings.mm', + 'ProxyUtils.mm', +] + +FINAL_LIBRARY = 'xul' diff --git a/toolkit/system/osxproxy/nsOSXSystemProxySettings.mm b/toolkit/system/osxproxy/nsOSXSystemProxySettings.mm new file mode 100644 index 0000000000..77fd2e482c --- /dev/null +++ b/toolkit/system/osxproxy/nsOSXSystemProxySettings.mm @@ -0,0 +1,326 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et: */ +/* 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/. */ + +#import <Cocoa/Cocoa.h> +#import <SystemConfiguration/SystemConfiguration.h> + +#include "nsISystemProxySettings.h" +#include "mozilla/ModuleUtils.h" +#include "nsIServiceManager.h" +#include "nsPrintfCString.h" +#include "nsNetCID.h" +#include "nsISupportsPrimitives.h" +#include "nsIURI.h" +#include "nsObjCExceptions.h" +#include "mozilla/Attributes.h" +#include "ProxyUtils.h" + +class nsOSXSystemProxySettings final : public nsISystemProxySettings { +public: + NS_DECL_THREADSAFE_ISUPPORTS + NS_DECL_NSISYSTEMPROXYSETTINGS + + nsOSXSystemProxySettings(); + nsresult Init(); + + // called by OSX when the proxy settings have changed + void ProxyHasChanged(); + + // is there a PAC url specified in the system configuration + bool IsAutoconfigEnabled() const; + // retrieve the pac url + nsresult GetAutoconfigURL(nsAutoCString& aResult) const; + + // Find the SystemConfiguration proxy & port for a given URI + nsresult FindSCProxyPort(const nsACString &aScheme, nsACString& aResultHost, int32_t& aResultPort, bool& aResultSocksProxy); + + // is host:port on the proxy exception list? + bool IsInExceptionList(const nsACString& aHost) const; + +private: + ~nsOSXSystemProxySettings(); + + SCDynamicStoreContext mContext; + SCDynamicStoreRef mSystemDynamicStore; + NSDictionary* mProxyDict; + + + // Mapping of URI schemes to SystemConfiguration keys + struct SchemeMapping { + const char* mScheme; + CFStringRef mEnabled; + CFStringRef mHost; + CFStringRef mPort; + bool mIsSocksProxy; + }; + static const SchemeMapping gSchemeMappingList[]; +}; + +NS_IMPL_ISUPPORTS(nsOSXSystemProxySettings, nsISystemProxySettings) + +NS_IMETHODIMP +nsOSXSystemProxySettings::GetMainThreadOnly(bool *aMainThreadOnly) +{ + *aMainThreadOnly = true; + return NS_OK; +} + +// Mapping of URI schemes to SystemConfiguration keys +const nsOSXSystemProxySettings::SchemeMapping nsOSXSystemProxySettings::gSchemeMappingList[] = { + {"http", kSCPropNetProxiesHTTPEnable, kSCPropNetProxiesHTTPProxy, kSCPropNetProxiesHTTPPort, false}, + {"https", kSCPropNetProxiesHTTPSEnable, kSCPropNetProxiesHTTPSProxy, kSCPropNetProxiesHTTPSPort, false}, + {"ftp", kSCPropNetProxiesFTPEnable, kSCPropNetProxiesFTPProxy, kSCPropNetProxiesFTPPort, false}, + {"socks", kSCPropNetProxiesSOCKSEnable, kSCPropNetProxiesSOCKSProxy, kSCPropNetProxiesSOCKSPort, true}, + {NULL, NULL, NULL, NULL, false}, +}; + +static void +ProxyHasChangedWrapper(SCDynamicStoreRef aStore, CFArrayRef aChangedKeys, void* aInfo) +{ + static_cast<nsOSXSystemProxySettings*>(aInfo)->ProxyHasChanged(); +} + + +nsOSXSystemProxySettings::nsOSXSystemProxySettings() + : mSystemDynamicStore(NULL), mProxyDict(NULL) +{ + mContext = (SCDynamicStoreContext){0, this, NULL, NULL, NULL}; +} + +nsresult +nsOSXSystemProxySettings::Init() +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; + + // Register for notification of proxy setting changes + // See: http://developer.apple.com/documentation/Networking/Conceptual/CFNetwork/CFStreamTasks/chapter_4_section_5.html + mSystemDynamicStore = SCDynamicStoreCreate(NULL, CFSTR("Mozilla"), ProxyHasChangedWrapper, &mContext); + if (!mSystemDynamicStore) + return NS_ERROR_FAILURE; + + // Set up the store to monitor any changes to the proxies + CFStringRef proxiesKey = SCDynamicStoreKeyCreateProxies(NULL); + if (!proxiesKey) + return NS_ERROR_FAILURE; + + CFArrayRef keyArray = CFArrayCreate(NULL, (const void**)(&proxiesKey), 1, &kCFTypeArrayCallBacks); + CFRelease(proxiesKey); + if (!keyArray) + return NS_ERROR_FAILURE; + + SCDynamicStoreSetNotificationKeys(mSystemDynamicStore, keyArray, NULL); + CFRelease(keyArray); + + // Add the dynamic store to the run loop + CFRunLoopSourceRef storeRLSource = SCDynamicStoreCreateRunLoopSource(NULL, mSystemDynamicStore, 0); + if (!storeRLSource) + return NS_ERROR_FAILURE; + CFRunLoopAddSource(CFRunLoopGetCurrent(), storeRLSource, kCFRunLoopCommonModes); + CFRelease(storeRLSource); + + // Load the initial copy of proxy info + mProxyDict = (NSDictionary*)SCDynamicStoreCopyProxies(mSystemDynamicStore); + if (!mProxyDict) + return NS_ERROR_FAILURE; + + return NS_OK; + + NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; +} + +nsOSXSystemProxySettings::~nsOSXSystemProxySettings() +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK; + + [mProxyDict release]; + + if (mSystemDynamicStore) { + // Invalidate the dynamic store's run loop source + // to get the store out of the run loop + CFRunLoopSourceRef rls = SCDynamicStoreCreateRunLoopSource(NULL, mSystemDynamicStore, 0); + if (rls) { + CFRunLoopSourceInvalidate(rls); + CFRelease(rls); + } + CFRelease(mSystemDynamicStore); + } + + NS_OBJC_END_TRY_ABORT_BLOCK; +} + + +void +nsOSXSystemProxySettings::ProxyHasChanged() +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK; + + [mProxyDict release]; + mProxyDict = (NSDictionary*)SCDynamicStoreCopyProxies(mSystemDynamicStore); + + NS_OBJC_END_TRY_ABORT_BLOCK; +} + +nsresult +nsOSXSystemProxySettings::FindSCProxyPort(const nsACString &aScheme, nsACString& aResultHost, int32_t& aResultPort, bool& aResultSocksProxy) +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; + + NS_ENSURE_TRUE(mProxyDict != NULL, NS_ERROR_FAILURE); + + for (const SchemeMapping* keys = gSchemeMappingList; keys->mScheme != NULL; ++keys) { + // Check for matching scheme (when appropriate) + if (strcasecmp(keys->mScheme, PromiseFlatCString(aScheme).get()) && + !keys->mIsSocksProxy) + continue; + + // Check the proxy is enabled + NSNumber* enabled = [mProxyDict objectForKey:(NSString*)keys->mEnabled]; + NS_ENSURE_TRUE(enabled == NULL || [enabled isKindOfClass:[NSNumber class]], NS_ERROR_FAILURE); + if ([enabled intValue] == 0) + continue; + + // Get the proxy host + NSString* host = [mProxyDict objectForKey:(NSString*)keys->mHost]; + if (host == NULL) + break; + NS_ENSURE_TRUE([host isKindOfClass:[NSString class]], NS_ERROR_FAILURE); + aResultHost.Assign([host UTF8String]); + + // Get the proxy port + NSNumber* port = [mProxyDict objectForKey:(NSString*)keys->mPort]; + NS_ENSURE_TRUE([port isKindOfClass:[NSNumber class]], NS_ERROR_FAILURE); + aResultPort = [port intValue]; + + aResultSocksProxy = keys->mIsSocksProxy; + + return NS_OK; + } + + return NS_ERROR_FAILURE; + + NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; +} + +bool +nsOSXSystemProxySettings::IsAutoconfigEnabled() const +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; + + NSNumber* value = [mProxyDict objectForKey:(NSString*)kSCPropNetProxiesProxyAutoConfigEnable]; + NS_ENSURE_TRUE(value == NULL || [value isKindOfClass:[NSNumber class]], false); + return ([value intValue] != 0); + + NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false); +} + +nsresult +nsOSXSystemProxySettings::GetAutoconfigURL(nsAutoCString& aResult) const +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; + + NSString* value = [mProxyDict objectForKey:(NSString*)kSCPropNetProxiesProxyAutoConfigURLString]; + if (value != NULL) { + NS_ENSURE_TRUE([value isKindOfClass:[NSString class]], NS_ERROR_FAILURE); + aResult.Assign([value UTF8String]); + return NS_OK; + } + + return NS_ERROR_FAILURE; + + NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; +} + +bool +nsOSXSystemProxySettings::IsInExceptionList(const nsACString& aHost) const +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; + + NS_ENSURE_TRUE(mProxyDict != NULL, false); + + NSArray* exceptionList = [mProxyDict objectForKey:(NSString*)kSCPropNetProxiesExceptionsList]; + NS_ENSURE_TRUE(exceptionList == NULL || [exceptionList isKindOfClass:[NSArray class]], false); + + NSEnumerator* exceptionEnumerator = [exceptionList objectEnumerator]; + NSString* currentValue = NULL; + while ((currentValue = [exceptionEnumerator nextObject])) { + NS_ENSURE_TRUE([currentValue isKindOfClass:[NSString class]], false); + nsAutoCString overrideStr([currentValue UTF8String]); + if (mozilla::toolkit::system::IsHostProxyEntry(aHost, overrideStr)) + return true; + } + + NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false); +} + +nsresult +nsOSXSystemProxySettings::GetPACURI(nsACString& aResult) +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; + + NS_ENSURE_TRUE(mProxyDict != NULL, NS_ERROR_FAILURE); + + nsAutoCString pacUrl; + if (IsAutoconfigEnabled() && NS_SUCCEEDED(GetAutoconfigURL(pacUrl))) { + aResult.Assign(pacUrl); + return NS_OK; + } + + return NS_ERROR_FAILURE; + + NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; +} + +nsresult +nsOSXSystemProxySettings::GetProxyForURI(const nsACString & aSpec, + const nsACString & aScheme, + const nsACString & aHost, + const int32_t aPort, + nsACString & aResult) +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; + + int32_t proxyPort; + nsAutoCString proxyHost; + bool proxySocks; + nsresult rv = FindSCProxyPort(aScheme, proxyHost, proxyPort, proxySocks); + + if (NS_FAILED(rv) || IsInExceptionList(aHost)) { + aResult.AssignLiteral("DIRECT"); + } else if (proxySocks) { + aResult.Assign(NS_LITERAL_CSTRING("SOCKS ") + proxyHost + nsPrintfCString(":%d", proxyPort)); + } else { + aResult.Assign(NS_LITERAL_CSTRING("PROXY ") + proxyHost + nsPrintfCString(":%d", proxyPort)); + } + + return NS_OK; + + NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; +} + +#define NS_OSXSYSTEMPROXYSERVICE_CID /* 9afcd4b8-2e0f-41f4-8f1f-3bf0d3cf67de */\ + { 0x9afcd4b8, 0x2e0f, 0x41f4, \ + { 0x8f, 0x1f, 0x3b, 0xf0, 0xd3, 0xcf, 0x67, 0xde } } + +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsOSXSystemProxySettings, Init); +NS_DEFINE_NAMED_CID(NS_OSXSYSTEMPROXYSERVICE_CID); + +static const mozilla::Module::CIDEntry kOSXSysProxyCIDs[] = { + { &kNS_OSXSYSTEMPROXYSERVICE_CID, false, NULL, nsOSXSystemProxySettingsConstructor }, + { NULL } +}; + +static const mozilla::Module::ContractIDEntry kOSXSysProxyContracts[] = { + { NS_SYSTEMPROXYSETTINGS_CONTRACTID, &kNS_OSXSYSTEMPROXYSERVICE_CID }, + { NULL } +}; + +static const mozilla::Module kOSXSysProxyModule = { + mozilla::Module::kVersion, + kOSXSysProxyCIDs, + kOSXSysProxyContracts +}; + +NSMODULE_DEFN(nsOSXProxyModule) = &kOSXSysProxyModule; diff --git a/toolkit/system/osxproxy/tests/gtest/TestProxyBypassRules.cpp b/toolkit/system/osxproxy/tests/gtest/TestProxyBypassRules.cpp new file mode 100644 index 0000000000..7903491090 --- /dev/null +++ b/toolkit/system/osxproxy/tests/gtest/TestProxyBypassRules.cpp @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 8; 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/. */ + +#include "gtest/gtest.h" +#include "ProxyUtils.h" + +using namespace mozilla::toolkit::system; + +TEST(OSXProxy, TestProxyBypassRules) +{ + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("mozilla.org"), NS_LITERAL_CSTRING("mozilla.org"))); + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("mozilla.org"),NS_LITERAL_CSTRING("*mozilla.org"))); + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("mozilla.org"), NS_LITERAL_CSTRING("*.mozilla.org"))); + EXPECT_FALSE(IsHostProxyEntry(NS_LITERAL_CSTRING("notmozilla.org"), NS_LITERAL_CSTRING("*.mozilla.org"))); + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("www.mozilla.org"), NS_LITERAL_CSTRING("*mozilla.org"))); + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("www.mozilla.org"), NS_LITERAL_CSTRING("*.mozilla.org"))); + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("www.mozilla.com"), NS_LITERAL_CSTRING("*.mozilla.*"))); +} + +TEST(OSXProxy, TestProxyBypassRulesIPv4) +{ + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("192.168.1.1"), NS_LITERAL_CSTRING("192.168.1.*"))); + EXPECT_FALSE(IsHostProxyEntry(NS_LITERAL_CSTRING("192.168.1.1"), NS_LITERAL_CSTRING("192.168.2.*"))); + + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("10.1.2.3"), NS_LITERAL_CSTRING("10.0.0.0/8"))); + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("192.168.192.1"), NS_LITERAL_CSTRING("192.168/16"))); + EXPECT_FALSE(IsHostProxyEntry(NS_LITERAL_CSTRING("192.168.192.1"), NS_LITERAL_CSTRING("192.168/17"))); + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("192.168.192.1"), NS_LITERAL_CSTRING("192.168.128/17"))); + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("192.168.1.1"), NS_LITERAL_CSTRING("192.168.1.1/32"))); +} + +TEST(OSXProxy, TestProxyBypassRulesIPv6) +{ + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("2001:0DB8:ABCD:0012:0123:4567:89AB:CDEF"), NS_LITERAL_CSTRING("2001:db8:abcd:0012::0/64"))); + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("2001:0DB8:ABCD:0012:0000:4567:89AB:CDEF"), NS_LITERAL_CSTRING("2001:db8:abcd:0012::0/80"))); + EXPECT_FALSE(IsHostProxyEntry(NS_LITERAL_CSTRING("2001:0DB8:ABCD:0012:0123:4567:89AB:CDEF"), NS_LITERAL_CSTRING("2001:db8:abcd:0012::0/80"))); + EXPECT_TRUE(IsHostProxyEntry(NS_LITERAL_CSTRING("2001:0DB8:ABCD:0012:0000:0000:89AB:CDEF"), NS_LITERAL_CSTRING("2001:db8:abcd:0012::0/96"))); + EXPECT_FALSE(IsHostProxyEntry(NS_LITERAL_CSTRING("2001:0DB8:ABCD:0012:0123:4567:89AB:CDEF"), NS_LITERAL_CSTRING("2001:db8:abcd:0012::0/96"))); +} diff --git a/toolkit/system/osxproxy/tests/gtest/moz.build b/toolkit/system/osxproxy/tests/gtest/moz.build new file mode 100644 index 0000000000..94768a204e --- /dev/null +++ b/toolkit/system/osxproxy/tests/gtest/moz.build @@ -0,0 +1,17 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# 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/. + +UNIFIED_SOURCES += [ + 'TestProxyBypassRules.cpp', +] + +LOCAL_INCLUDES += [ + '/toolkit/system/osxproxy', +] + +FINAL_LIBRARY = 'xul-gtest' + +if CONFIG['GNU_CXX']: + CXXFLAGS += ['-Wshadow'] diff --git a/toolkit/themes/moz.build b/toolkit/themes/moz.build index b24036f1a0..74f53391e2 100644 --- a/toolkit/themes/moz.build +++ b/toolkit/themes/moz.build @@ -21,7 +21,9 @@ if CONFIG['MOZ_PHOENIX']: else: app = CONFIG['MOZ_BUILD_APP'] -if toolkit in ('gtk2', 'gtk3'): +if toolkit == 'cocoa': + DIRS += ['osx'] +elif toolkit in ('gtk2', 'gtk3'): DIRS += ['linux'] else: DIRS += ['windows'] diff --git a/toolkit/themes/osx/global/10pct_transparent_grey.png b/toolkit/themes/osx/global/10pct_transparent_grey.png Binary files differnew file mode 100644 index 0000000000..01f2edd9f4 --- /dev/null +++ b/toolkit/themes/osx/global/10pct_transparent_grey.png diff --git a/toolkit/themes/osx/global/50pct_transparent_grey.png b/toolkit/themes/osx/global/50pct_transparent_grey.png Binary files differnew file mode 100644 index 0000000000..0e462a46fa --- /dev/null +++ b/toolkit/themes/osx/global/50pct_transparent_grey.png diff --git a/toolkit/themes/osx/global/alerts/alert.css b/toolkit/themes/osx/global/alerts/alert.css new file mode 100644 index 0000000000..3ca1a6e066 --- /dev/null +++ b/toolkit/themes/osx/global/alerts/alert.css @@ -0,0 +1,30 @@ +/* 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/. */ + +/* ===== alert.css ===================================================== + == Styles specific to the alerts dialog. + ======================================================================= */ + +@import url("chrome://global/skin/alerts/alert-common.css"); + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +#alertNotification { + -moz-appearance: none; + background: transparent; +} + +#alertBox { + border: 1px solid ThreeDShadow; + border-radius: 1px; + background-color: -moz-Dialog; + color: -moz-DialogText; +} + +.alertCloseButton { + -moz-appearance: none; + padding: 0; + margin: 2px; + border: none; +} diff --git a/toolkit/themes/osx/global/arrow.css b/toolkit/themes/osx/global/arrow.css new file mode 100644 index 0000000000..f8d14becab --- /dev/null +++ b/toolkit/themes/osx/global/arrow.css @@ -0,0 +1,38 @@ +/* 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/. */ + + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +.up { + min-width: 0px; + list-style-image: url("chrome://global/skin/arrow/arrow-up.gif"); +} +.up[disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-up-dis.gif"); +} + +.down { + min-width: 0px; + list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif"); +} +.down[disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-dn-dis.gif"); +} + +.left { + min-width: 0px; + list-style-image: url("chrome://global/skin/arrow/arrow-lft.gif"); +} +.left[disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-lft-dis.gif"); +} + +.right { + min-width: 0px; + list-style-image: url("chrome://global/skin/arrow/arrow-rit.gif"); +} +.right[disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-rit-dis.gif"); +} diff --git a/toolkit/themes/osx/global/arrow/arrow-dn-dis.gif b/toolkit/themes/osx/global/arrow/arrow-dn-dis.gif Binary files differnew file mode 100644 index 0000000000..3d62e40063 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-dn-dis.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-dn-dis.png b/toolkit/themes/osx/global/arrow/arrow-dn-dis.png Binary files differnew file mode 100644 index 0000000000..a202fd85c9 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-dn-dis.png diff --git a/toolkit/themes/osx/global/arrow/arrow-dn-sharp.gif b/toolkit/themes/osx/global/arrow/arrow-dn-sharp.gif Binary files differnew file mode 100644 index 0000000000..206d7c19dd --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-dn-sharp.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-dn.gif b/toolkit/themes/osx/global/arrow/arrow-dn.gif Binary files differnew file mode 100644 index 0000000000..33849a6391 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-dn.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-dn.png b/toolkit/themes/osx/global/arrow/arrow-dn.png Binary files differnew file mode 100644 index 0000000000..91486a3e9a --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-dn.png diff --git a/toolkit/themes/osx/global/arrow/arrow-lft-dis.gif b/toolkit/themes/osx/global/arrow/arrow-lft-dis.gif Binary files differnew file mode 100644 index 0000000000..33243517b1 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-lft-dis.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-lft-hov.gif b/toolkit/themes/osx/global/arrow/arrow-lft-hov.gif Binary files differnew file mode 100644 index 0000000000..3367bde312 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-lft-hov.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-lft-sharp-end.gif b/toolkit/themes/osx/global/arrow/arrow-lft-sharp-end.gif Binary files differnew file mode 100644 index 0000000000..c22294ba21 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-lft-sharp-end.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-lft-sharp.gif b/toolkit/themes/osx/global/arrow/arrow-lft-sharp.gif Binary files differnew file mode 100644 index 0000000000..ae9b1dd0fb --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-lft-sharp.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-lft.gif b/toolkit/themes/osx/global/arrow/arrow-lft.gif Binary files differnew file mode 100644 index 0000000000..c5c362d89b --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-lft.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-rit-dis.gif b/toolkit/themes/osx/global/arrow/arrow-rit-dis.gif Binary files differnew file mode 100644 index 0000000000..cda95fe215 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-rit-dis.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-rit-hov.gif b/toolkit/themes/osx/global/arrow/arrow-rit-hov.gif Binary files differnew file mode 100644 index 0000000000..5010921adc --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-rit-hov.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-rit-sharp-end.gif b/toolkit/themes/osx/global/arrow/arrow-rit-sharp-end.gif Binary files differnew file mode 100644 index 0000000000..c1b3750d4c --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-rit-sharp-end.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-rit-sharp.gif b/toolkit/themes/osx/global/arrow/arrow-rit-sharp.gif Binary files differnew file mode 100644 index 0000000000..ca628ba69b --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-rit-sharp.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-rit.gif b/toolkit/themes/osx/global/arrow/arrow-rit.gif Binary files differnew file mode 100644 index 0000000000..dce39aecc1 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-rit.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-up-dis.gif b/toolkit/themes/osx/global/arrow/arrow-up-dis.gif Binary files differnew file mode 100644 index 0000000000..381dee3e5d --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-up-dis.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-up-sharp.gif b/toolkit/themes/osx/global/arrow/arrow-up-sharp.gif Binary files differnew file mode 100644 index 0000000000..883a4f95ca --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-up-sharp.gif diff --git a/toolkit/themes/osx/global/arrow/arrow-up.gif b/toolkit/themes/osx/global/arrow/arrow-up.gif Binary files differnew file mode 100644 index 0000000000..b8e09b21b8 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/arrow-up.gif diff --git a/toolkit/themes/osx/global/arrow/panelarrow-horizontal.png b/toolkit/themes/osx/global/arrow/panelarrow-horizontal.png Binary files differnew file mode 100644 index 0000000000..c110f8592d --- /dev/null +++ b/toolkit/themes/osx/global/arrow/panelarrow-horizontal.png diff --git a/toolkit/themes/osx/global/arrow/panelarrow-horizontal@2x.png b/toolkit/themes/osx/global/arrow/panelarrow-horizontal@2x.png Binary files differnew file mode 100644 index 0000000000..4cb7353e70 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/panelarrow-horizontal@2x.png diff --git a/toolkit/themes/osx/global/arrow/panelarrow-vertical.png b/toolkit/themes/osx/global/arrow/panelarrow-vertical.png Binary files differnew file mode 100644 index 0000000000..3986f9cbf5 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/panelarrow-vertical.png diff --git a/toolkit/themes/osx/global/arrow/panelarrow-vertical@2x.png b/toolkit/themes/osx/global/arrow/panelarrow-vertical@2x.png Binary files differnew file mode 100644 index 0000000000..a741dd0e16 --- /dev/null +++ b/toolkit/themes/osx/global/arrow/panelarrow-vertical@2x.png diff --git a/toolkit/themes/osx/global/autocomplete.css b/toolkit/themes/osx/global/autocomplete.css new file mode 100644 index 0000000000..7e05d2f29c --- /dev/null +++ b/toolkit/themes/osx/global/autocomplete.css @@ -0,0 +1,174 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); +@namespace html url("http://www.w3.org/1999/xhtml"); + +/* .padded is used by autocomplete widgets that don't have an icon. Gross. -dwh */ +textbox:not(.padded) { + cursor: default; + padding: 0; +} + +textbox[nomatch="true"][highlightnonmatches="true"] { + color: red; +} + +textbox:not(.padded) .textbox-input-box { + margin: 0 3px; +} + +.textbox-input-box { + -moz-box-align: center; +} + +/* ::::: history button ::::: */ + +.autocomplete-history-dropmarker { + -moz-appearance: none !important; + border: none !important; + background-color: transparent !important; + padding: 0px; + list-style-image: url("chrome://global/skin/icons/autocomplete-dropmarker.png"); + margin: 0px; +} + +/* ::::: autocomplete popups ::::: */ + +panel[type="autocomplete"], +panel[type="autocomplete-richlistbox"], +.autocomplete-history-popup { + padding: 0px !important; + color: -moz-FieldText; + background-color: -moz-Field; + font: icon; + -moz-appearance: none; +} + +.autocomplete-history-popup { + max-height: 180px; +} + +/* ::::: tree ::::: */ + +.autocomplete-tree { + -moz-appearance: none !important; + border: none !important; + background-color: transparent !important; +} + +.autocomplete-treecol { + -moz-appearance: none !important; + margin: 0 !important; + border: none !important; + padding: 0 !important; +} + +.autocomplete-treebody::-moz-tree-cell-text { + padding-left: 2px; +} + +.autocomplete-treebody::-moz-tree-row { + border-top: none; +} + +treechildren.autocomplete-treebody::-moz-tree-row(selected) { + background-color: Highlight; +} + +treechildren.autocomplete-treebody::-moz-tree-cell-text(selected) { + color: HighlightText !important; +} + +.autocomplete-treebody::-moz-tree-image(treecolAutoCompleteValue) { + max-width: 16px; + height: 16px; +} + +/* ::::: richlistbox autocomplete ::::: */ + +.autocomplete-richlistbox { + -moz-appearance: none; + margin: 0; +} + +.ac-type-icon { + width: 16px; + height: 16px; + max-width: 16px; + max-height: 16px; + margin-inline-start: 16px; + margin-inline-end: 6px; +} + +.ac-site-icon { + width: 16px; + height: 16px; + max-width: 16px; + max-height: 16px; + margin-inline-start: 0; + margin-inline-end: 11px; + list-style-image: url("chrome://mozapps/skin/places/defaultFavicon.png"); +} + +.ac-site-icon[selected] { + list-style-image: url("chrome://mozapps/skin/places/defaultFavicon-inverted.png"); +} + +@media (min-resolution: 2dppx) { + .ac-site-icon { + list-style-image: url("chrome://mozapps/skin/places/defaultFavicon@2x.png"); + } + .ac-site-icon[selected] { + list-style-image: url("chrome://mozapps/skin/places/defaultFavicon-inverted@2x.png"); + } +} + +.ac-title { + margin-inline-start: 0; + margin-inline-end: 6px; +} + +html|span.ac-tag { + margin-inline-start: 0; + margin-inline-end: 2px; +} + +.ac-tags { + margin-inline-start: 0; + margin-inline-end: 4px; +} + +.ac-separator { + margin-inline-start: 0; + margin-inline-end: 6px; +} + +/* Better align the URL/action with the title. */ +.ac-tags, +.ac-separator, +.ac-url, +.ac-action { + margin-bottom: -2px; +} + +.ac-title-text, +.ac-tags-text, +.ac-separator-text, +.ac-url-text, +.ac-action-text, +.ac-text-overflow-container { + padding: 0 !important; + margin: 0 !important; +} + +/* ::::: textboxes inside toolbarpaletteitems ::::: */ + +toolbarpaletteitem > toolbaritem > textbox > hbox > hbox > html|*.textbox-input { + visibility: hidden; +} + +toolbarpaletteitem > toolbaritem > * > textbox > hbox > hbox > html|*.textbox-input { + visibility: hidden; +} diff --git a/toolkit/themes/osx/global/button.css b/toolkit/themes/osx/global/button.css new file mode 100644 index 0000000000..45f292e1f1 --- /dev/null +++ b/toolkit/themes/osx/global/button.css @@ -0,0 +1,85 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +button { + -moz-appearance: button; + /* The horizontal margin used here come from the Aqua Human Interface + Guidelines, there should be 12 pixels between two buttons. */ + margin: 5px 6px 3px; + min-width: 79px; + color: ButtonText; + text-shadow: none; +} + +button:not([disabled="true"]):hover:active { + color: -moz-mac-buttonactivetext; +} + +/* When the window isn't focused, the default button background isn't drawn, + * so don't change the text color then: */ +button[default="true"]:not([disabled="true"]):not(:-moz-window-inactive) { + color: -moz-mac-defaultbuttontext; +} + +/* Likewise, when active (mousedown) but not hovering, the default button + * background isn't drawn, override the previous selector for that case: */ +button[default="true"]:not(:hover):active { + color: ButtonText; +} + +.button-text { + margin: 1px 0 !important; + margin-inline-start: 3px !important; + margin-inline-end: 2px !important; + text-align: center; +} + +.button-icon { + margin-inline-start: 1px; +} + +button[type="default"] { + font: menu; +} + +/* .......... disabled state .......... */ + +button[disabled="true"] { + color: GrayText; +} + +/* ::::: menu/menu-button buttons ::::: */ + +button[type="menu-button"] { + margin: 0; + border: none; +} + +.button-menu-dropmarker, +.button-menubutton-dropmarker { + -moz-appearance: none !important; + border: none; + background-color: transparent !important; + margin: 1px; +} + +.button-menu-dropmarker { + display: none; +} + +/* ::::: plain buttons ::::: */ + +button.plain { + margin: 0 !important; + padding: 0 !important; +} + +/* ::::: help button ::::: */ + +button[dlgtype="help"] { + -moz-appearance: -moz-mac-help-button; + width: 20px; +} diff --git a/toolkit/themes/osx/global/checkbox.css b/toolkit/themes/osx/global/checkbox.css new file mode 100644 index 0000000000..b49af98d04 --- /dev/null +++ b/toolkit/themes/osx/global/checkbox.css @@ -0,0 +1,39 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +checkbox { + -moz-appearance: checkbox-container; + -moz-box-align: center; + margin: 4px 2px; +} + +.checkbox-icon { + margin-right: 2px; +} + +.checkbox-label { + margin: 1px 0 !important; +} + +/* ..... disabled state ..... */ + +checkbox[disabled="true"] { + color: GrayText !important; +} + +/* ::::: checkmark image ::::: */ + +.checkbox-check { + -moz-appearance: checkbox; + margin: 1px 1px 0; + /* vertical-align tells native theming where to snap to. However, this doesn't + * always work reliably because of bug 503833. */ + vertical-align: top; + width: 1.3em; + height: 1.3em; +} + + diff --git a/toolkit/themes/osx/global/checkbox/cbox-check-dis.gif b/toolkit/themes/osx/global/checkbox/cbox-check-dis.gif Binary files differnew file mode 100644 index 0000000000..bd43dd17c3 --- /dev/null +++ b/toolkit/themes/osx/global/checkbox/cbox-check-dis.gif diff --git a/toolkit/themes/osx/global/checkbox/cbox-check.gif b/toolkit/themes/osx/global/checkbox/cbox-check.gif Binary files differnew file mode 100644 index 0000000000..f6919f8fad --- /dev/null +++ b/toolkit/themes/osx/global/checkbox/cbox-check.gif diff --git a/toolkit/themes/osx/global/colorpicker.css b/toolkit/themes/osx/global/colorpicker.css new file mode 100644 index 0000000000..075437db89 --- /dev/null +++ b/toolkit/themes/osx/global/colorpicker.css @@ -0,0 +1,41 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* ::::: colorpicker button ::::: */ + +colorpicker[type="button"] { + width: 38px; + height: 24px; + border: 1px solid #a7a7a7; + background-color: ThreeDFace; + padding: 3px; + -moz-appearance: button-bevel; +} + +.colorpicker-button-colorbox { + border: 1px solid #000000; +} + +/* ::::: colorpicker tiles ::::: */ + +.colorpickertile { + width : 20px; + height : 20px; + margin : 1px; +} + +.colorpickertile[selected="true"] { + border : 1px outset #C0C0C0; + +} + +.colorpickertile[hover="true"] { + border : 1px dotted #A7A7A7; +} + +.cp-light[hover="true"] { + border : 1px dotted #000000; +} diff --git a/toolkit/themes/osx/global/commonDialog.css b/toolkit/themes/osx/global/commonDialog.css new file mode 100644 index 0000000000..53b02796d2 --- /dev/null +++ b/toolkit/themes/osx/global/commonDialog.css @@ -0,0 +1,35 @@ +/* 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/. */ + +#commonDialog { + line-height: 13px; +} + +#filler { + margin: 0px -14px; +} + +#infoContainer { + max-width: 33em; +} + +#loginContainer { + padding-top: 10px; +} + +#info\.icon { + margin-inline-end: 14px; +} + +#info\.title, +#info\.header, +#info\.body { + font: menu; + line-height: 16px; + margin-bottom: 6px; +} + +#info\.title { + font-weight: bold; +} diff --git a/toolkit/themes/osx/global/console/console-error-caret.gif b/toolkit/themes/osx/global/console/console-error-caret.gif Binary files differnew file mode 100644 index 0000000000..a8f30f9263 --- /dev/null +++ b/toolkit/themes/osx/global/console/console-error-caret.gif diff --git a/toolkit/themes/osx/global/console/console-error-dash.gif b/toolkit/themes/osx/global/console/console-error-dash.gif Binary files differnew file mode 100644 index 0000000000..74679a25e2 --- /dev/null +++ b/toolkit/themes/osx/global/console/console-error-dash.gif diff --git a/toolkit/themes/osx/global/console/console.css b/toolkit/themes/osx/global/console/console.css new file mode 100644 index 0000000000..f18f6f680c --- /dev/null +++ b/toolkit/themes/osx/global/console/console.css @@ -0,0 +1,165 @@ +/* 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/. */ + +/* ===== console.css ==================================================== + == Styles used by the Error Console window. + ======================================================================= */ + +/* View buttons */ +@import "chrome://global/skin/viewbuttons.css"; + +%include ../shared.inc +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +.console-box { + background-color: -moz-Field; + color: -moz-FieldText; + overflow: auto; +} + +/* ::::: console rows ::::: */ + +.console-row { + border-bottom: 1px solid #A3A3A3; + padding: 4px; +} + +.console-row-file { + color: #505050; +} + +.console-row-msg > label:first-child { + font-weight: bold; +} + +.console-row-msg > label, .comsole-row-msg > description, .console-error-msg, .console-row-file, .console-row-code { + margin: 2px; +} + +.console-row-file > label { + margin: 0; +} + +.console-msg-text { + white-space: pre-wrap !important; +} +.console-icon { + list-style-image: inherit; + padding-right: 6px; + padding-left: 6px; +} + +/* ..... error rows ..... */ + +.console-row-code { + color: #0000BB; + font-size: larger; +} + +.console-dots, +.console-caret { + height: 9px; +} + +.console-dots { + background: url("chrome://global/skin/console/console-error-dash.gif") repeat-x top; +} + +.console-caret { + width: 7px; + background: url("chrome://global/skin/console/console-error-caret.gif") no-repeat top; +} + +/* ..... message rows ..... */ + +.console-row[type="message"] { + font-family: monospace; +} + +/* ..... selected state ..... */ + +.console-row[selected="true"] { + background-color: #3D80DF !important; + color: #FFF; +} + +.console-row-code[selected="true"], +.console-row-content[selected="true"] > .console-row-file, +.console-row-content[selected="true"] > .console-row-file > .console-error-source > .text-link { + color: #FFF !important; +} + +/* ::::: row colors ::::: */ + +.console-row[type="error"], +.console-row[type="exception"] { + background-color: #FFD0DC; +} + +.console-row[type="warning"] { + background-color: #F8F3CC; +} + +.console-row[type="message"] { + background-color: #D3EDFF; +} + +/* ::::: toolbars ::::: */ + +#ToolbarEval { + -moz-appearance: none; + background: @scopeBarBackground@; + border-bottom: @scopeBarSeparatorBorder@; + padding: 2px; +} + +#ToolbarEval > label { + font-weight: bold; + color: @scopeBarTitleColor@; +} + +#TextfieldEval { + margin: 2px !important; +} + +#ButtonEval { + margin: 0 4px; + padding: 1px 10px; + -moz-appearance: none; + border-radius: 10000px; + border: @roundButtonBorder@; + background: @roundButtonBackground@; + box-shadow: @roundButtonShadow@; +} + +#ButtonEval:hover:active { + text-shadow: @loweredShadow@; + background: @roundButtonPressedBackground@; + box-shadow: @roundButtonPressedShadow@; +} + +toolbarseparator { + min-height: 1em; + background-image: none; +} + +/* Toolbar icons */ + +#ToolbarMode { + -moz-box-pack: center; +} + +#ToolbarMode toolbarbutton > .toolbarbutton-icon { + display: none; +} + +#Console\:clear { + -moz-box-orient: vertical; + -moz-box-align: center; + -moz-appearance: toolbarbutton; + font: menu; + text-shadow: @loweredShadow@; + margin: 4px 0 9px; + padding: 0 1px; +} diff --git a/toolkit/themes/osx/global/customizeToolbar.css b/toolkit/themes/osx/global/customizeToolbar.css new file mode 100644 index 0000000000..bcedb2b99a --- /dev/null +++ b/toolkit/themes/osx/global/customizeToolbar.css @@ -0,0 +1,38 @@ +/* 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/. */ + +#palette-box { + margin-top: 2px; + -moz-appearance: listbox; + margin: 0 0 10px; +} + +#palette-box > toolbarpaletteitem { + padding: 8px 2px; + margin: 0 8px; +} + +#main-box { + padding: 12px; +} + +#main-box > separator { + -moz-appearance: none; + border-bottom: none; +} + +#instructions { + font: menu; + font-weight: bold; + line-height: 16pt; +} + +hbox button { + font: menu; +} + +#main-box > box > button { + min-height: 19px; /* aqua size for small buttons */ + font: message-box; +} diff --git a/toolkit/themes/osx/global/datetimepicker.css b/toolkit/themes/osx/global/datetimepicker.css new file mode 100644 index 0000000000..3d7b201f2e --- /dev/null +++ b/toolkit/themes/osx/global/datetimepicker.css @@ -0,0 +1,126 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); +@namespace html url("http://www.w3.org/1999/xhtml"); + +datepicker, timepicker { + padding: 0 0 1px; + margin: 4px; + border: none; +} + +.datetimepicker-input-box { + -moz-appearance: textfield; + cursor: text; + margin-right: 4px; + margin-bottom: 2px; + border: 3px solid; + -moz-border-top-colors: transparent #888888 #000000; + -moz-border-right-colors: transparent #FFFFFF #000000; + -moz-border-bottom-colors: transparent #FFFFFF #000000; + -moz-border-left-colors: transparent #888888 #000000; + border-top-right-radius: 2px; + border-bottom-left-radius: 2px; + padding: 0px; + background-color: -moz-Field; + color: -moz-FieldText; +} + +.datetimepicker-input-subbox { + width: 1.6em; +} + +html|*.datetimepicker-input { + text-align: end; +} + +.datetimepicker-separator { + margin: 0 !important; +} + +.datetimepicker-year { + width: 3.2em; +} + +.datepicker-dropmarker { + margin-bottom: 2px; +} + +datepicker[readonly="true"], +timepicker[readonly="true"] { + background-color: -moz-Dialog; + color: -moz-DialogText; +} + +datepicker[disabled="true"], +timepicker[disabled="true"] { + cursor: default; + -moz-border-top-colors: transparent ThreeDShadow -moz-Dialog; + -moz-border-right-colors: transparent ThreeDShadow -moz-Dialog; + -moz-border-bottom-colors: transparent ThreeDShadow -moz-Dialog; + -moz-border-left-colors: transparent ThreeDShadow -moz-Dialog; + background-color: -moz-Dialog; + color: GrayText; +} + +.datepicker-mainbox { + margin: 2px 4px; + border: 2px solid; + -moz-border-top-colors: ThreeDShadow ThreeDDarkShadow; + -moz-border-right-colors: ThreeDHighlight ThreeDLightShadow; + -moz-border-bottom-colors: ThreeDHighlight ThreeDLightShadow; + -moz-border-left-colors: ThreeDShadow ThreeDDarkShadow; + background-color: #EEEEEE; + color: -moz-DialogText; +} + +.datepicker-popupgrid > .datepicker-mainbox { + margin: 0; + border: none; +} + +.datepicker-gridlabel, .datepicker-weeklabel { + text-align: center; +} + +.datepicker-gridlabel[today="true"] { + background-color: darkgrey; + color: white; +} + +.datepicker-gridlabel[selected="true"] { + background-color: Highlight; + color: HighlightText; +} + +.datepicker-button { + -moz-appearance: none; + min-width: 8px; + padding: 0px; +} + +.datepicker-previous { + list-style-image: url("chrome://global/skin/arrow/arrow-lft.gif"); +} + +.datepicker-next { + list-style-image: url("chrome://global/skin/arrow/arrow-rit.gif"); +} + +.datepicker-previous:hover { + list-style-image: url("chrome://global/skin/arrow/arrow-lft-hov.gif"); +} + +.datepicker-next:hover { + list-style-image: url("chrome://global/skin/arrow/arrow-rit-hov.gif"); +} + +.datepicker-previous[disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-lft-dis.gif"); +} + +.datepicker-next[disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-rit-dis.gif"); +} diff --git a/toolkit/themes/osx/global/dialog.css b/toolkit/themes/osx/global/dialog.css new file mode 100644 index 0000000000..98ed3ca207 --- /dev/null +++ b/toolkit/themes/osx/global/dialog.css @@ -0,0 +1,77 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +#commonDialog > image { + margin-inline-end: 14px !important; +} + +#commonDialog > .dialog-button-box { + margin-inline-start: 80px; +} + +dialog { + -moz-appearance: dialog; + padding: 14px; +} + +/* ::::: dialog buttons ::::: */ + +.dialog-button { + font: menu; +} + +/* ::::: dialog header ::::: */ + +dialogheader { + margin: 0 5px 5px; + padding: 5px 8px; +} + +.dialogheader-title { + margin: 0 !important; + font-size: larger; + font-weight: bold; + display: none; +} + +/* ::::: large dialog header ::::: */ + +.header-large { + -moz-box-orient: vertical; + margin: -14px -14px 0; + padding: 12px; + padding-inline-end: 5px; + padding-inline-start: 25px; +} + +.header-large > .dialogheader-title { + font: inherit; + font-weight: bold; +} + +.header-large > .dialogheader-description { + margin-left: 12px !important; +} + +.dialogheader-description { + font-weight: bold !important; +} + +.dialogheader-title { + font-weight: bold !important; +} + +/*XXX - belongs to toolkit/content/finddialog.xul: */ + +#findDialog, +#findDialog > menu, +#findDialog > groupbox { + font: menu !important; +} + +#dialog\.caseSensitive { + margin-top: 8px; +} diff --git a/toolkit/themes/osx/global/dirListing/dirListing.css b/toolkit/themes/osx/global/dirListing/dirListing.css new file mode 100644 index 0000000000..de881a5e4b --- /dev/null +++ b/toolkit/themes/osx/global/dirListing/dirListing.css @@ -0,0 +1,104 @@ +/* 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/. */ + +:root { + background-color: -moz-dialog; + color: -moz-dialogtext; + font: message-box; + padding-left: 2em; + padding-right: 2em; +} + +body { + border: 1px solid ThreeDShadow; + border-radius: 10px; + padding: 3em; + min-width: 30em; + max-width: 65em; + margin: 4em auto; + background-color: -moz-field; + color: -moz-fieldtext; +} + +h1 { + font-size: 160%; + margin: 0 0 .6em; + border-bottom: 1px solid ThreeDLightShadow; + font-weight: normal; +} + +a { + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +p { + font-size: 110%; +} + +#UI_goUp { + margin-top: 0; + float: left; +} + +#UI_goUp:dir(rtl) { + float: right; +} + +#UI_showHidden { + margin-top: 0; + float: right; +} + +#UI_showHidden:dir(rtl) { + float: left; +} + +table { + clear: both; + width: 90%; + margin: 0 auto; +} + +thead { + font-size: 130%; +} + +/* last modified */ +th:last-child { + text-align: center; +} + +th:hover > a { + text-decoration: underline; +} + +body > table > tbody > tr:hover { + outline: 1px solid ThreeDLightShadow; + -moz-outline-radius: .3em; +} + +/* let 'Size' and 'Last Modified' take only as much space as they need and 'Name' all the rest */ +td:not(:first-child) { + width: 0; +} + +.up { + padding: 0 .5em; + margin-inline-start: 20px; +} + +.up::before { + margin-inline-end: 4px; + margin-inline-start: -20px; + vertical-align: middle; + content: url(chrome://global/skin/dirListing/up.png); +} + +.dir::before { + content: url(chrome://global/skin/dirListing/folder.png); +} diff --git a/toolkit/themes/osx/global/dirListing/folder.png b/toolkit/themes/osx/global/dirListing/folder.png Binary files differnew file mode 100644 index 0000000000..eb3a607e03 --- /dev/null +++ b/toolkit/themes/osx/global/dirListing/folder.png diff --git a/toolkit/themes/osx/global/dirListing/remote.png b/toolkit/themes/osx/global/dirListing/remote.png Binary files differnew file mode 100644 index 0000000000..d854bd9d9f --- /dev/null +++ b/toolkit/themes/osx/global/dirListing/remote.png diff --git a/toolkit/themes/osx/global/dirListing/up.png b/toolkit/themes/osx/global/dirListing/up.png Binary files differnew file mode 100644 index 0000000000..7af8949ad3 --- /dev/null +++ b/toolkit/themes/osx/global/dirListing/up.png diff --git a/toolkit/themes/osx/global/dropmarker.css b/toolkit/themes/osx/global/dropmarker.css new file mode 100644 index 0000000000..701eea75c4 --- /dev/null +++ b/toolkit/themes/osx/global/dropmarker.css @@ -0,0 +1,31 @@ +/* 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/. */ + +dropmarker { + -moz-appearance: menulist-button; + width: 16px; + -moz-box-align: center; + -moz-box-pack: center; + border: 2px solid; + -moz-border-top-colors: ThreeDLightShadow ThreeDHighlight; + -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow; + -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow; + -moz-border-left-colors: ThreeDLightShadow ThreeDHighlight; + background-color: -moz-Dialog; + padding: 1px; + list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif"); + -moz-image-region: auto; +} + +dropmarker:hover:active:not([disabled="true"]) { + -moz-border-top-colors: ThreeDShadow ThreeDFace; + -moz-border-right-colors: ThreeDShadow ThreeDFace; + -moz-border-bottom-colors: ThreeDShadow ThreeDFace; + -moz-border-left-colors: ThreeDShadow ThreeDFace; + padding: 2px 0 0 2px; +} + +dropmarker[disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-dn-dis.gif"); +} diff --git a/toolkit/themes/osx/global/filefield.css b/toolkit/themes/osx/global/filefield.css new file mode 100644 index 0000000000..8ae3fdb52a --- /dev/null +++ b/toolkit/themes/osx/global/filefield.css @@ -0,0 +1,38 @@ +/* +# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +# 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/. +*/ + +.fileFieldIcon { + width: 16px; + height: 16px; +} + +.fileFieldIcon[disabled="true"] { + opacity: 0.5; +} + +filefield { + margin: 4px; + margin-inline-start: 27px; + -moz-appearance: textfield; +} + +.fileFieldContentBox { + margin: -3px; + background-color: rgba(230, 230, 230, 0.6); + color: -moz-DialogText; + padding-top: 2px; + padding-bottom: 2px; + padding-inline-start: 5px; + padding-inline-end: 3px; +} + +.fileFieldLabel { + -moz-appearance: none; + background-color: transparent; + border: none; + margin: 0 4px; +} diff --git a/toolkit/themes/osx/global/filters.svg b/toolkit/themes/osx/global/filters.svg new file mode 100644 index 0000000000..d3ad6a76b8 --- /dev/null +++ b/toolkit/themes/osx/global/filters.svg @@ -0,0 +1,14 @@ +<!-- 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/. --> + +<svg xmlns="http://www.w3.org/2000/svg"> + <filter id="iconPressed" color-interpolation-filters="sRGB"> + <!-- Multiply all components with 0.55. --> + <feComponentTransfer> + <feFuncR type="linear" slope=".55"/> + <feFuncG type="linear" slope=".55"/> + <feFuncB type="linear" slope=".55"/> + </feComponentTransfer> + </filter> +</svg> diff --git a/toolkit/themes/osx/global/findBar.css b/toolkit/themes/osx/global/findBar.css new file mode 100644 index 0000000000..869a624322 --- /dev/null +++ b/toolkit/themes/osx/global/findBar.css @@ -0,0 +1,270 @@ +/* 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/. */ + +%include shared.inc +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +findbar { + background: @scopeBarBackground@; + border-top: @scopeBarSeparatorBorder@; + min-width: 1px; + padding: 4px 2px; + transition-property: margin-bottom, opacity, visibility; + transition-duration: 150ms, 150ms, 0s; + transition-timing-function: ease-in-out, ease-in-out, linear; +} + +findbar[hidden] { + /* Override display:none to make the transition work. */ + display: -moz-box; + visibility: collapse; + margin-bottom: -1em; + opacity: 0; + transition-delay: 0s, 0s, 150ms; +} + +findbar:-moz-lwtheme { + -moz-appearance: none; + background: none; + border-style: none; +} + +label.findbar-find-fast { + margin: 1px 3px 0 !important; + color: @scopeBarTitleColor@; + font-weight: bold; + text-shadow: @loweredShadow@; +} + +label.findbar-find-fast:-moz-lwtheme, +.findbar-find-status:-moz-lwtheme { + color: inherit; + text-shadow: inherit; +} + +.findbar-closebutton { + padding: 0; + margin: 0 4px; + border: none; +} + +.findbar-closebutton:-moz-lwtheme-brighttext { + list-style-image: url("chrome://global/skin/icons/close-inverted.png"); +} + +@media (min-resolution: 2dppx) { + .findbar-closebutton:-moz-lwtheme-brighttext { + list-style-image: url("chrome://global/skin/icons/close-inverted@2x.png"); + } + + .findbar-closebutton > .toolbarbutton-icon { + width: 16px; + } +} + +.findbar-find-next, +.findbar-find-previous, +.findbar-highlight { + margin: 0 4px; + padding: 1px 3px; + -moz-appearance: none; + border-radius: 10000px; + border: @roundButtonBorder@; + background: @roundButtonBackground@; + box-shadow: @roundButtonShadow@; + color: buttontext; +} + +.findbar-container > toolbarbutton:-moz-focusring { + position: relative; + box-shadow: @focusRingShadow@, @roundButtonShadow@; +} + +.findbar-container > toolbarbutton > .toolbarbutton-text { + margin: 0 6px !important; +} + +.findbar-container > toolbarbutton[disabled] { + color: GrayText !important; +} + +.findbar-find-next:not([disabled]):hover:active, +.findbar-find-previous:not([disabled]):hover:active, +.findbar-highlight:not([disabled]):hover:active { + text-shadow: @loweredShadow@; + background: @roundButtonPressedBackground@; + box-shadow: @roundButtonPressedShadow@; +} + +.findbar-container > toolbarbutton:hover:active:-moz-focusring { + text-shadow: @loweredShadow@; + background: @roundButtonPressedBackground@; + box-shadow: @focusRingShadow@, @roundButtonPressedShadow@; +} + +.findbar-closebutton > .toolbarbutton-text { + display: none; +} + +/* Match case checkbox */ + +.findbar-container > checkbox { + list-style-image: url("chrome://global/skin/icons/checkbox.png"); + -moz-image-region: rect(0px 16px 16px 0px); + -moz-appearance: none; + margin: 0 2px; + -moz-margin-start: 7px; +} + +.findbar-container > checkbox:hover:active { + -moz-image-region: rect(0px 32px 16px 16px); +} +.findbar-container > checkbox[checked] { + -moz-image-region: rect(0px 48px 16px 32px); +} +.findbar-container > checkbox[checked]:hover:active { + -moz-image-region: rect(0px 64px 16px 48px); +} + +@media (min-resolution: 2dppx) { + .findbar-container > checkbox { + list-style-image: url("chrome://global/skin/icons/checkbox@2x.png"); + -moz-image-region: rect(0px 32px 32px 0px); + } + + .findbar-container > checkbox:hover:active { + -moz-image-region: rect(0px 64px 32px 32px); + } + .findbar-container > checkbox[checked] { + -moz-image-region: rect(0px 96px 32px 64px); + } + .findbar-container > checkbox[checked]:hover:active { + -moz-image-region: rect(0px 128px 32px 96px); + } +} + + + +.findbar-container > checkbox > .checkbox-check { + display: none; +} + +.findbar-container > checkbox > .checkbox-label-box > .checkbox-label { + margin: 0 !important; + padding: 2px 0 0; +} + +.findbar-container > checkbox > .checkbox-label-box > .checkbox-icon { + -moz-padding-start: 1px; + padding-bottom: 1px; +} +@media (min-resolution: 2dppx) { + .findbar-container > checkbox > .checkbox-label-box > .checkbox-icon { + width: 17px; + height: 17px; + } +} + +.findbar-container > checkbox:-moz-focusring > .checkbox-label-box > .checkbox-icon { + border-radius: 4px; + box-shadow: @focusRingShadow@; +} + +/* Search field */ + +.findbar-textbox { + -moz-appearance: none; + border-radius: 10000px; + border: none; + box-shadow: 0 1px 1.5px rgba(0, 0, 0, .7) inset, + 0 0 0 1px rgba(0, 0, 0, .17) inset; + background: url("chrome://global/skin/icons/search-textbox.png") -moz-Field no-repeat 5px center; + margin: 0 4px -1px; + padding: 3px 8px 2px; + -moz-padding-start: 19px; +} + +.findbar-textbox:not([focused="true"]):-moz-lwtheme { + opacity: 0.9; +} + +.findbar-textbox[focused="true"] { + box-shadow: @focusRingShadow@, + 0 1px 1.5px rgba(0, 0, 0, .8) inset; +} + +.findbar-textbox[flash="true"] { + background-color: #F7E379; + color: #000; +} + +.findbar-textbox[status="notfound"] { + background-color: #FD919B; + color: #FFF; +} + +/* find-next button */ + +.findbar-find-next { + -moz-border-end: none; + -moz-margin-end: 0 !important; +} + +.findbar-find-next:-moz-locale-dir(ltr), +.findbar-find-previous:-moz-locale-dir(rtl) { + border-top-right-radius: 0px; + border-bottom-right-radius: 0px; +} + +/* find-previous button */ + +.findbar-find-previous { + -moz-margin-start: 0 !important; +} + +.findbar-find-previous:-moz-locale-dir(ltr), +.findbar-find-next:-moz-locale-dir(rtl) { + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; +} + +/* highlight button */ + +.findbar-highlight { + -moz-margin-start: 8px; +} + +.findbar-highlight > .toolbarbutton-icon { + width: 13px; + height: 8px; + margin: 0 4px; + -moz-margin-end: 0; + border: 1px solid #818181; + border-radius: 4px; + background-color: #F4F4F3; +} + + +.findbar-highlight[checked="true"] > .toolbarbutton-icon { + background-color: #FFFF00; + border-color: #818100; +} + +.find-status-icon { + display: none; +} + +.find-status-icon[status="pending"] { + display: block; + list-style-image: url("chrome://global/skin/icons/loading_16.png"); +} + +.findbar-find-status, +.found-matches { + color: #436599; + font-weight: bold; + text-shadow: 0 1px rgba(255, 255, 255, .4); + margin: 1px 1px 0 !important; + -moz-margin-start: 12px !important; +} diff --git a/toolkit/themes/osx/global/global.css b/toolkit/themes/osx/global/global.css new file mode 100644 index 0000000000..261abe3138 --- /dev/null +++ b/toolkit/themes/osx/global/global.css @@ -0,0 +1,378 @@ +/* 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/. */ + +/* all localizable skin settings shall live here */ +@import url("chrome://global/locale/intl.css"); + +%include shared.inc +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* ::::: XBL bindings ::::: */ + +menulist > menupopup { + -moz-binding: url("chrome://global/content/bindings/popup.xml#popup-scrollbars"); +} + +/* ::::: Variables ::::: */ +:root { + --arrowpanel-padding: 16px; + --arrowpanel-background: linear-gradient(hsla(0,0%,99%,1), hsla(0,0%,99%,.975) 10%, hsla(0,0%,98%,.975)); + --arrowpanel-color: hsl(0,0%,10%); + --arrowpanel-border-color: hsla(210,4%,10%,.05); + --arrowpanel-border-radius: 3.5px; +} + +/* ::::: root elements ::::: */ + +window, +page, +dialog, +wizard, +prefwindow { + -moz-appearance: dialog; + background-color: #FFFFFF; + color: -moz-DialogText; + font: message-box; +} + +prefwindow[type="child"] { + padding-top: 18px; + padding-bottom: 15px; + padding-inline-start: 18px; + padding-inline-end: 20px; +} + +/* deprecated */ +window.dialog { + padding-top: 8px; + padding-bottom: 10px; + padding-inline-start: 8px; + padding-inline-end: 10px; +} + +/* ::::: alert icons :::::*/ + +.message-icon, +.alert-icon, +.error-icon, +.question-icon { + width: 64px; + height: 64px; + margin: 6px; + margin-inline-end: 20px; +} + +.message-icon { + list-style-image: url("chrome://global/skin/icons/information-64.png"); +} + +.alert-dialog #info\.icon, +.alert-icon { + list-style-image: url("chrome://global/skin/icons/warning-64.png"); +} + +.error-icon { + list-style-image: url("chrome://global/skin/icons/error-64.png"); +} + +.question-icon { + list-style-image: url("chrome://global/skin/icons/question-64.png"); +} + +/* ::::: iframe ::::: */ + +iframe { + border: none; + width: 100px; + height: 100px; + min-width: 10px; + min-height: 10px; +} + +/* ::::: statusbar ::::: */ + +statusbar { + min-width: 1px; /* DON'T DELETE! + Prevents hiding of scrollbars in browser when window is made smaller.*/ + min-height: 15px !important; + margin: 0px !important; + /* need to use padding-inline-end when/if bug 631729 gets fixed: */ + padding: 0px 16px 1px 1px; + -moz-appearance: statusbar; + text-shadow: rgba(255, 255, 255, 0.4) 0 1px; +} + +statusbarpanel { + -moz-box-align: center; + -moz-box-pack: center; + padding: 0 4px; +} + +.statusbarpanel-iconic { + padding: 0px; +} + +/* ::::: miscellaneous formatting ::::: */ + +:root:-moz-lwtheme, +[lwthemefooter="true"] { + -moz-appearance: none; +} + +:root:-moz-lwtheme-darktext { + text-shadow: 0 -0.5px 1.5px white; +} + +:root:-moz-lwtheme-brighttext { + text-shadow: 1px 1px 1.5px black; +} + +statusbar:-moz-lwtheme { + -moz-appearance: none; + background: none; + border-style: none; + text-shadow: inherit; +} + +.inset { + border: 1px solid ThreeDShadow; + border-right-color: ThreeDHighlight; + border-bottom-color: ThreeDHighlight; + margin: 0 5px 5px; +} + +.outset { + border: 1px solid ThreeDShadow; + border-left-color: ThreeDHighlight; + border-top-color: ThreeDHighlight; +} + +separator:not([orient="vertical"]) { + height: 1.5em; +} +separator[orient="vertical"] { + width: 1.5em; +} + +separator.thin:not([orient="vertical"]) { + height: 0.5em; +} +separator.thin[orient="vertical"] { + width: 0.5em; +} + +separator.groove:not([orient="vertical"]) { + border-top: 1px solid #A3A3A3; + height: 0; + margin-top: 0.4em; + margin-bottom: 0.4em; +} +separator.groove[orient="vertical"] { + border-left: 1px solid #A3A3A3; + width: 0; + margin-left: 0.4em; + margin-right: 0.4em; +} + +.plain { + -moz-appearance: none; + margin: 0 !important; + border: none; + padding: 0; +} + +description, +label { + cursor: default; + margin-top: 1px; + margin-bottom: 2px; + margin-inline-start: 6px; + margin-inline-end: 5px; +} + +description { + margin-bottom: 4px; +} + +label[disabled="true"] { + color: GrayText; +} + +.tooltip-label { + margin: 0; +} + +.header { + font-weight: bold; +} + +.monospace { + font-family: monospace; +} + +.indent { + margin-inline-start: 23px; +} + +.box-padded { + padding: 5px; +} + +.spaced { + margin: 3px 5px 4px; +} + +.wizard-box { + padding: 20px 44px 10px; +} + +.text-link { + color: -moz-nativehyperlinktext; + cursor: pointer; +} + +.text-link:hover { + text-decoration: underline; +} + +.text-link:-moz-focusring { + box-shadow: @focusRingShadow@; +} + +.toolbar-focustarget { + -moz-user-focus: ignore !important; +} + +notification > button { + margin: 0 3px; + padding: 1px 10px; + min-width: 60px; + min-height: 16px; + -moz-appearance: none; + border-radius: 10000px; + border: @roundButtonBorder@; + text-shadow: @loweredShadow@; + background: @roundButtonBackground@; + box-shadow: @roundButtonShadow@; +} + +notification > button:active:hover { + background: @roundButtonPressedBackground@; + box-shadow: @roundButtonPressedShadow@; +} + +notification > button:-moz-focusring { + box-shadow: @focusRingShadow@, @roundButtonShadow@; +} + +notification > button:active:hover:-moz-focusring { + box-shadow: @focusRingShadow@, @roundButtonPressedShadow@; +} + +notification > button > .button-box > .button-text { + margin: 0 !important; +} + +popupnotificationcontent { + margin-top: .5em; +} + +/* :::::: autoscroll popup ::::: */ + +.autoscroller { + height: 28px; + width: 28px; + border: none; + margin: -14px; + padding: 0; + background-image: url("chrome://global/skin/icons/autoscroll.png"); + background-color: transparent; + background-position: right top; + -moz-appearance: none; + -moz-window-shadow: none; +} + +.autoscroller[scrolldir="NS"] { + background-position: right center; +} + +.autoscroller[scrolldir="EW"] { + background-position: right bottom; +} + +/* autorepeatbuttons in menus */ + +.popup-internal-box > autorepeatbutton { + height: 15px; + position: relative; + list-style-image: none; + /* Here we're using a little magic. + * The arrow button is supposed to overlay the scrollbox, blocking + * everything under it from reaching the screen. However, the menu background + * is slightly transparent, so how can we block something completely without + * messing up the transparency? It's easy: The native theming of the + * "menuitem" appearance uses CGContextClearRect before drawing, which + * clears everything under it. + * Without help from native theming this effect wouldn't be achievable. + */ + -moz-appearance: menuitem; +} + +.popup-internal-box > .autorepeatbutton-up { + padding-top: 1px; /* 4px padding-top from the .popup-internal-box. */ + margin-bottom: -15px; +} + +.popup-internal-box > .autorepeatbutton-up > .autorepeatbutton-icon { + -moz-appearance: button-arrow-up; +} + +.popup-internal-box > .autorepeatbutton-down { + padding-top: 5px; + margin-top: -15px; +} + +.popup-internal-box > .autorepeatbutton-down > .autorepeatbutton-icon { + -moz-appearance: button-arrow-down; +} + +.popup-internal-box > autorepeatbutton[disabled="true"] { + visibility: collapse; +} + +/* :::::: Close button icons ::::: */ + +.close-icon { + list-style-image: url("chrome://global/skin/icons/close.png"); + -moz-image-region: rect(0, 16px, 16px, 0); +} + +.close-icon:hover { + -moz-image-region: rect(0, 32px, 16px, 16px); +} + +.close-icon:hover:active { + -moz-image-region: rect(0, 48px, 16px, 32px); +} + +@media (min-resolution: 2dppx) { + .close-icon > .button-icon, + .close-icon > .button-box > .button-icon, + .close-icon > .toolbarbutton-icon { + width: 16px; + } + + .close-icon { + list-style-image: url("chrome://global/skin/icons/close@2x.png"); + -moz-image-region: rect(0, 32px, 32px, 0); + } + + .close-icon:hover { + -moz-image-region: rect(0, 64px, 32px, 32px); + } + + .close-icon:hover:active { + -moz-image-region: rect(0, 96px, 32px, 64px); + } +} diff --git a/toolkit/themes/osx/global/groupbox.css b/toolkit/themes/osx/global/groupbox.css new file mode 100644 index 0000000000..8406458278 --- /dev/null +++ b/toolkit/themes/osx/global/groupbox.css @@ -0,0 +1,30 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +groupbox { + padding: 5px 1px 1px; + padding-inline-start: 0; + margin: 6px; +} + +.groupbox-body { + -moz-appearance: groupbox; + padding: 8px 8px 3px; + margin: 0; +} + +caption { + padding-inline-start: 4px; + padding-bottom: 1px; + font: caption; +} + +/* !important is needed to override label in global.css */ +.caption-text { + margin-top: 0 !important; + margin-bottom: 0 !important; + margin-inline-start: 1px !important; +} diff --git a/toolkit/themes/osx/global/icons/Error.png b/toolkit/themes/osx/global/icons/Error.png Binary files differnew file mode 100644 index 0000000000..424ebfd4ad --- /dev/null +++ b/toolkit/themes/osx/global/icons/Error.png diff --git a/toolkit/themes/osx/global/icons/autocomplete-dropmarker.png b/toolkit/themes/osx/global/icons/autocomplete-dropmarker.png Binary files differnew file mode 100644 index 0000000000..e48d044526 --- /dev/null +++ b/toolkit/themes/osx/global/icons/autocomplete-dropmarker.png diff --git a/toolkit/themes/osx/global/icons/autocomplete-search.svg b/toolkit/themes/osx/global/icons/autocomplete-search.svg new file mode 100644 index 0000000000..3d1795d29d --- /dev/null +++ b/toolkit/themes/osx/global/icons/autocomplete-search.svg @@ -0,0 +1,22 @@ +<?xml version="1.0"?>
+<!-- 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/. -->
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 16 16">
+ <style>
+ use:not(:target) {
+ display: none;
+ }
+ use {
+ fill: GrayText;
+ }
+ use[id$="-inverted"] {
+ fill: highlighttext;
+ }
+ </style>
+ <defs>
+ <path id="search" fill-rule="evenodd" d="M14.517,12.884l-3.279-3.287c0.545-0.851,0.864-1.861,0.864-2.947 c0-3.022-2.444-5.472-5.458-5.472c-3.014,0-5.458,2.45-5.458,5.472c0,3.022,2.444,5.471,5.458,5.471 c1.093,0,2.108-0.325,2.962-0.88l3.275,3.283c0.396,0.397,1.039,0.397,1.435,0l0.202-0.202 C14.913,13.925,14.913,13.281,14.517,12.884z M6.644,10.001c-1.846,0-3.344-1.501-3.344-3.352c0-1.851,1.497-3.352,3.344-3.352 c1.847,0,3.344,1.501,3.344,3.352C9.987,8.501,8.49,10.001,6.644,10.001z"/>
+ </defs>
+ <use id="search-icon" xlink:href="#search"/>
+ <use id="search-icon-inverted" xlink:href="#search"/>
+</svg>
diff --git a/toolkit/themes/osx/global/icons/autoscroll.png b/toolkit/themes/osx/global/icons/autoscroll.png Binary files differnew file mode 100644 index 0000000000..c21e067d9a --- /dev/null +++ b/toolkit/themes/osx/global/icons/autoscroll.png diff --git a/toolkit/themes/osx/global/icons/blacklist_64.png b/toolkit/themes/osx/global/icons/blacklist_64.png Binary files differnew file mode 100644 index 0000000000..90555a93bf --- /dev/null +++ b/toolkit/themes/osx/global/icons/blacklist_64.png diff --git a/toolkit/themes/osx/global/icons/blacklist_favicon.png b/toolkit/themes/osx/global/icons/blacklist_favicon.png Binary files differnew file mode 100644 index 0000000000..e67d3d34f0 --- /dev/null +++ b/toolkit/themes/osx/global/icons/blacklist_favicon.png diff --git a/toolkit/themes/osx/global/icons/checkbox.png b/toolkit/themes/osx/global/icons/checkbox.png Binary files differnew file mode 100644 index 0000000000..137e4e801f --- /dev/null +++ b/toolkit/themes/osx/global/icons/checkbox.png diff --git a/toolkit/themes/osx/global/icons/checkbox@2x.png b/toolkit/themes/osx/global/icons/checkbox@2x.png Binary files differnew file mode 100644 index 0000000000..61bcc59c7d --- /dev/null +++ b/toolkit/themes/osx/global/icons/checkbox@2x.png diff --git a/toolkit/themes/osx/global/icons/chevron-inverted.png b/toolkit/themes/osx/global/icons/chevron-inverted.png Binary files differnew file mode 100644 index 0000000000..8ad164baaf --- /dev/null +++ b/toolkit/themes/osx/global/icons/chevron-inverted.png diff --git a/toolkit/themes/osx/global/icons/chevron-inverted@2x.png b/toolkit/themes/osx/global/icons/chevron-inverted@2x.png Binary files differnew file mode 100644 index 0000000000..4327a1a457 --- /dev/null +++ b/toolkit/themes/osx/global/icons/chevron-inverted@2x.png diff --git a/toolkit/themes/osx/global/icons/chevron.png b/toolkit/themes/osx/global/icons/chevron.png Binary files differnew file mode 100644 index 0000000000..b2d31e38f5 --- /dev/null +++ b/toolkit/themes/osx/global/icons/chevron.png diff --git a/toolkit/themes/osx/global/icons/chevron@2x.png b/toolkit/themes/osx/global/icons/chevron@2x.png Binary files differnew file mode 100644 index 0000000000..dd91178030 --- /dev/null +++ b/toolkit/themes/osx/global/icons/chevron@2x.png diff --git a/toolkit/themes/osx/global/icons/close.png b/toolkit/themes/osx/global/icons/close.png Binary files differnew file mode 100644 index 0000000000..9bba044ce5 --- /dev/null +++ b/toolkit/themes/osx/global/icons/close.png diff --git a/toolkit/themes/osx/global/icons/close@2x.png b/toolkit/themes/osx/global/icons/close@2x.png Binary files differnew file mode 100755 index 0000000000..01c5ef4232 --- /dev/null +++ b/toolkit/themes/osx/global/icons/close@2x.png diff --git a/toolkit/themes/osx/global/icons/error-16.png b/toolkit/themes/osx/global/icons/error-16.png Binary files differnew file mode 100644 index 0000000000..41514d0806 --- /dev/null +++ b/toolkit/themes/osx/global/icons/error-16.png diff --git a/toolkit/themes/osx/global/icons/error-64.png b/toolkit/themes/osx/global/icons/error-64.png Binary files differnew file mode 100644 index 0000000000..972abaff3b --- /dev/null +++ b/toolkit/themes/osx/global/icons/error-64.png diff --git a/toolkit/themes/osx/global/icons/error-large.png b/toolkit/themes/osx/global/icons/error-large.png Binary files differnew file mode 100644 index 0000000000..5a1479e28b --- /dev/null +++ b/toolkit/themes/osx/global/icons/error-large.png diff --git a/toolkit/themes/osx/global/icons/glyph-dropdown.png b/toolkit/themes/osx/global/icons/glyph-dropdown.png Binary files differnew file mode 100644 index 0000000000..fa08515836 --- /dev/null +++ b/toolkit/themes/osx/global/icons/glyph-dropdown.png diff --git a/toolkit/themes/osx/global/icons/glyph-dropdown@2x.png b/toolkit/themes/osx/global/icons/glyph-dropdown@2x.png Binary files differnew file mode 100644 index 0000000000..653039a3e6 --- /dev/null +++ b/toolkit/themes/osx/global/icons/glyph-dropdown@2x.png diff --git a/toolkit/themes/osx/global/icons/information-16.png b/toolkit/themes/osx/global/icons/information-16.png Binary files differnew file mode 100644 index 0000000000..6fb2e3a804 --- /dev/null +++ b/toolkit/themes/osx/global/icons/information-16.png diff --git a/toolkit/themes/osx/global/icons/information-24.png b/toolkit/themes/osx/global/icons/information-24.png Binary files differnew file mode 100644 index 0000000000..6907d02e5f --- /dev/null +++ b/toolkit/themes/osx/global/icons/information-24.png diff --git a/toolkit/themes/osx/global/icons/information-32.png b/toolkit/themes/osx/global/icons/information-32.png Binary files differnew file mode 100644 index 0000000000..4501bc813a --- /dev/null +++ b/toolkit/themes/osx/global/icons/information-32.png diff --git a/toolkit/themes/osx/global/icons/information-64.png b/toolkit/themes/osx/global/icons/information-64.png Binary files differnew file mode 100644 index 0000000000..8d9b72498e --- /dev/null +++ b/toolkit/themes/osx/global/icons/information-64.png diff --git a/toolkit/themes/osx/global/icons/information-large.png b/toolkit/themes/osx/global/icons/information-large.png Binary files differnew file mode 100644 index 0000000000..3912f1c79a --- /dev/null +++ b/toolkit/themes/osx/global/icons/information-large.png diff --git a/toolkit/themes/osx/global/icons/loading_16.png b/toolkit/themes/osx/global/icons/loading_16.png Binary files differnew file mode 100644 index 0000000000..1b2df8093d --- /dev/null +++ b/toolkit/themes/osx/global/icons/loading_16.png diff --git a/toolkit/themes/osx/global/icons/menulist-dropmarker.png b/toolkit/themes/osx/global/icons/menulist-dropmarker.png Binary files differnew file mode 100644 index 0000000000..689a1fe877 --- /dev/null +++ b/toolkit/themes/osx/global/icons/menulist-dropmarker.png diff --git a/toolkit/themes/osx/global/icons/notfound.png b/toolkit/themes/osx/global/icons/notfound.png Binary files differnew file mode 100644 index 0000000000..694dae910e --- /dev/null +++ b/toolkit/themes/osx/global/icons/notfound.png diff --git a/toolkit/themes/osx/global/icons/notloading_16.png b/toolkit/themes/osx/global/icons/notloading_16.png Binary files differnew file mode 100644 index 0000000000..ece0ee18a1 --- /dev/null +++ b/toolkit/themes/osx/global/icons/notloading_16.png diff --git a/toolkit/themes/osx/global/icons/panebutton-active.png b/toolkit/themes/osx/global/icons/panebutton-active.png Binary files differnew file mode 100644 index 0000000000..ca241c7b8a --- /dev/null +++ b/toolkit/themes/osx/global/icons/panebutton-active.png diff --git a/toolkit/themes/osx/global/icons/panebutton-inactive.png b/toolkit/themes/osx/global/icons/panebutton-inactive.png Binary files differnew file mode 100644 index 0000000000..de527b6627 --- /dev/null +++ b/toolkit/themes/osx/global/icons/panebutton-inactive.png diff --git a/toolkit/themes/osx/global/icons/panel-dropmarker.png b/toolkit/themes/osx/global/icons/panel-dropmarker.png Binary files differnew file mode 100644 index 0000000000..e605e835c7 --- /dev/null +++ b/toolkit/themes/osx/global/icons/panel-dropmarker.png diff --git a/toolkit/themes/osx/global/icons/question-16.png b/toolkit/themes/osx/global/icons/question-16.png Binary files differnew file mode 100644 index 0000000000..8d8311fced --- /dev/null +++ b/toolkit/themes/osx/global/icons/question-16.png diff --git a/toolkit/themes/osx/global/icons/question-32.png b/toolkit/themes/osx/global/icons/question-32.png Binary files differnew file mode 100644 index 0000000000..7c80831b04 --- /dev/null +++ b/toolkit/themes/osx/global/icons/question-32.png diff --git a/toolkit/themes/osx/global/icons/question-64.png b/toolkit/themes/osx/global/icons/question-64.png Binary files differnew file mode 100644 index 0000000000..96fd746409 --- /dev/null +++ b/toolkit/themes/osx/global/icons/question-64.png diff --git a/toolkit/themes/osx/global/icons/question-large.png b/toolkit/themes/osx/global/icons/question-large.png Binary files differnew file mode 100644 index 0000000000..dd2b21874b --- /dev/null +++ b/toolkit/themes/osx/global/icons/question-large.png diff --git a/toolkit/themes/osx/global/icons/resizer-rtl.png b/toolkit/themes/osx/global/icons/resizer-rtl.png Binary files differnew file mode 100644 index 0000000000..6ab7d33457 --- /dev/null +++ b/toolkit/themes/osx/global/icons/resizer-rtl.png diff --git a/toolkit/themes/osx/global/icons/resizer-rtl@2x.png b/toolkit/themes/osx/global/icons/resizer-rtl@2x.png Binary files differnew file mode 100644 index 0000000000..6c85d4f332 --- /dev/null +++ b/toolkit/themes/osx/global/icons/resizer-rtl@2x.png diff --git a/toolkit/themes/osx/global/icons/resizer.png b/toolkit/themes/osx/global/icons/resizer.png Binary files differnew file mode 100644 index 0000000000..efed0240b8 --- /dev/null +++ b/toolkit/themes/osx/global/icons/resizer.png diff --git a/toolkit/themes/osx/global/icons/resizer@2x.png b/toolkit/themes/osx/global/icons/resizer@2x.png Binary files differnew file mode 100644 index 0000000000..2304cc65fe --- /dev/null +++ b/toolkit/themes/osx/global/icons/resizer@2x.png diff --git a/toolkit/themes/osx/global/icons/search-textbox.svg b/toolkit/themes/osx/global/icons/search-textbox.svg new file mode 100644 index 0000000000..12be833c40 --- /dev/null +++ b/toolkit/themes/osx/global/icons/search-textbox.svg @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- 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/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"> + <style> + path { + fill: #4c4c4c; + fill-rule: evenodd; + } + </style> + <path id="glyph-search" d="M11.354,10.646l-0.707.707L7.295,8A4.483,4.483,0,1,1,9,4.5,4.458,4.458,0,0,1,8,7.295ZM4.5,1A3.5,3.5,0,1,0,8,4.5,3.5,3.5,0,0,0,4.5,1Z"/> +</svg> diff --git a/toolkit/themes/osx/global/icons/searchfield-cancel.svg b/toolkit/themes/osx/global/icons/searchfield-cancel.svg new file mode 100644 index 0000000000..9899144e95 --- /dev/null +++ b/toolkit/themes/osx/global/icons/searchfield-cancel.svg @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- 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/. --> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14" viewBox="0 0 14 14"> + <style> + circle { + fill: #808080; + } + + line { + stroke: #fff; + stroke-width: 1.5px; + } + </style> + + <circle cx="7" cy="7" r="7" /> + <line x1="4" y1="4" x2="10" y2="10" /> + <line x1="10" y1="4" x2="4" y2="10" /> +</svg>
\ No newline at end of file diff --git a/toolkit/themes/osx/global/icons/sslWarning.png b/toolkit/themes/osx/global/icons/sslWarning.png Binary files differnew file mode 100644 index 0000000000..e8ad586b6e --- /dev/null +++ b/toolkit/themes/osx/global/icons/sslWarning.png diff --git a/toolkit/themes/osx/global/icons/tabprompts-bgtexture.png b/toolkit/themes/osx/global/icons/tabprompts-bgtexture.png Binary files differnew file mode 100644 index 0000000000..caffc241cf --- /dev/null +++ b/toolkit/themes/osx/global/icons/tabprompts-bgtexture.png diff --git a/toolkit/themes/osx/global/icons/warning-16.png b/toolkit/themes/osx/global/icons/warning-16.png Binary files differnew file mode 100644 index 0000000000..2ab4b3915e --- /dev/null +++ b/toolkit/themes/osx/global/icons/warning-16.png diff --git a/toolkit/themes/osx/global/icons/warning-32.png b/toolkit/themes/osx/global/icons/warning-32.png Binary files differnew file mode 100644 index 0000000000..750abaa220 --- /dev/null +++ b/toolkit/themes/osx/global/icons/warning-32.png diff --git a/toolkit/themes/osx/global/icons/warning-64.png b/toolkit/themes/osx/global/icons/warning-64.png Binary files differnew file mode 100644 index 0000000000..37d2120538 --- /dev/null +++ b/toolkit/themes/osx/global/icons/warning-64.png diff --git a/toolkit/themes/osx/global/icons/warning-large.png b/toolkit/themes/osx/global/icons/warning-large.png Binary files differnew file mode 100644 index 0000000000..73fd65f6fa --- /dev/null +++ b/toolkit/themes/osx/global/icons/warning-large.png diff --git a/toolkit/themes/osx/global/in-content/common.css b/toolkit/themes/osx/global/in-content/common.css new file mode 100644 index 0000000000..a987cbfe1f --- /dev/null +++ b/toolkit/themes/osx/global/in-content/common.css @@ -0,0 +1,121 @@ +/* - 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/. */ + +%include ../shared.inc +%include ../../../shared/in-content/common.inc.css + +xul|tabs { + padding-right: 0; + padding-left: 0; +} + +xul|tab[visuallyselected] { + text-shadow: none; +} + +xul|button, +html|button, +xul|colorpicker[type="button"], +xul|menulist { + margin-top: 3px; +} + +xul|button, +html|button { + /* use the same margin of other elements for the alignment */ + margin-left: 4px; + margin-right: 4px; +} + +xul|caption { + padding-inline-start: 0; +} + +xul|groupbox > xul|*.groupbox-body { + padding: 0; +} + +xul|menulist:not([editable="true"]) > xul|menupopup > xul|menuitem[checked="true"]::before, +xul|menulist:not([editable="true"]) > xul|menupopup > xul|menuitem[selected="true"]::before { + display: none; +} + +xul|menulist:not([editable="true"]) > xul|*.menulist-dropmarker { + display: -moz-box; + margin-top: 1px; + margin-bottom: 1px; +} + +xul|menulist > xul|menupopup xul|menu, +xul|menulist > xul|menupopup xul|menuitem, +xul|button[type="menu"] > xul|menupopup xul|menu, +xul|button[type="menu"] > xul|menupopup xul|menuitem { + padding-inline-end: 34px; +} + +xul|*.help-button > xul|*.button-box > xul|*.button-icon { + margin-inline-start: 0; +} + +xul|*.checkbox-icon { + margin-right: 0; +} + +xul|*.radio-icon { + margin-inline-end: 0; +} + +xul|*.numberbox-input-box { + -moz-appearance: none; + border-width: 0; +} + +xul|description { + font-size: 1.25rem; + line-height: 22px; +} + +xul|*.text-link:-moz-focusring { + color: var(--in-content-link-highlight); + text-decoration: underline; + box-shadow: none; +} + +xul|button:-moz-focusring, +xul|menulist:-moz-focusring, +xul|checkbox:-moz-focusring > .checkbox-check, +html|input[type="checkbox"]:-moz-focusring + html|label:before, +xul|radio[focused="true"] > .radio-check, +xul|tab:-moz-focusring > .tab-middle > .tab-text { + outline: 2px solid rgba(0,149,221,0.5); + outline-offset: 1px; + -moz-outline-radius: 2px; +} + +xul|radio[focused="true"] > .radio-check { + -moz-outline-radius: 100%; +} + +xul|spinbuttons { + -moz-appearance: none; +} + +xul|*.spinbuttons-up { + margin-top: 0 !important; + border-radius: 4px 4px 0 0; +} + +xul|*.spinbuttons-down { + margin-bottom: 0 !important; + border-radius: 0 0 4px 4px; +} + +xul|*.spinbuttons-button > xul|*.button-box { + padding-inline-start: 2px !important; + padding-inline-end: 3px !important; +} + +xul|*.spinbuttons-button > xul|*.button-box > xul|*.button-text { + display: none; +} diff --git a/toolkit/themes/osx/global/in-content/info-pages.css b/toolkit/themes/osx/global/in-content/info-pages.css new file mode 100644 index 0000000000..a25b9f6a3d --- /dev/null +++ b/toolkit/themes/osx/global/in-content/info-pages.css @@ -0,0 +1 @@ +%include ../../../shared/in-content/info-pages.inc.css
\ No newline at end of file diff --git a/toolkit/themes/osx/global/inContentUI.css b/toolkit/themes/osx/global/inContentUI.css new file mode 100644 index 0000000000..17e2e6ae33 --- /dev/null +++ b/toolkit/themes/osx/global/inContentUI.css @@ -0,0 +1,144 @@ +/* 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/. */ + +%include shared.inc + +/* + * The default namespace for this file is XUL. Be sure to prefix rules that + * are applicable to both XUL and HTML with '*|'. + */ +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); +@namespace html url("http://www.w3.org/1999/xhtml"); + +/* Page background */ +*|*:root { + -moz-appearance: none; + padding: 18px; + background-image: /* Texture */ + url("chrome://global/skin/inContentUI/background-texture.png"), + /* Gradient */ + linear-gradient(#ADB5C2, #BFC6D1); +} + +/* Use the new in-content colors for #contentAreaDownloadsView. After landing + of bug 989469 the colors can be moved to *|*:root */ +*|*#contentAreaDownloadsView { + background: #f1f1f1; + color: #424e5a; +} + +html|html { + font: message-box; +} + +/* Content */ +*|*.main-content { + /* Needed to allow the radius to clip the inner content, see bug 595656 */ + overflow: hidden; + background-image: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.25) 50%, rgba(255, 255, 255, 0.05)); + border: 1px solid rgba(50, 65, 92, 0.4); + border-radius: 5px; +} + +/* Buttons */ +*|button, +menulist, +colorpicker[type="button"] { + -moz-appearance: none; + padding: 1px 4px; + min-width: 60px; + border-radius: 3px; + border: 1px solid rgba(60,73,97,0.5); + box-shadow: inset 0 1px rgba(255,255,255,0.25), 0 1px rgba(255,255,255,0.25); + background-color: transparent; + background-image: linear-gradient(rgba(255,255,255,0.45), rgba(255,255,255,0.2)); + background-clip: padding-box; + color: #252F3B; + text-shadow: @loweredShadow@; +} + +button:-moz-focusring > .button-box, +menulist:-moz-focusring:not([open="true"]) > .menulist-label-box, +colorpicker[type="button"]:-moz-focusring:not([open="true"]) > .colorpicker-button-colorbox { + outline: 1px dotted #252F3B; +} + +html|button[disabled], +button[disabled="true"], +menulist[disabled="true"], +colorpicker[type="button"][disabled="true"] { + opacity: 0.8; + color: #505050; +} + +html|button:not([disabled]):active:hover, +button:not([disabled="true"]):active:hover, +menulist[open="true"]:not([disabled="true"]), +colorpicker[type="button"][open="true"]:not([disabled="true"]) { + box-shadow: inset 0 1px 3px rgba(0,0,0,.2), 0 1px rgba(255,255,255,0.25); + background-image: linear-gradient(rgba(45,54,71,0.3), rgba(45,54,71,0.1)); + border-color: rgba(60,73,97,0.7); +} + +menulist { + -moz-padding-end: 0; + margin-left: 5px; + margin-right: 5px; +} + +/* Tweak margins so the focus ring is in the right place. */ +menulist > .menulist-label-box { + -moz-margin-end: 3px; + margin-top: 1px; +} + +menulist > .menulist-label-box > .menulist-label { + margin-top: 0px !important; + margin-bottom: 0px !important; +} + +menulist > .menulist-dropmarker { + -moz-appearance: none; + display: -moz-box; + background: transparent; + border: none; + -moz-border-start: 1px solid rgba(60,73,97,0.5); + margin-top: -1px; + margin-bottom: -1px; +} + +colorpicker[type="button"] { + margin: 1px 5px 2px 5px; + padding: 3px; + height: 25px; +} + +spinbuttons { + -moz-appearance: none; +} + +spinbuttons > .spinbuttons-box > .spinbuttons-button { + min-width: 12px; +} + +.spinbuttons-button > .button-box > .button-text { + display: none; +} + +.spinbuttons-button[disabled="true"] > .button-box > .button-icon { + opacity: 0.5; +} + +spinbuttons > .spinbuttons-box > .spinbuttons-up { + list-style-image: url("chrome://global/skin/arrow/arrow-up.gif"); + border-bottom-width: 0; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; +} + +spinbuttons > .spinbuttons-box > .spinbuttons-down { + list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif"); + border-top-left-radius: 0; + border-top-right-radius: 0; +} diff --git a/toolkit/themes/osx/global/jar.mn b/toolkit/themes/osx/global/jar.mn new file mode 100644 index 0000000000..9ca73cc6bc --- /dev/null +++ b/toolkit/themes/osx/global/jar.mn @@ -0,0 +1,156 @@ +# 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/. + +#include ../../shared/jar.inc.mn + +toolkit.jar: + skin/classic/global/10pct_transparent_grey.png + skin/classic/global/50pct_transparent_grey.png + skin/classic/global/arrow.css + skin/classic/global/autocomplete.css + skin/classic/global/button.css + skin/classic/global/checkbox.css + skin/classic/global/colorpicker.css + skin/classic/global/commonDialog.css + skin/classic/global/customizeToolbar.css + skin/classic/global/dialog.css + skin/classic/global/dropmarker.css + skin/classic/global/filefield.css + skin/classic/global/filters.svg +* skin/classic/global/findBar.css +* skin/classic/global/global.css + skin/classic/global/groupbox.css +* skin/classic/global/inContentUI.css + skin/classic/global/linkTree.css + skin/classic/global/listbox.css + skin/classic/global/menu.css + skin/classic/global/menulist.css +* skin/classic/global/notification.css + skin/classic/global/netError.css + skin/classic/global/numberbox.css + skin/classic/global/popup.css + skin/classic/global/preferences.css + skin/classic/global/progressmeter.css + skin/classic/global/radio.css + skin/classic/global/resizer.css + skin/classic/global/richlistbox.css + skin/classic/global/scrollbars.css (nativescrollbars.css) + skin/classic/global/scale.css + skin/classic/global/scrollbox.css + skin/classic/global/spinbuttons.css + skin/classic/global/splitter.css + skin/classic/global/tabprompts.css + skin/classic/global/tabbox.css + skin/classic/global/textbox.css + skin/classic/global/datetimepicker.css +* skin/classic/global/toolbar.css + skin/classic/global/toolbarbutton.css +* skin/classic/global/tree.css +* skin/classic/global/viewbuttons.css + skin/classic/global/wizard.css + skin/classic/global/alerts/alert.css (alerts/alert.css) + skin/classic/global/arrow/arrow-dn-dis.gif (arrow/arrow-dn-dis.gif) + skin/classic/global/arrow/arrow-dn-dis.png (arrow/arrow-dn-dis.png) + skin/classic/global/arrow/arrow-dn-sharp.gif (arrow/arrow-dn-sharp.gif) + skin/classic/global/arrow/arrow-dn.gif (arrow/arrow-dn.gif) + skin/classic/global/arrow/arrow-dn.png (arrow/arrow-dn.png) + skin/classic/global/arrow/arrow-lft-dis.gif (arrow/arrow-lft-dis.gif) + skin/classic/global/arrow/arrow-lft-hov.gif (arrow/arrow-lft-hov.gif) + skin/classic/global/arrow/arrow-lft-sharp-end.gif (arrow/arrow-lft-sharp-end.gif) + skin/classic/global/arrow/arrow-lft-sharp.gif (arrow/arrow-lft-sharp.gif) + skin/classic/global/arrow/arrow-lft.gif (arrow/arrow-lft.gif) + skin/classic/global/arrow/arrow-rit-dis.gif (arrow/arrow-rit-dis.gif) + skin/classic/global/arrow/arrow-rit-hov.gif (arrow/arrow-rit-hov.gif) + skin/classic/global/arrow/arrow-rit-sharp-end.gif (arrow/arrow-rit-sharp-end.gif) + skin/classic/global/arrow/arrow-rit-sharp.gif (arrow/arrow-rit-sharp.gif) + skin/classic/global/arrow/arrow-rit.gif (arrow/arrow-rit.gif) + skin/classic/global/arrow/arrow-up-dis.gif (arrow/arrow-up-dis.gif) + skin/classic/global/arrow/arrow-up-sharp.gif (arrow/arrow-up-sharp.gif) + skin/classic/global/arrow/arrow-up.gif (arrow/arrow-up.gif) + skin/classic/global/arrow/panelarrow-horizontal.png (arrow/panelarrow-horizontal.png) + skin/classic/global/arrow/panelarrow-horizontal@2x.png (arrow/panelarrow-horizontal@2x.png) + skin/classic/global/arrow/panelarrow-vertical.png (arrow/panelarrow-vertical.png) + skin/classic/global/arrow/panelarrow-vertical@2x.png (arrow/panelarrow-vertical@2x.png) + skin/classic/global/checkbox/cbox-check.gif (checkbox/cbox-check.gif) + skin/classic/global/checkbox/cbox-check-dis.gif (checkbox/cbox-check-dis.gif) + skin/classic/global/console/console-error-caret.gif (console/console-error-caret.gif) + skin/classic/global/console/console-error-dash.gif (console/console-error-dash.gif) +* skin/classic/global/console/console.css (console/console.css) + skin/classic/global/dirListing/dirListing.css (dirListing/dirListing.css) + skin/classic/global/dirListing/folder.png (dirListing/folder.png) + skin/classic/global/dirListing/remote.png (dirListing/remote.png) + skin/classic/global/dirListing/up.png (dirListing/up.png) + skin/classic/global/icons/autocomplete-dropmarker.png (icons/autocomplete-dropmarker.png) + skin/classic/global/icons/autocomplete-search.svg (icons/autocomplete-search.svg) + skin/classic/global/icons/autoscroll.png (icons/autoscroll.png) + skin/classic/global/icons/blacklist_favicon.png (icons/blacklist_favicon.png) + skin/classic/global/icons/blacklist_64.png (icons/blacklist_64.png) + skin/classic/global/icons/chevron.png (icons/chevron.png) + skin/classic/global/icons/chevron-inverted.png (icons/chevron-inverted.png) + skin/classic/global/icons/chevron@2x.png (icons/chevron@2x.png) + skin/classic/global/icons/chevron-inverted@2x.png (icons/chevron-inverted@2x.png) + skin/classic/global/icons/checkbox.png (icons/checkbox.png) + skin/classic/global/icons/checkbox@2x.png (icons/checkbox@2x.png) + skin/classic/global/icons/close.png (icons/close.png) + skin/classic/global/icons/close@2x.png (icons/close@2x.png) + skin/classic/global/icons/glyph-dropdown.png (icons/glyph-dropdown.png) + skin/classic/global/icons/glyph-dropdown@2x.png (icons/glyph-dropdown@2x.png) + skin/classic/global/icons/information-16.png (icons/information-16.png) + skin/classic/global/icons/information-24.png (icons/information-24.png) + skin/classic/global/icons/information-32.png (icons/information-32.png) + skin/classic/global/icons/information-64.png (icons/information-64.png) + skin/classic/global/icons/information-large.png (icons/information-large.png) + skin/classic/global/icons/loading_16.png (icons/loading_16.png) + skin/classic/global/icons/menulist-dropmarker.png (icons/menulist-dropmarker.png) + skin/classic/global/icons/notfound.png (icons/notfound.png) + skin/classic/global/icons/notloading_16.png (icons/notloading_16.png) + skin/classic/global/icons/panebutton-active.png (icons/panebutton-active.png) + skin/classic/global/icons/panebutton-inactive.png (icons/panebutton-inactive.png) + skin/classic/global/icons/panel-dropmarker.png (icons/panel-dropmarker.png) + skin/classic/global/icons/resizer.png (icons/resizer.png) + skin/classic/global/icons/resizer@2x.png (icons/resizer@2x.png) + skin/classic/global/icons/resizer-rtl.png (icons/resizer-rtl.png) + skin/classic/global/icons/resizer-rtl@2x.png (icons/resizer-rtl@2x.png) + skin/classic/global/icons/search-textbox.svg (icons/search-textbox.svg) + skin/classic/global/icons/searchfield-cancel.svg (icons/searchfield-cancel.svg) + skin/classic/global/icons/tabprompts-bgtexture.png (icons/tabprompts-bgtexture.png) + skin/classic/global/icons/warning-16.png (icons/warning-16.png) + skin/classic/global/icons/warning-32.png (icons/warning-32.png) + skin/classic/global/icons/warning-64.png (icons/warning-64.png) + skin/classic/global/icons/warning-large.png (icons/warning-large.png) + skin/classic/global/icons/error-16.png (icons/error-16.png) + skin/classic/global/icons/error-64.png (icons/error-64.png) + skin/classic/global/icons/error-large.png (icons/error-large.png) + skin/classic/global/icons/Error.png (icons/Error.png) + skin/classic/global/icons/question-16.png (icons/question-16.png) + skin/classic/global/icons/question-32.png (icons/question-32.png) + skin/classic/global/icons/question-64.png (icons/question-64.png) + skin/classic/global/icons/question-large.png (icons/question-large.png) + skin/classic/global/icons/sslWarning.png (icons/sslWarning.png) + skin/classic/global/notification/close.png (notification/close.png) + skin/classic/global/notification/error-icon.png (notification/error-icon.png) + skin/classic/global/notification/info-icon.png (notification/info-icon.png) + skin/classic/global/notification/warning-icon.png (notification/warning-icon.png) +* skin/classic/global/in-content/common.css (in-content/common.css) +* skin/classic/global/in-content/info-pages.css (in-content/info-pages.css) + skin/classic/global/scale/scale-tray-horiz.gif (scale/scale-tray-horiz.gif) + skin/classic/global/scale/scale-tray-vert.gif (scale/scale-tray-vert.gif) + skin/classic/global/splitter/dimple.png (splitter/dimple.png) + skin/classic/global/splitter/grip-bottom.gif (splitter/grip-bottom.gif) + skin/classic/global/splitter/grip-top.gif (splitter/grip-top.gif) + skin/classic/global/splitter/grip-left.gif (splitter/grip-left.gif) + skin/classic/global/splitter/grip-right.gif (splitter/grip-right.gif) + skin/classic/global/toolbar/spring.png (toolbar/spring.png) + skin/classic/global/toolbar/toolbar-separator.png (toolbar/toolbar-separator.png) + skin/classic/global/tree/arrow-disclosure.svg (tree/arrow-disclosure.svg) + skin/classic/global/tree/columnpicker.gif (tree/columnpicker.gif) + skin/classic/global/tree/folder.png (tree/folder.png) + skin/classic/global/tree/folder@2x.png (tree/folder@2x.png) + +#ifdef MOZ_PHOENIX +[browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar: +#elif MOZ_SEPARATE_MANIFEST_FOR_THEME_OVERRIDES +[extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar: +#endif +% override chrome://global/skin/dirListing/local.png chrome://global/skin/dirListing/folder.png diff --git a/toolkit/themes/osx/global/linkTree.css b/toolkit/themes/osx/global/linkTree.css new file mode 100644 index 0000000000..d83c5bfd9d --- /dev/null +++ b/toolkit/themes/osx/global/linkTree.css @@ -0,0 +1,32 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/** + * All the properties in this rule are important to avoid having to create + * a special type of tree. This stylesheet can be loaded into a document with + * a single tree that is a link tree. Hardly elegant but it's efficient. + */ +treeitem[selected="true"] > treerow + { + background : transparent !important; + border : none !important; + color : -moz-FieldText !important; + } + +treecell:hover + { + text-decoration : underline !important; + color : #000080 !important; + cursor : pointer; + } + +treecell:hover:active + { + text-decoration : underline !important; + color : red !important; + } + + diff --git a/toolkit/themes/osx/global/listbox.css b/toolkit/themes/osx/global/listbox.css new file mode 100644 index 0000000000..90928c7699 --- /dev/null +++ b/toolkit/themes/osx/global/listbox.css @@ -0,0 +1,113 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +listbox { + -moz-appearance: listbox; + margin: 2px 4px; + background-color: #FFFFFF; + color: -moz-FieldText; +} + +.listcell-label { + margin: 0px !important; + padding-bottom: 1px; + padding-inline-start: 4px; + white-space: nowrap; +} + +/* ::::: listitem ::::: */ + +listitem { + border: 1px solid transparent; +} + +listitem[selected="true"] { + background-color: -moz-mac-secondaryhighlight; + color: -moz-DialogText; +} + +listbox:focus > listitem[selected="true"] { + background-color: Highlight; + color: HighlightText; +} + +/* ::::: listheader ::::: */ + +listheader { + -moz-appearance: treeheadercell; + -moz-box-align: center; + border: 2px solid; + -moz-border-top-colors: ThreeDHighlight ThreeDLightShadow; + -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow; + -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow; + -moz-border-left-colors: ThreeDHighlight ThreeDLightShadow; + background-color: -moz-Dialog; + color: -moz-DialogText; + padding: 0 4px; +} + +listheader[sortable="true"]:hover:active { + border-top: 2px solid; + border-right: 1px solid; + border-bottom: 1px solid; + border-left: 2px solid; + -moz-border-top-colors: ThreeDShadow -moz-Dialog; + -moz-border-right-colors: ThreeDShadow; + -moz-border-bottom-colors: ThreeDShadow; + -moz-border-left-colors: ThreeDShadow -moz-Dialog; + padding-top: 1px; + padding-inline-start: 5px; + padding-inline-end: 4px; +} + +.listheader-icon { + margin-inline-end: 2px; +} + +.listheader-label { + margin: 0px !important; +} + +/* ::::: listcell ::::: */ + +.listcell-label { + margin: 0px !important; + padding-bottom: 1px; + padding-inline-start: 4px; + white-space: nowrap; +} + +.listcell-icon { + margin-inline-end: 2px; +} + +.listcell-label[disabled="true"] { + color: GrayText; +} + +/* ::::: listcell checkbox ::::: */ + +.listcell-check { + -moz-appearance: checkbox; + -moz-box-align: center; + margin: 0px 2px; + border: 1px solid -moz-DialogText; + min-width: 13px; + min-height: 13px; + background: -moz-Field no-repeat 50% 50%; +} + +.listcell-check[checked="true"] { + background-image: url("chrome://global/skin/checkbox/cbox-check.gif"); +} + +.listcell-check[disabled="true"] { + border-color: GrayText; +} + +.listcell-check[disabled="true"][checked="true"] { + background-image: url("chrome://global/skin/checkbox/cbox-check-dis.gif"); +} diff --git a/toolkit/themes/osx/global/menu.css b/toolkit/themes/osx/global/menu.css new file mode 100644 index 0000000000..49ca168a64 --- /dev/null +++ b/toolkit/themes/osx/global/menu.css @@ -0,0 +1,187 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +menu, +menuitem, +menucaption { + -moz-appearance: menuitem; + -moz-box-align: center; + color: MenuText; + font: -moz-pull-down-menu; + list-style-image: none; + -moz-image-region: auto; + padding: 0 21px 2px; +} + +menu[disabled="true"], menuitem[disabled="true"], +menu[_moz-menuactive="true"][disabled="true"], +menuitem[_moz-menuactive="true"][disabled="true"] { + color: -moz-mac-menutextdisable; +} + +/* ..... internal content .... */ + +.menu-text, +.menu-iconic-text, +.menu-accel, +.menu-iconic-accel { + margin: 0 !important; +} + +.menu-text, +.menu-iconic-text { + font-weight: inherit; + color: inherit; +} + +menucaption > .menu-text, +menucaption > .menu-iconic-text { + font-weight: bold; +} + +.menu-description { + font-style: italic; + color: -moz-mac-menutextdisable; + margin-inline-start: 1ex !important; +} + +.menu-iconic-icon { + height: 16px; + margin-top: -2px; + margin-bottom: -2px; + margin-inline-end: 5px; + /* Empty icons shouldn't take up room, so we need to compensate + * the 5px margin-end with a negative margin-start. + */ + margin-inline-start: -5px; +} + +/* menuitems with icons */ +.menuitem-iconic, +.menu-iconic, +menuitem[image], +menuitem[src] { + /* 2px higher than those without icons */ + padding-top: 1px; + padding-bottom: 3px; +} + +.menuitem-iconic > .menu-iconic-left > .menu-iconic-icon, +.menu-iconic > .menu-iconic-left > .menu-iconic-icon, +menuitem[image] > .menu-iconic-left > .menu-iconic-icon, +menuitem[src] > .menu-iconic-left > .menu-iconic-icon { + margin-inline-start: 0; + width: 16px; +} + +/* ..... menu arrow box ..... */ + +.menu-right, +.menu-accel-container { + margin-inline-start: 21px; + margin-inline-end: -9px; + -moz-box-pack: end; +} + +.menu-right { + list-style-image: none; + -moz-appearance: menuarrow; +} + +/* ::::: menu/menuitems in menubar ::::: */ + +menubar > menu { + -moz-appearance: none; + padding: 2px 5px 2px 7px; + margin: 1px 0; +} + +menubar > menu[_moz-menuactive="true"] { + color: inherit; + background-color: transparent; +} + +menubar > menu[_moz-menuactive="true"][open="true"] { + -moz-appearance: menuitem; + color: -moz-mac-menutextselect; +} + +/* ..... internal content .... */ + +.menubar-left { + margin: 0 2px; + color: inherit; +} + +.menubar-text { + margin: 0 1px !important; + color: inherit; +} + +/* ::::: menu/menuitems in popups ::::: */ + +menupopup > menu, +menupopup > menuitem, +menupopup > menucaption { + max-width: 42em; +} + +menu[_moz-menuactive="true"], +menuitem[_moz-menuactive="true"] { + color: -moz-mac-menutextselect; + background-color: Highlight; +} + +/* ::::: menu/menuitems in menulist popups ::::: */ + +menulist > menupopup > menuitem, +menulist > menupopup > menucaption, +menulist > menupopup > menu { + max-width: none; + font: inherit; + color: -moz-FieldText; +} + +/* ::::: menuitems in editable menulist popups ::::: */ + +menulist[editable="true"] > menupopup > menuitem, +menulist[editable="true"] > menupopup > menucaption { + -moz-appearance: none; +} + +menulist[editable="true"] > menupopup > :-moz-any(menuitem, menucaption) > .menu-iconic-left { + display: none; +} + +/* ::::: checked menuitems ::::: */ + +:not(menulist) > menupopup > menuitem[checked="true"], +:not(menulist) > menupopup > menuitem[selected="true"] { + -moz-appearance: checkmenuitem; +} + +menulist:not([editable="true"]) > menupopup > menuitem[checked="true"]::before, +menulist:not([editable="true"]) > menupopup > menuitem[selected="true"]::before { + content: '\2713'; /* a checkmark */ + display: block; + width: 15px; + margin-inline-start: -15px; +} + +/* ::::: menuseparator ::::: */ + +menuseparator { + -moz-appearance: menuseparator; + margin: 5px 0; + padding: 1px 0; +} + +/* ::::: autocomplete ::::: */ + +.autocomplete-history-popup > menuitem { + max-width: none !important; + font: message-box; +} diff --git a/toolkit/themes/osx/global/menulist.css b/toolkit/themes/osx/global/menulist.css new file mode 100644 index 0000000000..a4feca947e --- /dev/null +++ b/toolkit/themes/osx/global/menulist.css @@ -0,0 +1,65 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); +@namespace html url("http://www.w3.org/1999/xhtml"); + +menulist { + -moz-appearance: menulist; + margin: 5px 2px 3px; + color: -moz-DialogText; + text-shadow: none; +} + +menulist:not([popuponly="true"]) { + min-height: 20px; +} + +.menulist-label-box { + -moz-appearance: menulist-text; + -moz-box-align: center; + -moz-box-pack: center; + margin-bottom: 1px; +} + +.menulist-label { + margin: 1px 3px !important; +} + +.menulist-description { + font-style: italic; + color: GrayText; + margin-inline-start: 1ex !important; +} + +/* ..... dropmarker ..... */ + +.menulist-dropmarker { + display: none; +} + +/* ..... disabled state ..... */ + +menulist[disabled="true"] { + color: GrayText; +} + +menulist[disabled="true"] > .menulist-dropmarker { + padding-inline-start: 7px !important; +} + +/* ::::: editable menulists ::::: */ + +menulist[editable="true"] { + -moz-appearance: menulist-textfield; + margin: 4px 2px; +} + +html|*.menulist-editable-input { + margin: 0px !important; + border: none !important; + padding: 0px !important; + background: inherit; + font: inherit; +} diff --git a/toolkit/themes/osx/global/moz.build b/toolkit/themes/osx/global/moz.build new file mode 100644 index 0000000000..635fa39c99 --- /dev/null +++ b/toolkit/themes/osx/global/moz.build @@ -0,0 +1,6 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# 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/. + +JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file diff --git a/toolkit/themes/osx/global/nativescrollbars.css b/toolkit/themes/osx/global/nativescrollbars.css new file mode 100644 index 0000000000..82ef4d2ac1 --- /dev/null +++ b/toolkit/themes/osx/global/nativescrollbars.css @@ -0,0 +1,89 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); +@namespace html url("http://www.w3.org/1999/xhtml"); + +scrollbar { + -moz-appearance: scrollbar; + -moz-binding: url(chrome://global/content/bindings/scrollbar.xml#scrollbar); + cursor: default; + background-color: white; +} + +scrollbar[root="true"] { + position: relative; + z-index: 2147483647; /* largest positive value of a signed 32-bit integer */ +} + +html|select[size]:not([size="0"]):not([size="1"]) > scrollbar, +html|select[multiple] > scrollbar { + -moz-appearance: scrollbar-small; +} + +@media all and (-moz-overlay-scrollbars) { + scrollbar:not([active="true"]), + scrollbar[disabled="true"] { + visibility: hidden; + } +} + +/* ..... track ..... */ + +slider { + -moz-appearance: scrollbartrack-horizontal; +} + +slider[orient="vertical"] { + -moz-appearance: scrollbartrack-vertical; +} + +/* ..... thumb ..... */ + +thumb { + -moz-appearance: scrollbarthumb-horizontal; +} + +thumb[orient="vertical"] { + -moz-appearance: scrollbarthumb-vertical; +} + +/* ..... increment ..... */ + +scrollbarbutton[type="increment"] { + -moz-appearance: scrollbarbutton-right; +} + +scrollbar[orient="vertical"] > scrollbarbutton[type="increment"] { + -moz-appearance: scrollbarbutton-down; +} + +/* ..... decrement ..... */ + +scrollbarbutton[type="decrement"] { + -moz-appearance: scrollbarbutton-left; +} + +scrollbar[orient="vertical"] > scrollbarbutton[type="decrement"] { + -moz-appearance: scrollbarbutton-up; +} + +/* ::::: square at the corner of two scrollbars ::::: */ + +scrollcorner { + /* XXX -moz-appearance: scrollcorner; */ + -moz-binding: url(chrome://global/content/bindings/scrollbar.xml#scrollbar-base); + width: 16px; + cursor: default; + background-color: white; +} + +/* ::::::::::::::::::::: MEDIA PRINT :::::::::::::::::::::: */ +@media print { + html|div scrollbar { + -moz-appearance: scrollbar; + -moz-binding: url(chrome://global/content/bindings/scrollbar.xml#scrollbar); + cursor: default; + } +} diff --git a/toolkit/themes/osx/global/netError.css b/toolkit/themes/osx/global/netError.css new file mode 100644 index 0000000000..9255f958e3 --- /dev/null +++ b/toolkit/themes/osx/global/netError.css @@ -0,0 +1,145 @@ +/* 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/. */ + +/* + * This defines the look-and-feel styling of the error pages. + * (see: netError.xhtml) + * + * Original styling by William Price <bugzilla@mob.rice.edu> + * Updated by: Steven Garrity <steven@silverorange.com> + * Henrik Skupin <mozilla@hskupin.info> + */ + +html { + background: -moz-Dialog; +} + +body { + margin: 0; + padding: 0 1em; + color: -moz-FieldText; + font: message-box; +} + +h1 { + margin: 0 0 .6em 0; + border-bottom: 1px solid ThreeDLightShadow; + font-size: 160%; +} + +ul, ol { + margin: 0; + margin-inline-start: 1.5em; + padding: 0; +} + +ul > li, ol > li { + margin-bottom: .5em; +} + +ul { + list-style: square; +} + +#errorPageContainer { + position: relative; + min-width: 13em; + max-width: 52em; + margin: 4em auto; + border: 1px solid ThreeDShadow; + border-radius: 10px; + padding: 3em; + padding-inline-start: 30px; + background: url("chrome://global/skin/icons/warning-large.png") left 0 no-repeat -moz-Field; + background-origin: content-box; +} + +#errorPageContainer.certerror { + background-image: url("chrome://global/skin/icons/sslWarning.png"); +} + +#errorPageContainer:dir(rtl) { + background-position: right 0; +} + +#errorTitle { + margin-inline-start: 80px; +} + +#errorLongContent { + margin-inline-start: 80px; +} + +#errorShortDesc > p { + overflow: auto; + border-bottom: 1px solid ThreeDLightShadow; + padding-bottom: 1em; + font-size: 130%; + white-space: pre-wrap; +} + +#errorLongDesc { + padding-inline-end: 3em; + font-size: 110%; +} + +#errorLongDesc > p { +} + +#errorTryAgain { + margin-top: 2em; + margin-inline-start: 80px; +} + +#brand { + position: absolute; + right: 0; + bottom: -1.5em; + margin-inline-end: 10px; + opacity: .4; +} + +#brand:dir(rtl) { + right: auto; + left: 0; +} + +#brand > p { + margin: 0; +} + +#errorContainer { + display: none; +} + +#securityOverrideDiv { + padding-top: 10px; +} + +#securityOverrideContent { + background-color: #FFF090; /* Pale yellow */ + padding: 10px; + border-radius: 10px; +} + +/* Custom styling for 'blacklist' error class */ +:root.blacklist #errorTitle, :root.blacklist #errorLongContent, +:root.blacklist #errorShortDesc, :root.blacklist #errorLongDesc, +:root.blacklist a { + background-color: #722; /* Dark red */ + color: white; +} + +:root.blacklist #errorPageContainer { + background-image: url("chrome://global/skin/icons/blacklist_64.png"); + background-color: #722; +} + +:root.blacklist { + background: #333; +} + +:root.blacklist #errorTryAgain { + display: none; +} diff --git a/toolkit/themes/osx/global/notification.css b/toolkit/themes/osx/global/notification.css new file mode 100644 index 0000000000..6d22cf9c86 --- /dev/null +++ b/toolkit/themes/osx/global/notification.css @@ -0,0 +1,206 @@ +/* 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/. */ + +%include shared.inc +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +notification { + padding: 3px 3px 4px; + text-shadow: none; +} + +notification[type="info"] { + color: rgba(255,255,255,0.95); + background: linear-gradient(#606060, #404040); + border-top: 1px solid #2a2a2a; + border-bottom: 1px solid #2a2a2a; +} + +notification[type="warning"] { + color: rgba(0,0,0,0.95); + background: linear-gradient(#ffe13e, #ffc703); + border-top: 1px solid #bf8a01; + border-bottom: 1px solid #bf8a01; +} + +notification[type="critical"] { + color: rgba(255,255,255,0.95); + background: linear-gradient(#d40000, #980000); + border-top: 1px solid #5d0000; + border-bottom: 1px solid #5d0000; +} + +notificationbox[notificationside="top"] > notification { + border-top-style: none; +} + +notificationbox[notificationside="bottom"] > notification { + border-bottom-style: none; +} + +.messageText > .text-link { + color: inherit !important; + text-decoration: underline; +} + +.messageImage { + width: 16px; + height: 16px; + margin: 0 4px; +} + +/* Default icons for notifications */ + +.messageImage[type="info"] { + list-style-image: url("chrome://global/skin/notification/info-icon.png"); +} + +.messageImage[type="warning"] { + list-style-image: url("chrome://global/skin/notification/warning-icon.png"); +} + +.messageImage[type="critical"] { + list-style-image: url("chrome://global/skin/notification/error-icon.png"); +} + +.messageText { + margin: 0 3px !important; + padding: 0; + font-weight: bold; +} + +.messageCloseButton { + -moz-appearance: none; + padding: 0; + margin: 0 2px; + border: none; +} + +/* + Invert the close icon for @type=info since both are normally dark. It's unclear + why !important is necessary here so remove it if it's no longer needed. +*/ +notification[type="info"] .close-icon:not(:hover) { + -moz-image-region: rect(0, 64px, 16px, 48px) !important; +} + +@media (min-resolution: 2dppx) { + notification[type="info"] .close-icon:not(:hover) { + -moz-image-region: rect(0, 128px, 32px, 96px) !important; + } +} + +.messageCloseButton:-moz-focusring > .toolbarbutton-icon { + border-radius: 10000px; + box-shadow: 0 0 2px 1px -moz-mac-focusring, + 0 0 0 2px -moz-mac-focusring inset; +} + +@media (min-resolution: 2dppx) { + .messageCloseButton > .toolbarbutton-icon { + width: 16px; + } +} + +/* Popup notification */ + +.popup-notification-body { + max-width: 25em; +} + +.popup-notification-origin:not([value]), +.popup-notification-learnmore-link:not([href]) { + display: none; +} + +.popup-notification-origin { + margin-bottom: .3em !important; +} + +.popup-notification-learnmore-link { + margin-top: .5em !important; +} + +.popup-notification-button-container { + margin-top: 17px; +} + +.popup-notification-menubutton { + -moz-appearance: none; +} + +.popup-notification-menubutton:not([type="menu-button"]):-moz-focusring, +.popup-notification-menubutton:-moz-focusring > .button-menubutton-dropmarker, +.popup-notification-menubutton > .button-menubutton-button:-moz-focusring { + box-shadow: @focusRingShadow@; + position: relative; +} + +.popup-notification-menubutton:not([type="menu-button"]), +.popup-notification-menubutton > .button-menubutton-button, +.popup-notification-menubutton > .button-menubutton-dropmarker { + -moz-appearance: none; + color: #434343; + border-radius: 4px; + border: 1px solid #b5b5b5; + background: linear-gradient(#fff, #f2f2f2); + box-shadow: inset 0 1px rgba(255,255,255,.8), + inset 0 0 1px rgba(255,255,255,.25), + 0 1px rgba(255,255,255,.3); + background-clip: padding-box; + background-origin: padding-box; + padding: 2px 6px; +} + +.popup-notification-menubutton > .button-menubutton-button { + -moz-appearance: none; + margin: 0; + padding-top: 2px; + padding-bottom: 2px; + padding-inline-start: 8px; + padding-inline-end: 5px; +} + +.popup-notification-menubutton > .button-menubutton-dropmarker { + padding: 7px 8px; + margin-top: 0; + margin-bottom: 0; + margin-inline-start: -1px; + list-style-image: url("chrome://global/skin/icons/panel-dropmarker.png"); +} + +.popup-notification-menubutton > .button-menubutton-button:-moz-locale-dir(ltr), +.popup-notification-menubutton > .button-menubutton-dropmarker:-moz-locale-dir(rtl) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.popup-notification-menubutton > .button-menubutton-button:-moz-locale-dir(rtl), +.popup-notification-menubutton > .button-menubutton-dropmarker:-moz-locale-dir(ltr) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.popup-notification-menubutton:not([type="menu-button"]):hover:active, +.popup-notification-menubutton > .button-menubutton-button:hover:active, +.popup-notification-menubutton[open="true"] > .button-menubutton-dropmarker { + box-shadow: inset 0 1px 4px -3px #000, 0 1px rgba(255, 255, 255, 0.3); +} + +.popup-notification-closebutton { + margin-inline-end: -12px; + margin-top: -13px; +} + +.popup-notification-closeitem > .menu-iconic-left { + display: none; +} + +.popup-notification-menubutton > .button-menubutton-button[disabled] { + opacity: 0.5; +} + +.popup-notification-warning { + color: #aa1b08; +} diff --git a/toolkit/themes/osx/global/notification/close.png b/toolkit/themes/osx/global/notification/close.png Binary files differnew file mode 100644 index 0000000000..3300a4d61e --- /dev/null +++ b/toolkit/themes/osx/global/notification/close.png diff --git a/toolkit/themes/osx/global/notification/error-icon.png b/toolkit/themes/osx/global/notification/error-icon.png Binary files differnew file mode 100644 index 0000000000..54cc7e663b --- /dev/null +++ b/toolkit/themes/osx/global/notification/error-icon.png diff --git a/toolkit/themes/osx/global/notification/info-icon.png b/toolkit/themes/osx/global/notification/info-icon.png Binary files differnew file mode 100644 index 0000000000..55d45f165c --- /dev/null +++ b/toolkit/themes/osx/global/notification/info-icon.png diff --git a/toolkit/themes/osx/global/notification/warning-icon.png b/toolkit/themes/osx/global/notification/warning-icon.png Binary files differnew file mode 100644 index 0000000000..13cf79d6df --- /dev/null +++ b/toolkit/themes/osx/global/notification/warning-icon.png diff --git a/toolkit/themes/osx/global/numberbox.css b/toolkit/themes/osx/global/numberbox.css new file mode 100644 index 0000000000..e5de22d218 --- /dev/null +++ b/toolkit/themes/osx/global/numberbox.css @@ -0,0 +1,33 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); +@namespace html url("http://www.w3.org/1999/xhtml"); + +textbox[type="number"] { + -moz-appearance: none; + -moz-box-align: center; + padding: 0 !important; + border: none; + background-color: transparent; + cursor: default; +} + +html|*.numberbox-input { + text-align: right; + padding: 0 1px !important; +} + +.numberbox-input-box { + -moz-appearance: textfield; + margin-right: 4px; + border: 3px solid; + -moz-border-top-colors: transparent #888888 #000000; + -moz-border-right-colors: transparent #FFFFFF #000000; + -moz-border-bottom-colors: transparent #FFFFFF #000000; + -moz-border-left-colors: transparent #888888 #000000; + border-top-right-radius: 2px; + border-bottom-left-radius: 2px; + background-color: -moz-Field; +} diff --git a/toolkit/themes/osx/global/popup.css b/toolkit/themes/osx/global/popup.css new file mode 100644 index 0000000000..cf0266a3a6 --- /dev/null +++ b/toolkit/themes/osx/global/popup.css @@ -0,0 +1,141 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +menupopup, +panel { + -moz-appearance: menupopup; + background-color: Menu; +} + +menupopup > menu > menupopup { + margin-top: -4px; +} + +.popup-internal-box { + padding: 4px 0; +} + +panel[titlebar] { + -moz-appearance: none; /* to disable rounded corners */ +} + +panel[type="arrow"] { + -moz-appearance: none; + background: transparent; +} + +panel[type="arrow"][side="top"], +panel[type="arrow"][side="bottom"] { + margin-left: -25px; + margin-right: -25px; +} + +panel[type="arrow"][side="left"], +panel[type="arrow"][side="right"] { + margin-top: -25px; + margin-bottom: -25px; +} + +.panel-arrowcontent { + -moz-appearance: none; + background: var(--arrowpanel-background); + border-radius: var(--arrowpanel-border-radius); + box-shadow: 0 0 0 1px var(--arrowpanel-border-color); + color: var(--arrowpanel-color); + border: none; + padding: var(--arrowpanel-padding); + margin: 1px; +} + +.panel-arrow[side="top"] { + list-style-image: var(--panel-arrow-image-vertical, + url("chrome://global/skin/arrow/panelarrow-vertical.png")); + margin-left: 16px; + margin-right: 16px; + margin-bottom: -1px; +} + +.panel-arrow[side="bottom"] { + list-style-image: url("chrome://global/skin/arrow/panelarrow-vertical.png"); + -moz-transform: scaleY(-1); + margin-left: 16px; + margin-right: 16px; + margin-top: -1px; +} + +.panel-arrow[side="left"] { + list-style-image: url("chrome://global/skin/arrow/panelarrow-horizontal.png"); + margin-top: 16px; + margin-bottom: 16px; + margin-right: -1px; +} + +.panel-arrow[side="right"] { + list-style-image: url("chrome://global/skin/arrow/panelarrow-horizontal.png"); + transform: scaleX(-1); + margin-top: 16px; + margin-bottom: 16px; + margin-left: -1px; +} + +@media (min-resolution: 2dppx) { + .panel-arrow[side="top"], + .panel-arrow[side="bottom"] { + list-style-image: var(--panel-arrow-image-vertical, + url("chrome://global/skin/arrow/panelarrow-vertical@2x.png")); + width: 18px; + height: 10px; + } + + .panel-arrow[side="left"], + .panel-arrow[side="right"] { + list-style-image: url("chrome://global/skin/arrow/panelarrow-horizontal@2x.png"); + width: 10px; + height: 18px; + } +} + +/* ::::: tooltip ::::: */ + +tooltip { + -moz-appearance: tooltip; + margin-top: 18px; + padding: 2px 3px; + max-width: 40em; + color: InfoText; + font: message-box; + cursor: default; +} + +tooltip[titletip="true"] { + /* See bug 32157 comment 128 + * margin: -2px 0px 0px -3px; + */ + max-width: none; +} + +/* rules for popups associated with menulists */ + +menulist > menupopup { + min-width: 0px; +} + +menulist > menupopup:not([position]) { + margin-inline-start: -13px; + margin-top: -2px; +} + +menulist[editable="true"] > menupopup { + -moz-appearance: none; +} + +menulist > menupopup > .popup-internal-box { + padding: 0; +} + +menulist:not([editable="true"]) > menupopup { + padding: 4px 0; +} diff --git a/toolkit/themes/osx/global/preferences.css b/toolkit/themes/osx/global/preferences.css new file mode 100644 index 0000000000..d0b82a819c --- /dev/null +++ b/toolkit/themes/osx/global/preferences.css @@ -0,0 +1,64 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +prefwindow { + padding: 0; + font: -moz-dialog !important; +} + +prefpane { + padding: 12px 12px 0 12px; +} + +prefwindow[type="child"] > prefpane { + padding: 0; +} + +.prefWindow-dlgbuttons { + margin: 0 12px 12px; + padding-top: 0 !important; +} + +.paneSelector { + font: message-box; + padding: 1px 4px; + -moz-appearance: toolbar; + margin: 0; +} + +radio[pane] { + border: solid transparent; + border-width: 0 2px; + padding: 5px 4px 3px; + margin: 0; + -moz-appearance: none; + text-shadow: rgba(255, 255, 255, 0.4) 0 1px; +} + +radio[pane]:active:hover { + text-shadow: none; +} + +radio[pane] > .paneButtonIcon { + /* preload external filter file */ + background-image: url("chrome://global/skin/filters.svg"); +} + +radio[pane]:active:hover > .paneButtonIcon { + filter: url("chrome://global/skin/filters.svg#iconPressed"); +} + +radio[pane][selected="true"] { + -moz-border-image: url("chrome://global/skin/icons/panebutton-active.png") 0 2 fill repeat stretch; +} + +radio[pane][selected="true"]:-moz-window-inactive { + -moz-border-image: url("chrome://global/skin/icons/panebutton-inactive.png") 0 2 fill repeat stretch; +} + +.paneButtonLabel { + margin: 0 !important; +} diff --git a/toolkit/themes/osx/global/progressmeter.css b/toolkit/themes/osx/global/progressmeter.css new file mode 100644 index 0000000000..13fce252ab --- /dev/null +++ b/toolkit/themes/osx/global/progressmeter.css @@ -0,0 +1,22 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +progressmeter { + -moz-appearance: progressbar; + margin: 2px 4px; + min-width: 128px; + height: 12px; +} + +.progress-remainder[flex="100"], .progress-remainder[flex="0"] { + background-image: none !important; + -moz-appearance: none; +} + +.progressmeter-statusbar { + margin: 0; + border-width: 1px; +} diff --git a/toolkit/themes/osx/global/radio.css b/toolkit/themes/osx/global/radio.css new file mode 100644 index 0000000000..e21d93011b --- /dev/null +++ b/toolkit/themes/osx/global/radio.css @@ -0,0 +1,43 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +radiogroup { + margin: 1px 0px 1px 0px; +} + +radio { + -moz-appearance: radio-container; + -moz-box-align: center; + margin: 4px 2px; + -moz-user-focus: ignore; +} + +.radio-label-box { + margin-inline-start: 0px; + padding: 0px; +} + +.radio-icon { + margin-inline-end: 2px; +} + +.radio-label { + margin: 1px 0 !important; +} + +radio[disabled="true"] { + color: GrayText !important; +} + +.radio-check, .radio-check-box1 { + -moz-appearance: radio; + margin: 0 1px 1px; + /* vertical-align tells native theming where to snap to. However, this doesn't + * always work reliably because of bug 503833. */ + vertical-align: bottom; + width: 1.3em; + height: 1.3em; +} diff --git a/toolkit/themes/osx/global/resizer.css b/toolkit/themes/osx/global/resizer.css new file mode 100644 index 0000000000..18cdd2bc93 --- /dev/null +++ b/toolkit/themes/osx/global/resizer.css @@ -0,0 +1,69 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +resizer { + -moz-appearance: resizer; + background: url("chrome://global/skin/icons/resizer.png") no-repeat; + background-size: 100% 100%; + cursor: se-resize; + min-width: 15px; + width: 15px; + min-height: 15px; + height: 15px; +} +@media (min-resolution: 2dppx) { + resizer { + background-image: url("chrome://global/skin/icons/resizer@2x.png"); + background-size: 100% 100%; + } +} + +resizer[type="window"] { + display: none; +} + +resizer[rtl="true"], +resizer[dir="bottomend"]:-moz-locale-dir(rtl) { + background: url("chrome://global/skin/icons/resizer-rtl.png") no-repeat; +} +@media (min-resolution: 2dppx) { + resizer[rtl="true"], + resizer[dir="bottomend"]:-moz-locale-dir(rtl) { + background-image: url("chrome://global/skin/icons/resizer-rtl@2x.png"); + background-size: 100% 100%; + } +} + + +resizer[dir="left"], +resizer[dir="bottomleft"], +resizer[dir="bottomstart"] { + transform: scaleX(-1); +} + +resizer[dir="bottomleft"], +resizer[dir="bottomstart"]:not([rtl="true"]):not(:-moz-locale-dir(rtl)), +resizer[dir="bottomend"][rtl="true"] { + cursor: sw-resize; +} + +resizer[dir="top"], +resizer[dir="bottom"] { + cursor: ns-resize; +} + +resizer[dir="left"], +resizer[dir="right"] { + cursor: ew-resize; +} + +resizer[dir="topleft"] { + cursor: nw-resize; +} + +resizer[dir="topright"] { + cursor: ne-resize; +} diff --git a/toolkit/themes/osx/global/richlistbox.css b/toolkit/themes/osx/global/richlistbox.css new file mode 100644 index 0000000000..605c89abb3 --- /dev/null +++ b/toolkit/themes/osx/global/richlistbox.css @@ -0,0 +1,27 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +richlistbox { + -moz-appearance: listbox; + margin: 2px 4px; + background-color: -moz-Field; + color: -moz-FieldText; +} + +richlistbox[disabled="true"] { + color: GrayText; +} + +richlistitem[selected="true"] { + background-color: -moz-Dialog; + color: -moz-DialogText; +} + +richlistbox:focus > richlistitem[selected="true"] { + background-color: Highlight; + color: HighlightText; +} + diff --git a/toolkit/themes/osx/global/scale.css b/toolkit/themes/osx/global/scale.css new file mode 100644 index 0000000000..2e090bf28d --- /dev/null +++ b/toolkit/themes/osx/global/scale.css @@ -0,0 +1,46 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +.scale-slider { + -moz-appearance: scale-horizontal; + background: url("chrome://global/skin/scale/scale-tray-horiz.gif") 0% 50% repeat-x; + margin: 2px 4px; + width: 100px; +} + +.scale-slider[orient="vertical"] +{ + -moz-appearance: scale-vertical; + background: url("chrome://global/skin/scale/scale-tray-vert.gif") 50% 0% repeat-y; + margin: 4px 2px; + width: auto; + height: 100px; +} + +.scale-thumb { + -moz-appearance: scalethumb-horizontal; + border: 2px solid; + -moz-border-top-colors: ThreeDLightShadow ThreeDHighlight; + -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow; + -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow; + -moz-border-left-colors: ThreeDLightShadow ThreeDHighlight; + background-color: -moz-Dialog; + min-width: 30px; + min-height: 15px; +} + +.scale-thumb[orient="vertical"] { + -moz-appearance: scalethumb-vertical; + min-width: 15px; + min-height: 30px; +} + +.scale-thumb[disabled="true"] { + -moz-border-top-colors: ThreeDHighlight ThreeDLightShadow !important; + -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow !important; + -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow !important; + -moz-border-left-colors: ThreeDHighlight ThreeDLightShadow !important; +} diff --git a/toolkit/themes/osx/global/scale/scale-tray-horiz.gif b/toolkit/themes/osx/global/scale/scale-tray-horiz.gif Binary files differnew file mode 100644 index 0000000000..b87fe68c15 --- /dev/null +++ b/toolkit/themes/osx/global/scale/scale-tray-horiz.gif diff --git a/toolkit/themes/osx/global/scale/scale-tray-vert.gif b/toolkit/themes/osx/global/scale/scale-tray-vert.gif Binary files differnew file mode 100644 index 0000000000..97687b2e22 --- /dev/null +++ b/toolkit/themes/osx/global/scale/scale-tray-vert.gif diff --git a/toolkit/themes/osx/global/scrollbox.css b/toolkit/themes/osx/global/scrollbox.css new file mode 100644 index 0000000000..c9b7276698 --- /dev/null +++ b/toolkit/themes/osx/global/scrollbox.css @@ -0,0 +1,62 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* Horizontal enabled */ +.autorepeatbutton-up[orient="horizontal"], +.scrollbutton-up[orient="horizontal"] { + list-style-image: url("chrome://global/skin/arrow/arrow-lft-sharp.gif"); + -moz-image-region: auto; /* cut off inheritance */ +} + +.autorepeatbutton-down[orient="horizontal"], +.scrollbutton-down[orient="horizontal"] { + list-style-image: url("chrome://global/skin/arrow/arrow-rit-sharp.gif"); + -moz-image-region: auto; /* cut off inheritance */ +} + +/* Horizontal disabled */ +.autorepeatbutton-up[orient="horizontal"][disabled="true"], +.scrollbutton-up[orient="horizontal"][disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-lft-dis.gif"); + -moz-image-region: auto; /* cut off inheritance */ +} + +.autorepeatbutton-down[orient="horizontal"][disabled="true"], +.scrollbutton-down[orient="horizontal"][disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-rit-dis.gif"); + -moz-image-region: auto; /* cut off inheritance */ +} + +/* Vertical enabled */ +.autorepeatbutton-up:not([orient="horizontal"]), +.scrollbutton-up { + list-style-image: url("chrome://global/skin/arrow/arrow-up-sharp.gif"); + -moz-image-region: auto; /* cut off inheritance */ +} + +.autorepeatbutton-down:not([orient="horizontal"]), +.scrollbutton-down { + list-style-image: url("chrome://global/skin/arrow/arrow-dn-sharp.gif"); + -moz-image-region: auto; /* cut off inheritance */ +} + +/* Vertical disabled */ +.autorepeatbutton-up[disabled="true"]:not([orient="horizontal"]), +.scrollbutton-up[disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-up-dis.gif"); + -moz-image-region: auto; /* cut off inheritance */ +} + +.autorepeatbutton-down[disabled="true"]:not([orient="horizontal"]), +.scrollbutton-down[disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-dn-dis.gif"); + -moz-image-region: auto; /* cut off inheritance */ +} + +.scrollbutton-up > .toolbarbutton-text, +.scrollbutton-down > .toolbarbutton-text { + display: none; +} diff --git a/toolkit/themes/osx/global/shared.inc b/toolkit/themes/osx/global/shared.inc new file mode 100644 index 0000000000..350fed1721 --- /dev/null +++ b/toolkit/themes/osx/global/shared.inc @@ -0,0 +1,20 @@ +%filter substitution + +%define loweredShadow 0 1px rgba(255, 255, 255, .4) +%define focusRingShadow 0 0 1px -moz-mac-focusring inset, 0 0 4px 1px -moz-mac-focusring, 0 0 1.5px 1px -moz-mac-focusring +%define yosemiteFocusRingShadow 0 0 0 0.5px -moz-mac-focusring inset, 0 0 0 2px -moz-mac-focusring + +%define roundButtonBorder 1px solid rgba(0,0,0,.35) +%define roundButtonBackground linear-gradient(#f6f6f6, #e9e9e9) +%define roundButtonShadow 0 1px rgba(255,255,255,.5), inset 0 1px 1px rgba(255,255,255,.5) +%define roundButtonPressedBackground #dadada +%define roundButtonPressedShadow 0 1px rgba(255,255,255,.4), inset 0 1px 3px rgba(0,0,0,.2) + +%define scopeBarBackground linear-gradient(#E8E8E8, #D0D0D0) repeat-x +%define scopeBarSeparatorBorder 1px solid #888 +%define scopeBarTitleColor #6D6D6D + +%define toolbarbuttonCornerRadius 3px +%define toolbarbuttonBackground linear-gradient(#FFF, #ADADAD) repeat-x +%define toolbarbuttonPressedInnerShadow inset rgba(0, 0, 0, 0.3) 0 -6px 10px, inset #000 0 1px 3px, inset rgba(0, 0, 0, 0.2) 0 1px 3px +%define toolbarbuttonInactiveBorderColor rgba(146, 146, 146, 0.84) diff --git a/toolkit/themes/osx/global/spinbuttons.css b/toolkit/themes/osx/global/spinbuttons.css new file mode 100644 index 0000000000..bf89520f68 --- /dev/null +++ b/toolkit/themes/osx/global/spinbuttons.css @@ -0,0 +1,31 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +spinbuttons { + height: 24px; + min-height: 24px; + -moz-appearance: spinner; + cursor: default; +} + +.spinbuttons-up { + -moz-appearance: none; + -moz-box-flex: 1; + min-width: 1px; + min-height: 1px; + margin: 0; + padding: 0; +} + +.spinbuttons-down { + -moz-appearance: none; + -moz-box-flex: 1; + min-width: 1px; + min-height: 1px; + margin: 0; + padding: 0; +} + diff --git a/toolkit/themes/osx/global/splitter.css b/toolkit/themes/osx/global/splitter.css new file mode 100644 index 0000000000..caaa83ad0a --- /dev/null +++ b/toolkit/themes/osx/global/splitter.css @@ -0,0 +1,124 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +/* ::::: splitter (vertical) ::::: */ + +splitter { + -moz-box-align: center; + -moz-box-pack: center; + cursor: ew-resize; + min-width: 9px; + min-height: 9px; + background: url("chrome://global/skin/splitter/dimple.png") transparent no-repeat center; +} + +splitter[state="collapsed"][collapse="before"], +splitter[state="collapsed"][substate="before"], +splitter[state="collapsed"][collapse="after"]:-moz-locale-dir(rtl), +splitter[state="collapsed"][substate="after"]:-moz-locale-dir(rtl) { + cursor: e-resize; +} + +splitter[state="collapsed"][collapse="after"], +splitter[state="collapsed"][substate="after"], +splitter[state="collapsed"][collapse="before"]:-moz-locale-dir(rtl), +splitter[state="collapsed"][substate="before"]:-moz-locale-dir(rtl) { + cursor: w-resize; +} + +splitter:-moz-lwtheme { + background: none; +} + +/* ::::: splitter (horizontal) ::::: */ + +splitter[orient="vertical"] { + cursor: ns-resize; + min-width: 0px; + min-height: 9px; + min-width: 9px; + background: url("chrome://global/skin/splitter/dimple.png") transparent no-repeat center; +} + +splitter[orient="vertical"][state="collapsed"][collapse="before"], +splitter[orient="vertical"][state="collapsed"][substate="before"] { + cursor: s-resize; +} + +splitter[orient="vertical"][state="collapsed"][collapse="after"], +splitter[orient="vertical"][state="collapsed"][substate="after"] { + cursor: n-resize; +} + +splitter[disabled="true"] { + cursor: default !important; +} + +/* ::::: splitter grippy ::::: */ + +grippy { + cursor: pointer; + margin: 0px 1px; + min-width: 4px; + min-height: 115px; + background-color: transparent; + background-repeat: no-repeat; +} + +grippy:hover { + background-color: ThreeDHighlight; +} + +splitter[orient="vertical"] > grippy { + margin: 1px 0px; + min-width: 115px; + min-height: 4px; +} + +/* ..... normal state ..... */ + +/* vertical grippies */ +splitter[collapse="before"] > grippy, +splitter[collapse="after"] > grippy:-moz-locale-dir(rtl) { + background-image: url("chrome://global/skin/splitter/grip-left.gif"); +} + +splitter[collapse="after"] > grippy, +splitter[collapse="before"] > grippy:-moz-locale-dir(rtl) { + background-image: url("chrome://global/skin/splitter/grip-right.gif"); +} + +/* horizontal grippies */ +splitter[collapse="before"][orient="vertical"] > grippy { + background-image: url("chrome://global/skin/splitter/grip-top.gif"); +} + +splitter[collapse="after"][orient="vertical"] > grippy { + background-image: url("chrome://global/skin/splitter/grip-bottom.gif"); +} + +/* ..... collapsed state ..... */ + +/* vertical grippies */ +splitter[collapse="before"][state="collapsed"] > grippy, +splitter[collapse="after"][state="collapsed"] > grippy:-moz-locale-dir(rtl) { + background-image: url("chrome://global/skin/splitter/grip-right.gif"); +} + +splitter[collapse="after"][state="collapsed"] > grippy, +splitter[collapse="before"][state="collapsed"] > grippy:-moz-locale-dir(rtl) { + background-image: url("chrome://global/skin/splitter/grip-left.gif"); +} + +/* horizontal grippies */ +splitter[collapse="before"][state="collapsed"][orient="vertical"] > grippy { + background-image: url("chrome://global/skin/splitter/grip-bottom.gif"); +} + +splitter[collapse="after"][state="collapsed"][orient="vertical"] > grippy { + background-image: url("chrome://global/skin/splitter/grip-top.gif"); +} + diff --git a/toolkit/themes/osx/global/splitter/dimple.png b/toolkit/themes/osx/global/splitter/dimple.png Binary files differnew file mode 100644 index 0000000000..4d0b91bfea --- /dev/null +++ b/toolkit/themes/osx/global/splitter/dimple.png diff --git a/toolkit/themes/osx/global/splitter/grip-bottom.gif b/toolkit/themes/osx/global/splitter/grip-bottom.gif Binary files differnew file mode 100644 index 0000000000..af6290fe9d --- /dev/null +++ b/toolkit/themes/osx/global/splitter/grip-bottom.gif diff --git a/toolkit/themes/osx/global/splitter/grip-left.gif b/toolkit/themes/osx/global/splitter/grip-left.gif Binary files differnew file mode 100644 index 0000000000..6be9bc4f40 --- /dev/null +++ b/toolkit/themes/osx/global/splitter/grip-left.gif diff --git a/toolkit/themes/osx/global/splitter/grip-right.gif b/toolkit/themes/osx/global/splitter/grip-right.gif Binary files differnew file mode 100644 index 0000000000..71be69083e --- /dev/null +++ b/toolkit/themes/osx/global/splitter/grip-right.gif diff --git a/toolkit/themes/osx/global/splitter/grip-top.gif b/toolkit/themes/osx/global/splitter/grip-top.gif Binary files differnew file mode 100644 index 0000000000..3cba005946 --- /dev/null +++ b/toolkit/themes/osx/global/splitter/grip-top.gif diff --git a/toolkit/themes/osx/global/tabbox.css b/toolkit/themes/osx/global/tabbox.css new file mode 100644 index 0000000000..4fcbac486d --- /dev/null +++ b/toolkit/themes/osx/global/tabbox.css @@ -0,0 +1,148 @@ +/* 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/. */ + +/* + The default style of these tabs is that of an NSTabView with tabs at + the top in the "regular" size. These tabs can be used with or without + a tabbox element. + For bottom tabs you should use the "tabs-bottom" class on the tabbox + or the tabs element. Bottom tabs use a style that's similar to the + one used in Adium. +*/ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +tabbox { + margin: 0 5px; +} + +tabpanels { + -moz-appearance: tabpanels; + padding: 33px 15px 15px; +} + +tabs { + -moz-box-align: center; + font: menu; +} + +tabbox > tabs { + padding: 0 10px; + margin-bottom: -12px; + position: relative; +} + +tab { + -moz-appearance: tab; +} + +tab:-moz-focusring { + /* Tab focus rings need to overlay adjacent tabs. */ + position: relative; +} + +tab:first-of-type { + padding-inline-start: 2px; +} + +tab:last-of-type { + padding-inline-end: 2px; +} + +tab[visuallyselected="true"] { + color: #FFF; + text-shadow: rgba(0, 0, 0, 0.4) 0 1px; +} + +.tab-middle { + padding: 1px 6px 2px; +} + +.tabs-left, +.tabs-right { + -moz-box-flex: 1; +} + +/* Tabs at the bottom + * These tabs are smaller, left aligned and don't extend into the tabpanel. + */ + +tabbox.tabs-bottom > tabpanels { + padding: 10px; +} + +tabbox.tabs-bottom > tabs, +tabs.tabs-bottom { + background-color: rgba(0, 0, 0, 0.1); + padding: 0; + margin: 0; + border-top: 2px solid; + -moz-border-top-colors: #888 rgba(0, 0, 0, 0.08); + -moz-box-align: start; + font: message-box; +} + +tabbox.tabs-bottom > tabs > .tabs-left, +tabs.tabs-bottom > .tabs-left { + -moz-box-flex: 0; +} + +tabbox.tabs-bottom > tabs > tab, +tabs.tabs-bottom > tab { + -moz-appearance: none; + margin: -1px 0 0; + padding: 0 0 2px 0; + position: relative; + border-inline-end: 1px solid rgba(0, 0, 0, 0.19); +} + +tabbox.tabs-bottom > tabs > tab > .tab-middle, +tabs.tabs-bottom > tab > .tab-middle { + padding: 1px 2px 0 2px; +} + +tabbox.tabs-bottom > tabs > tab:not([visuallyselected=true]):hover, +tabs.tabs-bottom > tab:not([visuallyselected=true]):hover { + background-color: rgba(0, 0, 0, 0.1); + border-inline-end-color: rgba(0, 0, 0, 0.1); +} + +tabbox.tabs-bottom > tabs > tab[visuallyselected=true], +tabs.tabs-bottom > tab[visuallyselected=true] { + color: #000; + text-shadow: none; + border: solid #888; + border-width: 0 2px 2px; + border-radius: 2px; + -moz-border-left-colors: rgba(0, 0, 0, 0.08) #888; + -moz-border-right-colors: rgba(0, 0, 0, 0.08) #888; + -moz-border-bottom-colors: rgba(0, 0, 0, 0.08) #888; + margin-inline-end: -1px; + margin-top: -2px; + margin-bottom: 1px; + padding: 0; +} + +tabbox.tabs-bottom > tabs > tab[beforeselected=true], +tabs.tabs-bottom > tab[beforeselected=true] { + border-inline-end-color: transparent; + margin-inline-end: -2px; +} + +tabbox.tabs-bottom > tabs > tab:first-of-type:not([visuallyselected=true]), +tabs.tabs-bottom > tab:first-of-type:not([visuallyselected=true]) { + border-inline-start: 4px solid transparent; +} + +tabbox.tabs-bottom > tabs > tab:first-of-type[visuallyselected=true], +tabs.tabs-bottom > tab:first-of-type[visuallyselected=true] { + margin-inline-start: 2px; +} + +tabbox.tabs-bottom, +tabbox.tabs-bottom > tabpanels, +tabbox.tabs-bottom > tabs > tab[visuallyselected=true] > .tab-middle, +tabs.tabs-bottom > tab[visuallyselected=true] > .tab-middle { + -moz-appearance: dialog; +} diff --git a/toolkit/themes/osx/global/tabprompts.css b/toolkit/themes/osx/global/tabprompts.css new file mode 100644 index 0000000000..14a23f2696 --- /dev/null +++ b/toolkit/themes/osx/global/tabprompts.css @@ -0,0 +1,67 @@ +/* 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/. */ + +/* Tab Modal Prompt boxes */ +tabmodalprompt { + background-image: url(chrome://global/skin/icons/tabprompts-bgtexture.png); + background-color: hsla(0,0%,10%,.5); + font-family: sans-serif; /* use content font not system UI font */ + font-size: 110%; +} + +.mainContainer { + color: black; + background-color: hsla(0,0%,100%,.95); + background-clip: padding-box; + border-radius: 2px; + border: 1px solid hsla(0,0%,0%,.5); +} + +.topContainer { + padding: 20px; +} + +.buttonContainer { + padding: 12px 20px 15px; + background-color: hsla(0,0%,0%,.05); + border-top: 1px solid hsla(0,0%,0%,.05); +} + +button { + -moz-appearance: none; + padding: 2px 0; + margin: 0; + margin-inline-start: 8px; + border-radius: 2px; + color: black !important; + background-color: hsl(0,0%,90%); + background-image: linear-gradient(hsla(0,0%,100%,.7), transparent); + background-clip: padding-box; + border: 1px solid; + border-color: hsl(0,0%,65%) hsl(0,0%,60%) hsl(0,0%,50%); + box-shadow: 0 1px 0 hsla(0,0%,100%,.9) inset, + 0 1px 2px hsla(0,0%,0%,.1); +} + + +button[default=true] { + background-color: hsl(0,0%,79%); +} + +button:hover { + background-color: hsl(0,0%,96%); +} + +button:hover:active { + background-image: linear-gradient(hsla(0,0%,100%,.2), transparent); + background-color: hsl(0,0%,70%); + box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset, + 0 1px 3px hsla(0,0%,0%,.2); +} + +button:focus { + box-shadow: 0 0 1px -moz-mac-focusring inset, + 0 0 4px 1px -moz-mac-focusring, + 0 0 1.5px 1px -moz-mac-focusring; +} diff --git a/toolkit/themes/osx/global/textbox.css b/toolkit/themes/osx/global/textbox.css new file mode 100644 index 0000000000..d7a31c7acc --- /dev/null +++ b/toolkit/themes/osx/global/textbox.css @@ -0,0 +1,102 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); +@namespace html url("http://www.w3.org/1999/xhtml"); + +textbox { + -moz-appearance: textfield; + cursor: text; + margin: 4px; + border: 3px solid; + -moz-border-top-colors: transparent #888888 #000000; + -moz-border-right-colors: transparent #FFFFFF #000000; + -moz-border-bottom-colors: transparent #FFFFFF #000000; + -moz-border-left-colors: transparent #888888 #000000; + border-top-right-radius: 2px; + border-bottom-left-radius: 2px; + padding: 0px; + background-color: -moz-Field; + color: -moz-FieldText; +} + +html|*.textbox-input, +html|*.textbox-textarea { + margin: 0px !important; + border: none !important; + padding: 0px 1px !important; + background-color: inherit; + color: inherit; + font: inherit; +} + +.textbox-contextmenu { + cursor: default; +} + +textbox[focused="true"] { + -moz-border-top-colors: -moz-mac-focusring -moz-mac-focusring #000000; + -moz-border-right-colors: -moz-mac-focusring -moz-mac-focusring #000000; + -moz-border-bottom-colors: -moz-mac-focusring -moz-mac-focusring #000000; + -moz-border-left-colors: -moz-mac-focusring -moz-mac-focusring #000000; +} + +textbox[readonly="true"] { + background-color: -moz-Dialog; + color: -moz-DialogText; +} + +textbox[disabled="true"] { + cursor: default; + -moz-border-top-colors: transparent ThreeDShadow -moz-Dialog; + -moz-border-right-colors: transparent ThreeDShadow -moz-Dialog; + -moz-border-bottom-colors: transparent ThreeDShadow -moz-Dialog; + -moz-border-left-colors: transparent ThreeDShadow -moz-Dialog; + background-color: -moz-Dialog; + color: GrayText; +} + +textbox.plain { + -moz-appearance: none !important; + background-color: transparent; + padding: 0px !important; + margin: 0px !important; + border: none !important; +} + +textbox.plain html|*.textbox-input, +textbox.plain html|*.textbox-textarea { + padding: 0px !important; +} + +/* ::::: search box ::::: */ + +textbox[type="search"] { + -moz-appearance: searchfield; + padding: 1px; + font-size: 12px; +} + +.textbox-search-clear { + list-style-image: url(chrome://global/skin/icons/searchfield-cancel.svg); + -moz-image-region: rect(0, 14px, 14px, 0); + margin-bottom: 1px; +} + +textbox[type="search"].compact { + padding: 0; + font-size: 11px; +} + +textbox[type="search"].compact > .textbox-input-box > .textbox-search-icons > .textbox-search-clear { + width: 11px; +} + +.textbox-search-clear:not([disabled]) { + cursor: default; +} + +.textbox-search-icons:not([selectedIndex="1"]) { + visibility: hidden; +} diff --git a/toolkit/themes/osx/global/toolbar.css b/toolkit/themes/osx/global/toolbar.css new file mode 100644 index 0000000000..f07332d2f3 --- /dev/null +++ b/toolkit/themes/osx/global/toolbar.css @@ -0,0 +1,127 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +toolbox { + /* Setting -moz-appearance:toolbox causes sheets to attach under the + * toolbox and has no other effects. It doesn't render anything. */ + -moz-appearance: toolbox; +} + +toolbar { + min-width: 1px; + min-height: 20px; + -moz-appearance: toolbar; +} + +%ifdef MOZ_AUSTRALIS +menubar:-moz-lwtheme, +toolbar:-moz-lwtheme { + -moz-appearance: none; + background: none; + border-color: transparent; +} +%else +menubar:-moz-lwtheme, +toolbar:-moz-lwtheme { + -moz-appearance: none; + background: none; + border-style: none; +} +%endif + +menubar { + -moz-appearance: dialog; /* For content menubars, "toolbar" is too dark, so we use "dialog". */ + min-width: 1px; +} + +toolbarseparator { + -moz-appearance: none; + margin: 3px 4px; + background: url("chrome://global/skin/toolbar/toolbar-separator.png") transparent repeat-y; + padding: 0; + width: 1px !important; +} + +/* ::::: toolbarpaletteitem ::::: */ + +toolbarpaletteitem { + cursor: grab; +} + +toolbar[iconsize="small"] toolbarpaletteitem[type="spacer"] { + min-width: 24px !important; +} + +toolbarpaletteitem[type="spacer"] { + min-width: 32px !important; +} + +.toolbarpaletteitem-box[type="spacer"] { + border: 1px solid #A3A3A3; + background: url("chrome://global/skin/10pct_transparent_grey.png") repeat; + width: 32px; + margin-top: 18px; +} + +.toolbarpaletteitem-box[type="spring"] { + border: 1px solid #A3A3A3; + background: url("chrome://global/skin/toolbar/spring.png") #FFFFFF no-repeat; + width: 32px; + margin-top: 18px; +} + +.toolbarpaletteitem-box[type="spring"][place="toolbar"] { + background: url("chrome://global/skin/10pct_transparent_grey.png") repeat; +} + +.toolbarpaletteitem-box[type="spacer"][place="toolbar"], +.toolbarpaletteitem-box[type="spring"][place="toolbar"] { + margin: 2px; +} + +.toolbarpaletteitem-box[type="separator"][place="palette"] { + width: 2px; + height: 50px; +} + +.toolbarpaletteitem-box[type="spacer"][place="palette"], +.toolbarpaletteitem-box[type="spring"][place="palette"] { + margin-top: 0; + margin-bottom: 2px; + height: 32px; +} + +.toolbarpaletteitem-box[type="spring"][place="palette"] { + background-position: center; + margin-left: 8px; + margin-right: 8px; +} + +/* ..... drag and drop feedback ..... */ + +toolbarpaletteitem[place="toolbar"] { + margin-left: -2px; + margin-right: -2px; + border-left: 2px solid transparent; + border-right: 2px solid transparent; +} + +toolbarpaletteitem[dragover="left"] { + border-left-color: #000000; +} + +toolbarpaletteitem[dragover="right"] { + border-right-color: #000000; +} + +toolbar[iconsize="small"] toolbarspacer { + min-width: 24px !important; +} + +toolbarspacer { + min-width: 32px !important; +} + diff --git a/toolkit/themes/osx/global/toolbar/spring.png b/toolkit/themes/osx/global/toolbar/spring.png Binary files differnew file mode 100644 index 0000000000..807e1f5e54 --- /dev/null +++ b/toolkit/themes/osx/global/toolbar/spring.png diff --git a/toolkit/themes/osx/global/toolbar/toolbar-separator.png b/toolkit/themes/osx/global/toolbar/toolbar-separator.png Binary files differnew file mode 100644 index 0000000000..21e17543a0 --- /dev/null +++ b/toolkit/themes/osx/global/toolbar/toolbar-separator.png diff --git a/toolkit/themes/osx/global/toolbarbutton.css b/toolkit/themes/osx/global/toolbarbutton.css new file mode 100644 index 0000000000..ab24387e3c --- /dev/null +++ b/toolkit/themes/osx/global/toolbarbutton.css @@ -0,0 +1,124 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +toolbarbutton { + -moz-box-align: center; + -moz-box-pack: center; + margin: 0 2px; + padding: 3px 2px; + background-color: transparent; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); +} + +toolbarbutton[open="true"], +toolbarbutton:not([disabled="true"]):active:hover { + text-shadow: none; +} + +.toolbarbutton-text { + margin: 0 !important; /* !important for overriding global.css */ + padding: 0px; + text-align: center; + vertical-align: middle; +} + +toolbarbutton[disabled="true"], +toolbarbutton[disabled="true"]:hover, +toolbarbutton[disabled="true"]:hover:active, +toolbarbutton[disabled="true"][open="true"] { + color: -moz-mac-disabledtoolbartext !important; +} + +/* ::::: toolbarbutton menu ::::: */ + +.toolbarbutton-menu-dropmarker { + -moz-appearance: none !important; + border: none !important; + background-color: transparent !important; + list-style-image: url("chrome://global/skin/arrow/arrow-dn.png"); + padding: 0; + padding-inline-start: 2px; + width: auto; +} + +.toolbarbutton-menu-dropmarker[disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-dn-dis.png"); + padding: 0; + padding-inline-start: 2px; +} + +/* ::::: toolbarbutton menu-button ::::: */ + +toolbarbutton[type="menu-button"] { + -moz-box-align: stretch; + -moz-box-orient: horizontal !important; +} + +toolbarbutton[type="menu-button"], +toolbarbutton[type="menu-button"]:hover, +toolbarbutton[type="menu-button"]:hover:active, +toolbarbutton[type="menu-button"][open="true"], +toolbarbutton[type="menu-button"][disabled="true"], +toolbarbutton[type="menu-button"][disabled="true"]:hover, +toolbarbutton[type="menu-button"][disabled="true"]:hover:active { + background-color: transparent; +} + +.toolbarbutton-menubutton-button { + -moz-box-align: center; + -moz-box-pack: center; + -moz-box-orient: vertical; + text-shadow: inherit; +} + +/* ::::: toolbarbutton badged ::::: */ + +.toolbarbutton-badge { + background-color: #d90000; + font-size: 9px; + padding: 1px 2px; + color: #fff; + border-radius: 2px; + box-shadow: 0 1px 0 hsla(0, 100%, 100%, .2) inset, + 0 -1px 0 hsla(0, 0%, 0%, .1) inset, + 0 1px 0 hsla(206, 50%, 10%, .2); + margin: -6px 0 0 !important; + margin-inline-end: -6px !important; + min-width: 14px; + max-width: 28px; + line-height: 10px; + text-align: center; + -moz-stack-sizing: ignore; +} + +.toolbarbutton-badge:-moz-window-inactive { + background-color: rgb(230,230,230); + box-shadow: none; + color: rgb(192,192,192); +} + +toolbar[mode="icons"] > *|* > .toolbarbutton-badge { + margin-inline-end: -10px !important; +} + +/* .......... dropmarker .......... */ + +.toolbarbutton-menubutton-dropmarker { + -moz-appearance: none; + border: none; + background-color: transparent !important; + list-style-image: url("chrome://global/skin/arrow/arrow-dn.png"); + width: auto; + padding: 0 5px; +} + +.toolbarbutton-menubutton-dropmarker[disabled="true"] { + list-style-image: url("chrome://global/skin/arrow/arrow-dn-dis.png"); +} + +toolbarbutton.tabbable { + -moz-user-focus: normal !important; +} diff --git a/toolkit/themes/osx/global/tree.css b/toolkit/themes/osx/global/tree.css new file mode 100644 index 0000000000..472a51fc91 --- /dev/null +++ b/toolkit/themes/osx/global/tree.css @@ -0,0 +1,296 @@ +/* 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/. */ + +%include shared.inc +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +tree { + margin: 0px 4px; + color: -moz-DialogText; + background-color: #FFFFFF; + -moz-appearance: listbox; +} + +/* ::::: tree focusring ::::: */ + +.focusring > .tree-stack > .tree-rows > .tree-bodybox { + border: 1px solid transparent; +} + +.focusring:focus > .tree-stack > .tree-rows > .tree-bodybox { + border: 1px solid -moz-mac-focusring; +} + + +/* ::::: tree rows ::::: */ + +treechildren::-moz-tree-row { + border-top: 1px solid transparent; + height: 18px; + background-color: -moz-field; +} + +treechildren:not(.autocomplete-treebody)::-moz-tree-row(multicol, odd) { + background-color: -moz-oddtreerow; +} + +treechildren:not(.autocomplete-treebody)::-moz-tree-row(selected) { + background-color: -moz-mac-secondaryhighlight; +} + +treechildren:not(.autocomplete-treebody)::-moz-tree-row(selected, focus) { + background-color: Highlight; + color: HighlightText; +} + +tree[seltype="cell"] > treechildren::-moz-tree-row, +tree[seltype="text"] > treechildren::-moz-tree-row { + border-top: none; + background-color: transparent; +} + +/* ::::: tree cells ::::: */ + +treechildren::-moz-tree-cell { + padding: 0px 2px 0px 2px; +} + +tree[seltype="cell"] > treechildren::-moz-tree-cell-text, +tree[seltype="text"] > treechildren::-moz-tree-cell-text, +treechildren::-moz-tree-cell-text { + color: inherit; +} + +tree[seltype="cell"] > treechildren::-moz-tree-cell { + padding: 0px 1px 0px 1px; +} + +tree[seltype="text"] > treechildren::-moz-tree-cell-text { + padding: 0px 1px 1px 1px; +} + +treechildren::-moz-tree-cell-text(selected) { + color: -moz-DialogText; +} + +tree[seltype="cell"] > treechildren::-moz-tree-cell(active, selected) { + background-color: -moz-mac-secondaryhighlight; + +} +tree[seltype="cell"] > treechildren::-moz-tree-cell-text(active, selected) { + color: -moz-DialogText; +} + +tree[seltype="text"] > treechildren::-moz-tree-cell-text(active, selected) { + background-color: -moz-mac-secondaryhighlight; + color: -moz-DialogText; +} + +treechildren::-moz-tree-cell-text(selected, focus) { + color: HighlightText; +} + +tree[seltype="cell"] > treechildren::-moz-tree-cell(active, selected, focus) { + background-color: Highlight; +} +tree[seltype="cell"] > treechildren::-moz-tree-cell-text(active, selected, focus) { + color: HighlightText; +} + +tree[seltype="text"] > treechildren::-moz-tree-cell-text(active, selected, focus) { + background-color: Highlight; + color: HighlightText; +} + +/* ::::: lines connecting cells ::::: */ + +treechildren::-moz-tree-line { + /* XXX there should be no border on Mac, but trees currently + paint the line black by default, so I'll just leave this + for now. */ + visibility: hidden; + border: 1px dotted grey; +} + + +/* ::::: tree separator ::::: */ + +treechildren::-moz-tree-separator { + border-top: 1px dashed #C7C7C7; + margin: 0 2px; +} + + +/* ::::: drop feedback ::::: */ + +tree[seltype="cell"] > treechildren::-moz-tree-cell(primary, dropOn), +tree[seltype="text"] > treechildren::-moz-tree-cell(primary, dropOn), +treechildren::-moz-tree-cell(primary, dropOn) { + background-color: #A1A1A1 !important; + color: #FFF !important; + background-image: none; +} +tree[seltype="cell"] > treechildren::-moz-tree-cell-text(primary, dropOn), +tree[seltype="text"] > treechildren::-moz-tree-cell-text(primary, dropOn), +treechildren::-moz-tree-cell-text(primary, dropOn) { + color: #FFF !important; +} + +treechildren::-moz-tree-drop-feedback { + background-color: #A1A1A1; + width: 50px; + height: 2px; + margin-inline-start: 5px; +} + +/* ::::: tree progress meter ::::: */ + +treechildren::-moz-tree-progressmeter { + margin: 2px 4px; + border: 2px solid; + -moz-border-top-colors: #AAAAAA #000000; + -moz-border-right-colors: #FFFFFF #000000; + -moz-border-bottom-colors: #FFFFFF #000000; + -moz-border-left-colors: #AAAAAA #000000; +} + +treechildren::-moz-tree-cell-text(progressmeter) { + margin: 2px 4px; + -moz-appearance: progressbar; +} + +/* ::::: tree columns ::::: */ + +treecol, +treecolpicker { + -moz-appearance: treeheadercell; + -moz-box-align: center; + -moz-box-pack: center; + border: 2px solid; + -moz-border-top-colors: ThreeDHighlight ThreeDLightShadow; + -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow; + -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow; + -moz-border-left-colors: ThreeDHighlight ThreeDLightShadow; + background-color: -moz-Dialog; + color: -moz-DialogText; + padding: 0px 4px; +} + +.treecol-image { + padding: 0px 1px; +} + +.treecol-text { + margin: 0px !important; +} + +treecol[hideheader="true"] { + -moz-appearance: none; + border: none; + padding: 0; + max-height: 0px; +} + +/* ..... internal box ..... */ + +treecol:hover:active, +treecolpicker:hover:active { + border-top: 2px solid; + border-bottom: 1px solid; + border-inline-start: 2px solid; + border-inline-end: 1px solid; + -moz-border-top-colors: ThreeDDarkShadow ThreeDShadow; + -moz-border-right-colors: ThreeDDarkShadow; + -moz-border-bottom-colors: ThreeDDarkShadow; + -moz-border-left-colors: ThreeDDarkShadow ThreeDShadow; + background-color: #666666; +} + +/* ::::: column drag and drop styles ::::: */ + +treecol[dragging="true"] { + -moz-border-top-colors: ThreeDDarkShadow ThreeDShadow !important; + -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow!important; + -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow !important; + -moz-border-left-colors: ThreeDDarkShadow ThreeDShadow !important; + padding: 0px 4px !important; + background-color: ThreeDShadow !important; + color: ThreeDHighlight !important; +} + +treecol[insertafter="true"]:-moz-locale-dir(ltr), +treecol[insertbefore="true"]:-moz-locale-dir(rtl) { + -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow; +} + +treecol[insertafter="true"]:-moz-locale-dir(rtl), +treecol[insertbefore="true"]:-moz-locale-dir(ltr) { + -moz-border-left-colors: ThreeDDarkShadow ThreeDShadow; +} + +treechildren::-moz-tree-column(insertbefore) { + border-inline-start: 1px solid ThreeDShadow; +} + +treechildren::-moz-tree-column(insertafter) { + border-inline-end: 1px solid ThreeDShadow; +} + +/* ::::: column picker ::::: */ + +.tree-columnpicker-icon { + list-style-image: url("chrome://global/skin/tree/columnpicker.gif"); +} + +/* ::::: twisty ::::: */ + +treechildren::-moz-tree-twisty { + -moz-appearance: treetwisty; + padding-inline-end: 2px; +} + +treechildren::-moz-tree-twisty(open) { + -moz-appearance: treetwistyopen; +} + +treechildren::-moz-tree-twisty(Name, separator) { + -moz-appearance: none; +} + +treechildren::-moz-tree-indentation { + width: 16px; +} + +/* ::::: gridline style ::::: */ + +treechildren.gridlines::-moz-tree-cell { + border-inline-end: 1px solid GrayText; + border-bottom: 1px solid GrayText; +} + +treechildren.gridlines::-moz-tree-row { + border: none; +} + +/* ::::: editable tree ::::: */ + +.tree-input { + -moz-appearance: none; + border-width: 0; + box-shadow: @focusRingShadow@; + margin: 0; + margin-inline-start: -2px; + padding: 2px 1px 1px; +} + +treechildren::-moz-tree-cell(active, selected, focus, editing), +tree[seltype="cell"] > treechildren::-moz-tree-cell(active, selected, focus, editing), +tree[seltype="text"] > treechildren::-moz-tree-cell(active, selected, focus, editing) { + background-color: transparent; + border: none; +} + +treechildren::-moz-tree-cell-text(active, selected, editing) { + opacity: 0; +} diff --git a/toolkit/themes/osx/global/tree/arrow-disclosure.svg b/toolkit/themes/osx/global/tree/arrow-disclosure.svg new file mode 100644 index 0000000000..0fee858071 --- /dev/null +++ b/toolkit/themes/osx/global/tree/arrow-disclosure.svg @@ -0,0 +1,28 @@ +<!-- 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/. --> +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> + + <style> + .icon:not(:target) { + display: none; + } + + .icon { + fill: #8c8c8c; + } + + .icon.white { + fill: #fff; + } + </style> + + <polygon id="arrow-disclosure-collapsed" class="icon" points="4,4 12,8.5 4,13" /> + <polygon id="arrow-disclosure-collapsed-rtl" class="icon" points="4,8.5 12,4 12,13" /> + <polygon id="arrow-disclosure-collapsed-inverted" class="icon white" points="4,4 12,8.5 4,13" /> + <polygon id="arrow-disclosure-collapsed-inverted-rtl" class="icon white" points="4,8.5 12,4 12,13" /> + + <polygon id="arrow-disclosure-expanded" class="icon" points="3,5 12,5 7.5,13" /> + <polygon id="arrow-disclosure-expanded-inverted" class="icon white" points="3,5 12,5 7.5,13" /> + +</svg> diff --git a/toolkit/themes/osx/global/tree/columnpicker.gif b/toolkit/themes/osx/global/tree/columnpicker.gif Binary files differnew file mode 100644 index 0000000000..167f3789af --- /dev/null +++ b/toolkit/themes/osx/global/tree/columnpicker.gif diff --git a/toolkit/themes/osx/global/tree/folder.png b/toolkit/themes/osx/global/tree/folder.png Binary files differnew file mode 100644 index 0000000000..8f21ff790a --- /dev/null +++ b/toolkit/themes/osx/global/tree/folder.png diff --git a/toolkit/themes/osx/global/tree/folder@2x.png b/toolkit/themes/osx/global/tree/folder@2x.png Binary files differnew file mode 100644 index 0000000000..c07acf5ffb --- /dev/null +++ b/toolkit/themes/osx/global/tree/folder@2x.png diff --git a/toolkit/themes/osx/global/viewbuttons.css b/toolkit/themes/osx/global/viewbuttons.css new file mode 100644 index 0000000000..bb407a64ed --- /dev/null +++ b/toolkit/themes/osx/global/viewbuttons.css @@ -0,0 +1,36 @@ +/* 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/. */ + +%include shared.inc + +#topBar { + -moz-appearance: toolbar; +} + +.viewGroupWrapper { + -moz-box-align: center; + -moz-box-pack: center; +} + +#viewGroup { + margin: 4px 0 9px; +} + +#viewGroup > radio, +#viewGroup > toolbarbutton { + -moz-box-orient: vertical; + -moz-box-align: center; + -moz-appearance: toolbarbutton; + font: menu; + text-shadow: @loweredShadow@; + margin: 0; + padding: 0 1px; + height: 22px; +} + +#viewGroup > radio[selected=true], +#viewGroup > toolbarbutton[checked=true] { + color: #FFF !important; + text-shadow: rgba(0, 0, 0, 0.4) 0 1px; +} diff --git a/toolkit/themes/osx/global/wizard.css b/toolkit/themes/osx/global/wizard.css new file mode 100644 index 0000000000..9c5e6200ce --- /dev/null +++ b/toolkit/themes/osx/global/wizard.css @@ -0,0 +1,62 @@ +/* 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/. */ + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +wizard { + padding: 14px; +} + +#header { + display: inline !important; +} + +.wizard-header { + -moz-appearance: dialog; +} + +.wizard-header-box-1 { + color: #000; +} + +.wizard-header-box-text { + padding: 6px 10px; + font: menu; + font-weight: bold; +} + +.wizard-header-label { + margin-left: 23px; + font-weight: bold; +} + +.wizard-header-box-icon { + margin-top: 3px; + margin-inline-end: 20px; + margin-bottom: 0; + margin-inline-start: 3px; +} + +wizard[branded="true"] .wizard-header-icon { + list-style-image: url("chrome://branding/content/icon48.png"); +} + +.wizard-page-box { + padding: 15px 23px; + -moz-appearance: dialog; +} + +.wizard-buttons-separator { + margin: 0 !important; + border-bottom: 1px solid #fff !important; +} + +.wizard-buttons-btm { + padding: 3px 6px 6px; +} + +.wizard-button { + font: menu !important; +} + diff --git a/toolkit/themes/osx/mochitests/.eslintrc.js b/toolkit/themes/osx/mochitests/.eslintrc.js new file mode 100644 index 0000000000..2c669d844e --- /dev/null +++ b/toolkit/themes/osx/mochitests/.eslintrc.js @@ -0,0 +1,7 @@ +"use strict"; + +module.exports = { + "extends": [ + "../../../../testing/mochitest/chrome.eslintrc.js" + ] +}; diff --git a/toolkit/themes/osx/mochitests/chrome.ini b/toolkit/themes/osx/mochitests/chrome.ini new file mode 100644 index 0000000000..b7c425bc70 --- /dev/null +++ b/toolkit/themes/osx/mochitests/chrome.ini @@ -0,0 +1,3 @@ +[DEFAULT] + +[test_bug510426.xul] diff --git a/toolkit/themes/osx/mochitests/test_bug510426.xul b/toolkit/themes/osx/mochitests/test_bug510426.xul new file mode 100644 index 0000000000..4294ce42de --- /dev/null +++ b/toolkit/themes/osx/mochitests/test_bug510426.xul @@ -0,0 +1,54 @@ +<?xml version="1.0"?> +<!-- 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/. --> + +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=510426 +--> +<window title="Mozilla Bug 510426" + xmlns:html="http://www.w3.org/1999/xhtml" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + align="start"> + <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> + +<body xmlns="http://www.w3.org/1999/xhtml"> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=510426">Mozilla Bug 510426</a> +</body> + +<notificationbox id="nb" width="300" height="100"> + <box width="100" height="100" id="overflowGenerator"/> +</notificationbox> + +<script class="testbody" type="application/javascript"> +<![CDATA[ + +/** Test for Bug 510426 **/ +SimpleTest.waitForExplicitFinish(); + +function openNotification() { + var nb = document.getElementById("nb"); + var n = nb.appendNotification("Notification", "", null, + nb.PRIORITY_WARNING_LOW, [{ + label: "Button", + accesskey: "u", + callback: null, + popup: null + }]); + n.addEventListener("transitionend", function (event) { + if (event.propertyName == "margin-top") { + setTimeout(function () { + is(n.getBoundingClientRect().height, 27, "notification bar has wrong height"); + SimpleTest.finish(); + }, 0); + } + }, false); +} + +window.onload = openNotification; + +]]> +</script> +</window> diff --git a/toolkit/themes/osx/moz.build b/toolkit/themes/osx/moz.build new file mode 100644 index 0000000000..fab1daff25 --- /dev/null +++ b/toolkit/themes/osx/moz.build @@ -0,0 +1,8 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# 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/. + +DIRS += ['global', 'mozapps'] + +MOCHITEST_CHROME_MANIFESTS += ['mochitests/chrome.ini'] diff --git a/toolkit/themes/osx/mozapps/downloads/buttons.png b/toolkit/themes/osx/mozapps/downloads/buttons.png Binary files differnew file mode 100644 index 0000000000..04da26a252 --- /dev/null +++ b/toolkit/themes/osx/mozapps/downloads/buttons.png diff --git a/toolkit/themes/osx/mozapps/downloads/downloadIcon.png b/toolkit/themes/osx/mozapps/downloads/downloadIcon.png Binary files differnew file mode 100644 index 0000000000..42dc4943d7 --- /dev/null +++ b/toolkit/themes/osx/mozapps/downloads/downloadIcon.png diff --git a/toolkit/themes/osx/mozapps/downloads/downloads.css b/toolkit/themes/osx/mozapps/downloads/downloads.css new file mode 100644 index 0000000000..3ba246c1fc --- /dev/null +++ b/toolkit/themes/osx/mozapps/downloads/downloads.css @@ -0,0 +1,123 @@ +/* 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/. */ + +%include ../../global/shared.inc + +#downloadView { + -moz-appearance: none; + margin: 0; + padding: 0; + border-width: 0; +} + +/* Download View Items */ +richlistitem[type="download"] { + padding: 5px; + min-height: 44px !important; + border: 1px solid transparent; +} + +richlistitem[type="download"]:not([selected="true"]):nth-child(odd) { + background-color: -moz-oddtreerow; +} + +richlistitem[type="download"] .dateTime, +richlistitem[type="download"] .status { + font-size: smaller; + color: #555; +} + +richlistitem[selected="true"][type="download"] { + outline: none; +} + +richlistbox:focus > richlistitem[selected="true"][type="download"] .dateTime, +richlistbox:focus > richlistitem[selected="true"][type="download"] .status { + color: highlighttext; +} + + +richlistitem[type="download"] button { + -moz-appearance: none; + min-height: 16px; + min-width: 16px; + max-height: 16px; + max-width: 16px; + padding: 0; + margin: 0 1px 0 1px; +} + +/** + * Images for buttons in the interface + */ +richlistitem[type="download"] button { + list-style-image: url(chrome://mozapps/skin/downloads/buttons.png); +} +.cancel { + -moz-image-region: rect(0px, 16px, 16px, 0px); +} +.cancel:hover { + -moz-image-region: rect(0px, 32px, 16px, 16px); +} +.cancel:hover:active { + -moz-image-region: rect(0px, 48px, 16px, 32px); +} + +.pause { + -moz-image-region: rect(48px, 16px, 64px, 0px); +} +.pause:hover { + -moz-image-region: rect(48px, 32px, 64px, 16px); +} +.pause:not([disabled="true"]):hover:active { + -moz-image-region: rect(48px, 48px, 64px, 32px); +} +.pause[disabled="true"] { + -moz-image-region: rect(48px, 16px, 64px, 0px); +} + +.resume { + -moz-image-region: rect(16px, 16px, 32px, 0px); +} +.resume:hover { + -moz-image-region: rect(16px, 32px, 32px, 16px); +} +.resume:hover:active { + -moz-image-region: rect(16px, 48px, 32px, 32px); +} + +.retry { + -moz-image-region: rect(32px, 16px, 48px, 0px); +} +.retry:hover { + -moz-image-region: rect(32px, 32px, 48px, 16px); +} +.retry:hover:active { + -moz-image-region: rect(32px, 48px, 48px, 32px); +} + +.blockedIcon { + list-style-image: url(chrome://global/skin/icons/Error.png); +} + +/* prevent flickering when changing states */ +.downloadTypeIcon { + height: 32px; + width: 32px; + padding-inline-end: 2px; +} + +#search { + -moz-box-pack: end; + padding-inline-end: 4px; + -moz-appearance: statusbar; +} + +#clearListButton { + -moz-appearance: toolbarbutton; + min-height: 18px; + min-width: 0; + margin: 0 6px; + text-shadow: @loweredShadow@; +} diff --git a/toolkit/themes/osx/mozapps/downloads/unknownContentType.css b/toolkit/themes/osx/mozapps/downloads/unknownContentType.css new file mode 100644 index 0000000000..28d01b57af --- /dev/null +++ b/toolkit/themes/osx/mozapps/downloads/unknownContentType.css @@ -0,0 +1,30 @@ +/* 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/. */ + +#unknownContentType { + font: menu; +} + +description { + font-weight: bold; +} + +.plain { + background-color: transparent; + background-image: none; + border: none; +} + +#contentTypeImage { + margin-right: 3px; + width: 16px; +} + +#container > .small-indent { + margin-left: 0px; +} + +.small-indent label { + margin-left: 0px; +} diff --git a/toolkit/themes/osx/mozapps/extensions/about.css b/toolkit/themes/osx/mozapps/extensions/about.css new file mode 100644 index 0000000000..cfabd47dba --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/about.css @@ -0,0 +1,78 @@ +/* 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/. */ + +#genericAbout { + padding: 0px; + min-height: 200px; + max-height: 400px; + width: 30em; +} + +#clientBox { + background-color: -moz-Dialog; + color: -moz-DialogText; +} + +.basic-info { + padding: 10px; +} + +#extensionIcon { + list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.png"); + max-width: 64px; + max-height: 64px; + -moz-margin-end: 6px; +} + +#genericAbout[addontype="theme"] #extensionIcon { + list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png"); +} + +#genericAbout[addontype="locale"] #extensionIcon { + list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png"); +} + +#genericAbout[addontype="plugin"] #extensionIcon { + list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png"); +} + +#genericAbout[addontype="dictionary"] #extensionIcon { + list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png"); +} + +#extensionName { + font-size: 200%; + font-weight: bolder; +} + +#extensionVersion { + font-weight: bold; +} + +#extensionDescription { + margin-top: 4px; +} + +#groove { + margin-top: 8px; +} + +#extensionDetailsBox { + overflow: auto; + min-height: 100px; +} + +.boxIndent { + -moz-margin-start: 18px; +} + +#extensionCreator, .contributor { + margin: 0px; +} + +.sectionTitle { + padding: 2px 0px 3px 0px; + margin-top: 3px; + font-weight: bold; +} diff --git a/toolkit/themes/osx/mozapps/extensions/alerticon-error.png b/toolkit/themes/osx/mozapps/extensions/alerticon-error.png Binary files differnew file mode 100644 index 0000000000..8740e4911a --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/alerticon-error.png diff --git a/toolkit/themes/osx/mozapps/extensions/alerticon-info-negative.png b/toolkit/themes/osx/mozapps/extensions/alerticon-info-negative.png Binary files differnew file mode 100644 index 0000000000..2c5f628ab6 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/alerticon-info-negative.png diff --git a/toolkit/themes/osx/mozapps/extensions/alerticon-info-positive.png b/toolkit/themes/osx/mozapps/extensions/alerticon-info-positive.png Binary files differnew file mode 100644 index 0000000000..a186c6b7ad --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/alerticon-info-positive.png diff --git a/toolkit/themes/osx/mozapps/extensions/alerticon-warning.png b/toolkit/themes/osx/mozapps/extensions/alerticon-warning.png Binary files differnew file mode 100644 index 0000000000..75ea826f91 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/alerticon-warning.png diff --git a/toolkit/themes/osx/mozapps/extensions/blocklist.css b/toolkit/themes/osx/mozapps/extensions/blocklist.css new file mode 100644 index 0000000000..b241c94468 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/blocklist.css @@ -0,0 +1,20 @@ +/* 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/. */ + +richlistitem { + padding-top: 6px; + padding-bottom: 6px; + -moz-padding-start: 7px; + -moz-padding-end: 7px; + border-bottom: 1px solid #C0C0C0; +} + +.addon-name-version { + font-size: 110%; +} + +.blockedLabel { + font-weight: bold; + font-style: italic; +} diff --git a/toolkit/themes/osx/mozapps/extensions/cancel.png b/toolkit/themes/osx/mozapps/extensions/cancel.png Binary files differnew file mode 100644 index 0000000000..0d98ab2359 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/cancel.png diff --git a/toolkit/themes/osx/mozapps/extensions/category-available.png b/toolkit/themes/osx/mozapps/extensions/category-available.png Binary files differnew file mode 100644 index 0000000000..d1b737ab05 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/category-available.png diff --git a/toolkit/themes/osx/mozapps/extensions/category-dictionaries.png b/toolkit/themes/osx/mozapps/extensions/category-dictionaries.png Binary files differnew file mode 100644 index 0000000000..54ae4f93fc --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/category-dictionaries.png diff --git a/toolkit/themes/osx/mozapps/extensions/category-discover.png b/toolkit/themes/osx/mozapps/extensions/category-discover.png Binary files differnew file mode 100644 index 0000000000..a6f5b49b37 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/category-discover.png diff --git a/toolkit/themes/osx/mozapps/extensions/category-experiments.png b/toolkit/themes/osx/mozapps/extensions/category-experiments.png Binary files differnew file mode 100644 index 0000000000..a9d00545ef --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/category-experiments.png diff --git a/toolkit/themes/osx/mozapps/extensions/category-plugins.png b/toolkit/themes/osx/mozapps/extensions/category-plugins.png Binary files differnew file mode 100644 index 0000000000..5c4d8bf471 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/category-plugins.png diff --git a/toolkit/themes/osx/mozapps/extensions/category-recent.png b/toolkit/themes/osx/mozapps/extensions/category-recent.png Binary files differnew file mode 100644 index 0000000000..7ecfc7d4c8 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/category-recent.png diff --git a/toolkit/themes/osx/mozapps/extensions/category-search.png b/toolkit/themes/osx/mozapps/extensions/category-search.png Binary files differnew file mode 100644 index 0000000000..52e91a7cea --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/category-search.png diff --git a/toolkit/themes/osx/mozapps/extensions/category-searchengines.png b/toolkit/themes/osx/mozapps/extensions/category-searchengines.png Binary files differnew file mode 100644 index 0000000000..b893cb48a2 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/category-searchengines.png diff --git a/toolkit/themes/osx/mozapps/extensions/category-service.png b/toolkit/themes/osx/mozapps/extensions/category-service.png Binary files differnew file mode 100644 index 0000000000..997c8541ca --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/category-service.png diff --git a/toolkit/themes/osx/mozapps/extensions/dictionaryGeneric-16.png b/toolkit/themes/osx/mozapps/extensions/dictionaryGeneric-16.png Binary files differnew file mode 100644 index 0000000000..4ad1a1a825 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/dictionaryGeneric-16.png diff --git a/toolkit/themes/osx/mozapps/extensions/dictionaryGeneric.png b/toolkit/themes/osx/mozapps/extensions/dictionaryGeneric.png Binary files differnew file mode 100644 index 0000000000..54ae4f93fc --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/dictionaryGeneric.png diff --git a/toolkit/themes/osx/mozapps/extensions/discover-logo.png b/toolkit/themes/osx/mozapps/extensions/discover-logo.png Binary files differnew file mode 100644 index 0000000000..cd50735a89 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/discover-logo.png diff --git a/toolkit/themes/osx/mozapps/extensions/eula.css b/toolkit/themes/osx/mozapps/extensions/eula.css new file mode 100644 index 0000000000..5fb2c52df2 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/eula.css @@ -0,0 +1,47 @@ +/* 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/. */ + +#icon { + list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.png"); + max-width: 48px; + max-height: 48px; + -moz-margin-end: 6px; +} + +#eula-dialog[addontype="theme"] #icon { + list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png"); +} + +#eula-dialog[addontype="locale"] #icon { + list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png"); +} + +#eula-dialog[addontype="plugin"] #icon { + list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png"); +} + +#eula-dialog[addontype="dictionary"] #icon { + list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png"); +} + +#heading-container { + -moz-box-align: center; +} + +#heading { + font-size: 120%; +} + +#eula { + -moz-appearance: none; + color: -moz-FieldText; + background-color: -moz-Field; + margin: 1em; + border: 1px solid; + -moz-border-top-colors: ActiveBorder; + -moz-border-right-colors: ActiveBorder; + -moz-border-bottom-colors: ActiveBorder; + -moz-border-left-colors: ActiveBorder; +} + diff --git a/toolkit/themes/osx/mozapps/extensions/experimentGeneric.png b/toolkit/themes/osx/mozapps/extensions/experimentGeneric.png Binary files differnew file mode 100644 index 0000000000..a9d00545ef --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/experimentGeneric.png diff --git a/toolkit/themes/osx/mozapps/extensions/extensionGeneric-16.png b/toolkit/themes/osx/mozapps/extensions/extensionGeneric-16.png Binary files differnew file mode 100644 index 0000000000..fc6c8a2583 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/extensionGeneric-16.png diff --git a/toolkit/themes/osx/mozapps/extensions/extensionGeneric.png b/toolkit/themes/osx/mozapps/extensions/extensionGeneric.png Binary files differnew file mode 100644 index 0000000000..6a76774c7b --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/extensionGeneric.png diff --git a/toolkit/themes/osx/mozapps/extensions/extensions.css b/toolkit/themes/osx/mozapps/extensions/extensions.css new file mode 100644 index 0000000000..474cb12d10 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/extensions.css @@ -0,0 +1,1206 @@ +/* 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/. */ + +@import url("chrome://global/skin/inContentUI.css"); + +%include ../../global/shared.inc + +@namespace html url("http://www.w3.org/1999/xhtml"); + + +/*** global warnings ***/ + +.global-warning-container { + overflow-x: hidden; +} + +.global-warning { + -moz-box-align: center; + padding: 0 8px; + color: #916D15; + font-weight: bold; +} + +.global-warning, +.global-warning .button-link { + text-shadow: @loweredShadow@; +} + +#addons-page[warning] .global-warning-container { + background-color: rgba(255, 255, 0, 0.1); + background-image: url("chrome://mozapps/skin/extensions/stripes-warning.png"); + background-repeat: repeat-x; +} + +#detail-view .global-warning { + padding: 4px 12px; + min-height: 31px; + border-bottom: 1px solid rgba(50, 65, 92, 0.4); +} + +@media (max-width: 600px) { + .global-warning-text { + display: none; + } + + .global-warning .warning-icon { + background-color: rgba(255, 255, 255, 0.7); + box-shadow: 0px 0px 2px 4px rgba(255, 255, 255, 0.7); + border-radius: 10px; + } +} + +/*** global informations ***/ +#addons-page .global-info-container { + background-color: #e3e6eb; + border-top-right-radius: 5px; + border-top-left-radius: 5px; +} + +/* Plugins aren't yet disabled by safemode (bug 342333), + so don't show that warning when viewing plugins. */ +#addons-page[warning="safemode"] .view-pane[type="plugin"] .global-warning-container, +#addons-page[warning="safemode"] #detail-view[loading="true"] .global-warning-container { + background-color: inherit; + background-image: none; +} + + +/*** notification icons ***/ + +.warning-icon { + list-style-image: url("chrome://mozapps/skin/extensions/alerticon-warning.png"); + width: 16px; + height: 15px; + margin: 3px 0; +} + +.error-icon { + list-style-image: url("chrome://mozapps/skin/extensions/alerticon-error.png"); + width: 16px; + height: 15px; + margin: 3px 0; +} + +.pending-icon, +.info-icon { + list-style-image: url("chrome://mozapps/skin/extensions/alerticon-info-positive.png"); + width: 16px; + height: 15px; + margin: 3px 0; +} + +.addon-view[pending="disable"] .pending-icon, +.addon-view[pending="uninstall"] .pending-icon { + list-style-image: url("chrome://mozapps/skin/extensions/alerticon-info-negative.png"); + width: 16px; + height: 15px; + margin: 3px 0; +} + + +/*** view alert boxes ***/ + +.alert-container { + -moz-box-align: center; +} + +.alert-spacer-before { + -moz-box-flex: 1; +} + +.alert-spacer-after { + -moz-box-flex: 3; +} + +.alert { + -moz-box-align: center; + padding: 10px; + color: #373D48; + font-size: 12px; + border: 1px solid #A8B8D1; + border-radius: 8px; + background-image: linear-gradient(rgba(255, 255, 255, 0.7), rgba(236, 241, 247, 0.7)); + background-clip: padding-box; + box-shadow: 0 -3px 0 rgba(58, 78, 103, 0.05) inset, + 0 3px 0 rgba(175, 195, 220, 0.3); +} + +.alert .alert-title { + font-weight: bold; + font-size: 200%; + margin-bottom: 15px; +} + +.alert button { + margin: 1em 2em; +} + +.loading { + list-style-image: url("chrome://global/skin/icons/loading_16.png"); + padding-left: 20px; + padding-right: 20px; +} + + + +/*** category selector ***/ + +#categories { + -moz-appearance: none; + border: none; + -moz-margin-end: -1px; + background-color: transparent; + position: relative; + margin-top: 31px; +} + +.category { + -moz-appearance: none; + color: #252F3B; + border-width: 1px; + border-style: solid; + border-color: transparent; + padding: 10px 4px; + -moz-box-align: center; + overflow: hidden; + min-height: 0; +} + +.category:-moz-locale-dir(ltr) { + border-top-left-radius: 5px; + border-bottom-left-radius: 5px; +} + +.category:-moz-locale-dir(rtl) { + border-top-right-radius: 5px; + border-bottom-right-radius: 5px; +} + +.category[disabled] { + border-top: 0; + border-bottom: 0; + height: 0; + opacity: 0; + transition-property: height, opacity; + transition-duration: 1s, 0.8s; +} + +.category:not([disabled]) { + height: 52px; + transition-property: height, opacity; + transition-duration: 1s, 0.8s; +} + +.category[selected] { + background-color: rgba(255, 255, 255, 0.35); + color: -moz-dialogtext; + border-color: rgba(50, 65, 92, 0.4); + -moz-border-end-color: #C9CFD7; +} + +.category-name { + font-size: 150%; +} + +/* Maximize the size of the viewport when the window is small */ +@media (max-width: 800px) { + .category-name { + display: none; + } +} + +.category-badge { + background-color: #55D4FF; + padding: 2px 8px; + margin: 6px 0; + border-radius: 10000px; + color: #FFF; + font-weight: bold; + text-align: center; +} + +.category-badge[value="0"] { + visibility: hidden; +} + +.category-icon { + width: 32px; + height: 32px; + -moz-margin-start: 6px; +} + +#category-search > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-search.png"); +} +#category-discover > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-discover.png"); +} +#category-locale > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-languages.png"); +} +#category-searchengine > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-searchengines.png"); +} +#category-extension > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-extensions.png"); +} +#category-service > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-service.png"); +} +#category-theme > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-themes.png"); +} +#category-plugin > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-plugins.png"); +} +#category-dictionary > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-dictionaries.png"); +} +#category-experiment > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-experiments.png"); +} +#category-availableUpdates > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-available.png"); +} +#category-recentUpdates > .category-icon { + list-style-image: url("chrome://mozapps/skin/extensions/category-recent.png"); +} + + +/*** header ***/ + +#header { + margin-bottom: 18px; +} + +.nav-button { + list-style-image: url(chrome://mozapps/skin/extensions/navigation.png); +} + +#back-btn:-moz-locale-dir(ltr), +#forward-btn:-moz-locale-dir(rtl) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-right: none; + -moz-image-region: rect(0, 20px, 20px, 0); + padding-right: 3px; +} + +#back-btn:-moz-locale-dir(rtl), +#forward-btn:-moz-locale-dir(ltr) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + -moz-image-region: rect(0, 40px, 20px, 20px); + padding-left: 3px; +} + +#header-utils-btn { + list-style-image: url("chrome://mozapps/skin/extensions/utilities.svg#utilities"); + -moz-margin-end: 18px; +} + +#header-utils-btn > .toolbarbutton-menu-dropmarker { + list-style-image: url("chrome://mozapps/skin/extensions/toolbarbutton-dropmarker.png"); + padding: 0; + -moz-margin-start: 2px; +} + +#header-search { + margin: 0; + -moz-appearance: none; + padding: 3px 5px 2px; + border: 1px solid rgba(60,73,97,0.5); + border-radius: 10000px; + box-shadow: inset 0 1px 1px rgba(0,0,0,0.15), 0 1px rgba(255,255,255,0.25); + background: linear-gradient(rgba(255,255,255,0.2), rgba(255,255,255,0.3)); + background-clip: padding-box; +} + +@media (max-width: 600px) { + #header-search { + width: 12em; + } +} + +#header-search[focused] { + box-shadow: @focusRingShadow@, inset 0 1px 1px rgba(0,0,0,0.15); + border-color: -moz-mac-focusring; +} + +#header-search > .textbox-input-box { + -moz-padding-start: 15px; + background: url("chrome://mozapps/skin/extensions/search.png") left no-repeat; +} + +#header-search > .textbox-input-box:-moz-locale-dir(rtl) { + background-position: right; +} + +#header-search > .textbox-input-box > html|*.textbox-input::-moz-placeholder { + color: #5C6470; + opacity: 1.0; +} + +.view-header { + padding: 4px; + margin: 0; + min-height: 31px; + border-bottom: 1px solid rgba(50, 65, 92, 0.4); + background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05)); +} + + +/*** sorters ***/ + +.sort-controls { + -moz-appearance: none; +} + +.sorter { + -moz-appearance: none; + border: none; + color: #41434B; + background-color: transparent; + border-radius: 10000px; + padding: 0 6px; + margin: 0 6px; + min-width: 12px !important; + -moz-box-direction: reverse; +} + +.sorter[checkState="1"], +.sorter[checkState="2"], +.sorter:active:hover { + text-shadow: @loweredShadow@; + background-color: #C0C3CB; + box-shadow: inset #A3A6AC 0 1px 1px, @loweredShadow@; +} + +.sorter:hover { + text-shadow: @loweredShadow@; + background-color: #C0C3CB; +} + +.sorter[checkState="1"] { + list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif"); +} + +.sorter[checkState="2"] { + list-style-image: url("chrome://global/skin/arrow/arrow-up.gif"); +} + +.sorter .button-icon { + -moz-margin-start: 4px; +} + + +/*** discover view ***/ + +.discover-spacer-before, +.discover-spacer-after { + -moz-box-flex: 1; +} + +#discover-error .alert { + max-width: 45em; + -moz-box-flex: 1; +} + +.discover-logo { + list-style-image: url("chrome://mozapps/skin/extensions/discover-logo.png"); + -moz-margin-end: 15px; +} + +.discover-title { + font-weight: bold; + font-size: 24px; + font-family: MetaWebPro-Book, "Trebuchet MS", sans-serif; + margin: 0 0 15px 0; +} + +.discover-description { + text-align: justify; + margin: 0 0 15px 0; +} + +.discover-footer { + text-align: justify; +} + + +/*** list ***/ + +.list { + -moz-appearance: none; + margin: 0; + border: none; + background-color: transparent; +} + +.addon { + border-bottom: 1px solid #B6B1B9; + padding: 5px; + color: #373D48; +} + +.details { + cursor: pointer; + margin: 0; + -moz-margin-start: 10px; +} + +.icon-container { + width: 48px; + height: 48px; + margin: 3px 7px; + -moz-box-align: center; + -moz-box-pack: center; +} + +.icon { + list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.png"); + max-width: 48px; + max-height: 48px; +} + +.addon[active="false"] .icon { + filter: grayscale(1); +} + +.addon-view[type="theme"] .icon { + list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png"); +} + +.addon-view[type="locale"] .icon { + list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png"); +} + +.addon-view[type="plugin"] .icon { + list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png"); +} + +.addon-view[type="dictionary"] .icon { + list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png"); +} + +.addon-view[type="experiment"] .icon { + list-style-image: url("chrome://mozapps/skin/extensions/experimentGeneric.png"); +} + +.name-container { + font-size: 150%; + margin-bottom: 0; + font-weight: bold; + color: #000; + text-shadow: @loweredShadow@; + -moz-box-align: end; + -moz-box-flex: 1; +} + +.creator { + font-weight: bold; +} + +.creator .text-link { + color: #0066CC; +} + +.description-container { + margin-top: 8px; + -moz-margin-start: 6px; + -moz-box-align: center; +} + +.description { + margin: 0; +} + +.warning, +.pending, +.error { + -moz-margin-start: 48px; + font-weight: bold; + text-shadow: @loweredShadow@; + -moz-box-align: center; +} + +.content-container, +.basicinfo-container { + -moz-box-align: start; +} + +.addon[status="installing"] > .content-container { + -moz-box-align: stretch; +} + +.update-info-container { + -moz-box-align: center; +} + +.advancedinfo-container, +.update-available { + -moz-box-align: end; +} + +.install-status-container { + -moz-box-pack: end; + -moz-box-align: end; +} + +.name-outer-container { + -moz-box-pack: center; +} + +.relnotes-toggle-container, +.icon-outer-container { + -moz-box-pack: start; +} + +.status-container, +.control-container { + -moz-box-pack: end; +} + +.addon-view .warning { + color: #916D15; +} + +.addon-view .error { + color: #864441; +} + +.addon-view .pending { + color: #1B7123; +} + +.addon-view[pending="disable"] .pending, +.addon-view[pending="uninstall"] .pending { + color: #62666E; +} + +.addon-view[notification="warning"] { + background-image: linear-gradient(rgba(255, 255, 0, 0.2), rgba(255, 255, 0, 0.1)); +} + +.addon-view[notification="error"] { + background-image: linear-gradient(rgba(255, 0, 0, 0.2), rgba(255, 0, 0, 0.1)); +} + +.addon-view[notification="info"] { + background-image: linear-gradient(rgba(0, 0, 255, 0.2), rgba(0, 0, 255, 0.1)); +} + +.addon-view[pending="enable"], +.addon-view[pending="upgrade"], +.addon-view[pending="install"] { + background-image: linear-gradient(rgba(0, 255, 0, 0.2), rgba(0, 255, 0, 0.1)); +} + +.addon-view[pending="disable"], +.addon-view[pending="uninstall"] { + background-image: linear-gradient(rgba(128, 128, 128, 0.2), rgba(128, 128, 128, 0.1)); +} + +.addon .relnotes-container { + -moz-box-align: start; + height: 0; + overflow: hidden; + opacity: 0; + transition-property: height, opacity; + transition-duration: 0.5s, 0.5s; +} + +.addon[show-relnotes] .relnotes-container { + opacity: 1; + transition-property: height, opacity; + transition-duration: 0.5s, 0.5s; +} + +.addon .relnotes-header { + font-weight: bold; + margin: 10px 0; +} + +.addon .relnotes-toggle { + -moz-appearance: none; + border: none; + background: transparent; + font-weight: bold; + -moz-box-direction: reverse; + cursor: pointer; + list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif"); +} + +.addon .relnotes-toggle > .button-box > .button-icon { + -moz-padding-start: 4px; +} + +.addon[show-relnotes] .relnotes-toggle { + list-style-image: url("chrome://global/skin/arrow/arrow-up.gif"); +} + +.addon[active="false"] { + background-color: rgba(135, 135, 135, 0.1); + background-image: linear-gradient(rgba(135, 135, 135, 0), + rgba(135, 135, 135, 0.1)); +} + +.addon-view[active="false"], +.addon-view[active="false"] .name-container { + color: #686A6B; +} + +.addon-view[notification="warning"] { + background-image: url("chrome://mozapps/skin/extensions/stripes-warning.png"), + linear-gradient(rgba(255, 255, 0, 0.04), + rgba(255, 255, 0, 0)); + background-repeat: repeat-x; +} + +.addon-view[notification="warning"][native="false"] { + background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"), + linear-gradient(rgba(255, 128, 0, 0.04), + rgba(255, 128, 0, 0)); + background-repeat: repeat-x; +} + +.addon-view[notification="error"] { + background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"), + linear-gradient(rgba(255, 0, 0, 0.04), + rgba(255, 0, 0, 0)); + background-repeat: repeat-x; +} + +.addon-view[pending="enable"], +.addon-view[pending="upgrade"], +.addon-view[pending="install"] { + background-image: url("chrome://mozapps/skin/extensions/stripes-info-positive.png"), + linear-gradient(rgba(0, 255, 0, 0.04), + rgba(0, 255, 0, 0)); + background-repeat: repeat-x; +} + +.addon-view[pending="disable"], +.addon-view[pending="uninstall"] { + background-image: url("chrome://mozapps/skin/extensions/stripes-info-negative.png"), + linear-gradient(rgba(128, 128, 128, 0.04), + rgba(128, 128, 128, 0)); + background-repeat: repeat-x; +} + +.addon[selected] { + background-color: rgba(105, 125, 149, 0.39); + color: black; +} + +.addon[selected] .name-container { + text-shadow: @loweredShadow@; +} + +.addon[active="false"][selected] .name-container { + color: #3F3F3F; +} + + +/*** search view ***/ + +#search-filter { + padding: 5px 20px; + font-size: 120%; + overflow-x: hidden; + border-bottom: 1px solid rgba(50, 65, 92, 0.4); +} + +#search-filter-label { + font-weight: bold; + color: #666; +} + +.search-filter-radio { + -moz-appearance: none; + padding: 0 10px; + margin: 0 3px; + border-radius: 10000px; +} + +.search-filter-radio[selected] { + text-shadow: @loweredShadow@; + background-color: #C0C3CB; + box-shadow: inset #A3A6AC 0 1px 1px, @loweredShadow@; +} + +.search-filter-radio:hover { + text-shadow: @loweredShadow@; + background-color: #C0C3CB; +} + +.search-filter-radio .radio-check { + display: none; +} + +.search-filter-radio .radio-icon { + display: none; +} + +#search-allresults-link { + margin-top: 1em; + margin-bottom: 2em; +} + +/*** detail view ***/ + +#detail-view .loading { + opacity: 0; +} + +#detail-view[loading-extended] .loading { + opacity: 1; + transition-property: opacity; + transition-duration: 1s; +} + +.detail-view-container { + padding: 0 2em 2em 2em; + font-size: 110%; +} + +#detail-notifications { + margin-top: 1em; + margin-bottom: 2em; +} + +#detail-notifications .warning, +#detail-notifications .pending, +#detail-notifications .error { + -moz-margin-start: 0; +} + +#detail-icon-container { + width: 64px; + -moz-margin-end: 10px; + margin-top: 6px; +} + +#detail-icon { + max-width: 64px; + max-height: 64px; +} + +#detail-summary { + margin-bottom: 2em; +} + +#detail-name-container { + font-size: 200%; +} + +#detail-screenshot { + -moz-margin-end: 2em; + max-width: 300px; + max-height: 300px; +} + +#detail-screenshot[loading] { + background-image: url("chrome://global/skin/icons/loading_16.png"), + linear-gradient(rgba(255, 255, 255, 0.5), transparent); + background-position: 50% 50%; + background-repeat: no-repeat; + border-radius: 3px; +} + +#detail-screenshot[loading="error"] { + background-image: url("chrome://global/skin/media/error.png"), + linear-gradient(rgba(255, 255, 255, 0.5), transparent); +} + +#detail-desc-container { + margin-bottom: 2em; +} + +#detail-desc, #detail-fulldesc { + -moz-margin-start: 6px; + /* This is necessary to fix layout issues with multi-line descriptions, see + bug 592712*/ + outline: solid transparent; + white-space: pre-wrap; + min-width: 10em; +} + +#detail-fulldesc { + margin-top: 1em; +} + +#detail-contributions { + border-radius: 5px; + border: 1px solid rgba(50, 65, 92, 0.3); + margin-bottom: 2em; + padding: 1em; + background-color: rgba(255, 255, 255, 0.35); +} + +#detail-contrib-description { + font-style: italic; + margin-bottom: 1em; + color: #373D48; +} + +#detail-contrib-suggested { + color: grey; + font-weight: bold; +} + +#detail-contrib-btn { + -moz-appearance: none; + color: #FFF; + border: 1px solid #3A4EEE; + border-radius: 3px; + list-style-image: url("chrome://mozapps/skin/extensions/heart.png"); + background-color: #2F73EF; + background-image: linear-gradient(rgba(251, 252, 253, 0.70), rgba(246, 247, 248, 0.27) 49%, + rgba(231, 232, 233, 0.25) 51%, rgba(225, 226, 229, 0.1)); +} + +#detail-contrib-btn .button-box { + padding: 0 6px 1px 6px; +} + +#detail-contrib-btn .button-icon { + -moz-margin-end: 3px; +} + +#detail-contrib-btn:not(:active):hover { + border-color: #4271FF; + background-color: #0459F7; + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), + 0 0 3.5px hsl(190, 90%, 80%); + transition: background-color .4s ease-in, + border-color .3s ease-in, + box-shadow .3s ease-in; +} + +#detail-contrib-btn:active:hover { + background-color: #8FA1C1; + border-color: rgba(0, 0, 0, 0.65) rgba(0, 0, 0, 0.55) rgba(0, 0, 0, 0.5); + box-shadow: 0 0 6.5px rgba(0, 0, 0, 0.4) inset, + 0 0 2px rgba(0, 0, 0, 0.4) inset; +} + +#detail-grid { + margin-bottom: 2em; +} + +#detail-grid > columns > column:first-child { + min-width: 15em; + max-width: 25em; +} + +.detail-row[first-row="true"], +.detail-row-complex[first-row="true"], +setting[first-row="true"] { + border-top: none; +} + +.detail-row, +.detail-row-complex, +setting { + border-top: 2px solid; + -moz-border-top-colors: rgba(28, 31, 37, 0.2) rgba(255, 255, 255, 0.2); + -moz-box-align: center; + min-height: 30px; +} + +#detail-controls { + margin-bottom: 1em; +} + +#detail-view[active="false"]:not([pending]):not([notification]) { + background-image: linear-gradient(rgba(135, 135, 135, 0.1), + rgba(135, 135, 135, 0)); +} + +setting[first-row="true"] { + margin-top: 2em; +} + +setting { + -moz-box-align: start; +} + +.preferences-alignment { + min-height: 30px; + -moz-box-align: center; +} + +.preferences-description { + font-size: 90.9%; + color: graytext; + margin-top: -2px; + -moz-margin-start: 2em; + white-space: pre-wrap; +} + +.preferences-description:empty { + display: none; +} + +setting[type="radio"] > radiogroup { + -moz-box-orient: horizontal; +} + + +/*** creator ***/ + +.creator > label { + -moz-margin-start: 0; + -moz-margin-end: 0; +} + +.creator > .text-link { + margin-top: 1px; + margin-bottom: 1px; +} + + +/*** rating ***/ + +.meta-rating { + -moz-margin-end: 0; + margin-top: 2px; +} + +.meta-rating > .star { + list-style-image: url("chrome://mozapps/skin/extensions/rating-not-won.png"); + padding: 0 1px; +} + +.meta-rating > .star[on="true"] { + list-style-image: url("chrome://mozapps/skin/extensions/rating-won.png"); +} + + +/*** download progress ***/ + +.download-progress { + background-image: linear-gradient(#DCDEE3, #CBCED6); + border: 1px solid #858898; + border-radius: 3px; + box-shadow: inset #E3E8EC 0 1px 1px, @loweredShadow@; + width: 200px; + height: 21px; + margin: 0 8px; +} + +.download-progress[mode="undetermined"] .progress { + -moz-binding: url("chrome://global/content/bindings/progressmeter.xml#progressmeter-undetermined"); +} + +.download-progress[mode="undetermined"] { + border-color: #2E773A; +} + +.download-progress[mode="undetermined"] .status-container { + padding: 0 2px; +} + +.download-progress .start-cap, +.download-progress[complete] .end-cap, +.download-progress[mode="undetermined"] .end-cap, +.download-progress .progress .progress-bar { + -moz-appearance: none; + background-image: linear-gradient(#6AC47E, #4FAC6A); + margin-top: -1px; + margin-bottom: -1px; + border: 1px solid #2E773A; +} + +.download-progress .start-cap { + -moz-margin-start: -1px; + -moz-border-end-width: 0; +} + +.download-progress .end-cap { + -moz-margin-end: -1px; + -moz-border-start-width: 0px !important; +} + +.download-progress .progress .progress-bar { + border-left-width: 0; + border-right-width: 0; + min-height: 21px; +} + +.download-progress .progress { + -moz-appearance: none; + background-color: transparent; + padding: 0; + margin: 0; + border: none; +} + +.download-progress .start-cap, +.download-progress .end-cap { + width: 4px; +} + +.download-progress .start-cap:-moz-locale-dir(ltr), +.download-progress .end-cap:-moz-locale-dir(rtl) { + border-radius: 3px 0 0 3px; +} + +.download-progress .end-cap:-moz-locale-dir(ltr), +.download-progress .start-cap:-moz-locale-dir(rtl) { + border-radius: 0 3px 3px 0; +} + +.download-progress .cancel { + -moz-appearance: none; + background-color: rgba(255, 255, 255, 0.15); + border: 1px solid rgba(0, 0, 0, 0.4); + padding: 3px; + border-radius: 3px; + min-width: 0; + margin: 3px; +} + +.download-progress .cancel .button-text { + display: none; +} + +.download-progress .cancel .button-icon { + -moz-margin-start: 0; +} + +.download-progress .cancel { + list-style-image: url('chrome://mozapps/skin/extensions/cancel.png'); +} + +.download-progress .status-container { + -moz-box-align: center; +} + +.download-progress .status { + text-shadow: @loweredShadow@; +} + + +/*** install status ***/ + +.install-status { + -moz-box-align: center; +} + + +/*** check for updates ***/ + +#updates-container { + -moz-box-align: center; +} + +#updates-installed, +#updates-downloaded { + color: #3C735C; + font-weight: bold; +} + +#update-selected { + margin: 12px; +} + + +/*** buttons ***/ + +.addon-control[disabled="true"]:not(.no-auto-hide) { + display: none; +} + +.no-auto-hide .addon-control { + display: block !important; +} + +.no-auto-hide > .menulist-dropmarker { + -moz-padding-start: 0px !important; +} + +button.button-link { + -moz-appearance: none; + background: transparent; + border: none; + box-shadow: none; + text-decoration: underline; + color: #0066CC; + cursor: pointer; + min-width: 0; + margin: 0 6px; +} + +.text-link { + color: #3386D5; +} + +.button-link:hover, +.text-link:hover { + color: #3DA1FF; +} + +/* Needed to override normal button style from inContent.css */ +button.button-link:not([disabled="true"]):active:hover { + background: transparent; + border: none; + box-shadow: none; +} + +.header-button { + -moz-appearance: none; + padding: 0 4px; + margin: 0; + height: 22px; + border: 1px solid rgba(60,73,97,0.5); + border-radius: @toolbarbuttonCornerRadius@; + box-shadow: inset 0 1px rgba(255,255,255,0.25), 0 1px rgba(255,255,255,0.25); + background: linear-gradient(rgba(255,255,255,0.45), transparent); + background-clip: padding-box; +} + +.header-button .toolbarbutton-text { + display: none; +} + +.header-button[disabled="true"] .toolbarbutton-icon { + opacity: 0.4; +} + +.header-button:not([disabled="true"]):active:hover, +.header-button[open="true"] { + border-color: rgba(45,54,71,0.7); + box-shadow: inset 0 0 4px rgb(45,54,71), 0 1px rgba(255,255,255,0.25); + background-image: linear-gradient(rgba(45,54,71,0.6), transparent); +} + +/*** telemetry experiments ***/ + +#detail-experiment-container { + font-size: 80%; + margin-bottom: 1em; +} + +#detail-experiment-bullet-container, +#detail-experiment-state, +#detail-experiment-time, +.experiment-bullet-container, +.experiment-state, +.experiment-time { + vertical-align: middle; + display: inline-block; +} + +.addon .experiment-bullet, +#detail-experiment-bullet { + fill: rgb(158, 158, 158); +} + +.addon[active="true"] .experiment-bullet, +#detail-view[active="true"] #detail-experiment-bullet { + fill: rgb(106, 201, 20); +} diff --git a/toolkit/themes/osx/mozapps/extensions/heart.png b/toolkit/themes/osx/mozapps/extensions/heart.png Binary files differnew file mode 100644 index 0000000000..655f4c4be7 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/heart.png diff --git a/toolkit/themes/osx/mozapps/extensions/localeGeneric.png b/toolkit/themes/osx/mozapps/extensions/localeGeneric.png Binary files differnew file mode 100644 index 0000000000..4d9ac5ad89 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/localeGeneric.png diff --git a/toolkit/themes/osx/mozapps/extensions/navigation.png b/toolkit/themes/osx/mozapps/extensions/navigation.png Binary files differnew file mode 100644 index 0000000000..ffc40d7e56 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/navigation.png diff --git a/toolkit/themes/osx/mozapps/extensions/newaddon.css b/toolkit/themes/osx/mozapps/extensions/newaddon.css new file mode 100644 index 0000000000..5bf04fab1d --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/newaddon.css @@ -0,0 +1,112 @@ +/* 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/. */ + +%include ../../global/shared.inc + +@import url("chrome://global/skin/inContentUI.css"); + +#addon-page { + padding: 0; +} + +#addon-scrollbox { + overflow: auto; + -moz-box-orient: vertical; + -moz-box-flex: 1; +} + +#spacer-start { + -moz-box-flex: 1; +} + +#spacer-end { + -moz-box-flex: 3; +} + +#addon-container { + overflow: visible; + max-width: 600px; + margin: 20px; + padding: 30px 90px; +} + +#addon-info { + -moz-box-align: start; + margin: 25px 10px; +} + +#icon { + -moz-margin-end: 10px; + max-width: 64px; + max-height: 64px; + list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.png"); +} + +.addon-info[type="theme"] #icon { + list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png"); +} + +.addon-info[type="locale"] #icon { + list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png"); +} + +.addon-info[type="plugin"] #icon { + list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png"); +} + +.addon-info[type="dictionary"] #icon { + list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png"); +} + +#name { + font-size: 130%; +} + +#author { + color: GrayText; +} + +#location { + color: GrayText; +} + +#warning { + margin-bottom: 25px; + -moz-box-align: start; +} + +#warning-icon { + list-style-image: url("chrome://mozapps/skin/extensions/alerticon-warning.png"); + width: 16px; + height: 15px; + -moz-margin-end: 5px; +} + +#allow { + -moz-margin-start: 84px; + margin-bottom: 20px; +} + +#continuePanel, +#restartPanel { + margin-top: 25px; + -moz-box-align: center; + -moz-box-pack: end; +} + +#continuePanel { + -moz-box-pack: end; +} + +#restartMessage { + text-align: right; +} + +#restartSpacer { + -moz-box-flex: 1; +} + +#later { + color: GrayText; +} diff --git a/toolkit/themes/osx/mozapps/extensions/rating-not-won.png b/toolkit/themes/osx/mozapps/extensions/rating-not-won.png Binary files differnew file mode 100644 index 0000000000..2761f19255 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/rating-not-won.png diff --git a/toolkit/themes/osx/mozapps/extensions/rating-won.png b/toolkit/themes/osx/mozapps/extensions/rating-won.png Binary files differnew file mode 100644 index 0000000000..336dd8f6eb --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/rating-won.png diff --git a/toolkit/themes/osx/mozapps/extensions/search.png b/toolkit/themes/osx/mozapps/extensions/search.png Binary files differnew file mode 100644 index 0000000000..93196dbbf6 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/search.png diff --git a/toolkit/themes/osx/mozapps/extensions/selectAddons.css b/toolkit/themes/osx/mozapps/extensions/selectAddons.css new file mode 100644 index 0000000000..8682b04b51 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/selectAddons.css @@ -0,0 +1,163 @@ +/* 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/. */ + +%include ../../global/shared.inc + +.heading { + font-size: 270%; + text-align: center; + margin: 0 120px; +} + +.progress { + margin: 10px 128px; +} + +.progress-label, +#errors-description { + text-align: center; + margin: 0 10px; +} + +#checking-heading, +#update-heading, +#errors-heading { + margin-top: 90px; +} + +#select-heading, +#confirm-heading { + margin-top: 10px; + margin-bottom: 10px; + text-align: center; +} + +#select-description, +#confirm-description { + margin: 10px; +} + +#select-list { + border: 1px solid WindowFrame; + background-color: Window; + margin: 10px; +} + +#select-grid column { + -moz-box-align: center; +} + +#select-grid row { + -moz-box-align: stretch; +} + +#select-grid row:nth-of-type(odd) { + background-color: -moz-oddtreerow; +} + +#select-grid label, +#select-grid checkbox { + margin-top: 0; + margin-bottom: 0; +} + +.select-cell { + -moz-box-align: center; + -moz-box-pack: start; + box-sizing: border-box; +} + +#select-header { + background-color: Window !important; +} + +#select-header .select-cell { + -moz-appearance: treeheadercell; + border: 2px solid; + -moz-border-top-colors: ThreeDHighlight ThreeDLightShadow; + -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow; + -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow; + -moz-border-left-colors: ThreeDHighlight ThreeDLightShadow; + background-color: -moz-Dialog; + color: -moz-DialogText; +} + +.select-keep { + -moz-box-pack: center; +} + +.select-icon { + width: 20px; +} + +#select-grid separator { + display: none; +} + +.addon-name, +.addon-action-message, +.addon-action-update { + box-sizing: border-box; + margin: 0; + padding: 2px 6px; +} + +.addon:not([active]) .addon-name, +.addon:not([active]) .addon-action-message, +.addon:not([active]) .addon-action-update { + color: GrayText; +} + +.addon-icon { + height: 16px; + width: 16px; + margin: 2px; + list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric-16.png"); +} + +.addon-icon[type="theme"] { + list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric-16.png"); +} + +.addon-icon[type="plugin"] { + list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric-16.png"); +} + +.addon-icon[type="dictionary"] { + list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric-16.png"); +} + +.action-list { + margin-top: 10px; + -moz-margin-start: 5em; +} + +.action-header { + margin-bottom: 10px; +} + +#confirm .addon { + -moz-margin-start: 3em; + -moz-box-align: center; +} + +.addon:not([active]) .addon-icon, +#disable-list .addon-icon, +#incompatible-list .addon-icon { + filter: grayscale(1); +} + +#footer { + padding: 15px 12px; + -moz-appearance: statusbar; + -moz-window-dragging: drag; +} + +button { + -moz-appearance: toolbarbutton; + min-height: 22px; + margin: 0 6px; + padding: 0; + text-shadow: @loweredShadow@; +} diff --git a/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png Binary files differnew file mode 100644 index 0000000000..dee75516b7 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png diff --git a/toolkit/themes/osx/mozapps/extensions/stripes-error.png b/toolkit/themes/osx/mozapps/extensions/stripes-error.png Binary files differnew file mode 100644 index 0000000000..1dc2d8504c --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/stripes-error.png diff --git a/toolkit/themes/osx/mozapps/extensions/stripes-info-negative.png b/toolkit/themes/osx/mozapps/extensions/stripes-info-negative.png Binary files differnew file mode 100644 index 0000000000..901ab1ec29 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/stripes-info-negative.png diff --git a/toolkit/themes/osx/mozapps/extensions/stripes-info-positive.png b/toolkit/themes/osx/mozapps/extensions/stripes-info-positive.png Binary files differnew file mode 100644 index 0000000000..370ceec0f2 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/stripes-info-positive.png diff --git a/toolkit/themes/osx/mozapps/extensions/stripes-warning.png b/toolkit/themes/osx/mozapps/extensions/stripes-warning.png Binary files differnew file mode 100644 index 0000000000..69463fb1af --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/stripes-warning.png diff --git a/toolkit/themes/osx/mozapps/extensions/themeGeneric-16.png b/toolkit/themes/osx/mozapps/extensions/themeGeneric-16.png Binary files differnew file mode 100644 index 0000000000..190bb30d71 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/themeGeneric-16.png diff --git a/toolkit/themes/osx/mozapps/extensions/themeGeneric.png b/toolkit/themes/osx/mozapps/extensions/themeGeneric.png Binary files differnew file mode 100644 index 0000000000..be645f76df --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/themeGeneric.png diff --git a/toolkit/themes/osx/mozapps/extensions/toolbarbutton-dropmarker.png b/toolkit/themes/osx/mozapps/extensions/toolbarbutton-dropmarker.png Binary files differnew file mode 100644 index 0000000000..e7674c62a6 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/toolbarbutton-dropmarker.png diff --git a/toolkit/themes/osx/mozapps/extensions/update.css b/toolkit/themes/osx/mozapps/extensions/update.css new file mode 100644 index 0000000000..8e92556913 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/update.css @@ -0,0 +1,26 @@ +/* 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/. */ + +#alert { + list-style-image: url("chrome://mozapps/skin/update/warning.gif"); +} + +.throbber { + list-style-image: url("chrome://global/skin/icons/loading_16.png"); + width: 16px; + height: 16px; + margin-top: 5px; + margin-bottom: 5px; + -moz-margin-start: 5px; + -moz-margin-end: 2px; +} + +.alertBox { + background-color: InfoBackground; + color: InfoText; + border: 1px outset InfoBackground; + margin-left: 3px; + margin-right: 3px; + padding: 5px; +} diff --git a/toolkit/themes/osx/mozapps/extensions/xpinstallConfirm.css b/toolkit/themes/osx/mozapps/extensions/xpinstallConfirm.css new file mode 100644 index 0000000000..0a1a84b249 --- /dev/null +++ b/toolkit/themes/osx/mozapps/extensions/xpinstallConfirm.css @@ -0,0 +1,90 @@ +/* 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/. */ + +#xpinstallheader { + margin-bottom: 2em; +} + +.alert-icon { + width: 48px; + height: 48px; + list-style-image: url("chrome://global/skin/icons/warning-large.png"); + margin-top: 0 !important; + margin-bottom: 6px !important; + -moz-margin-start: 6px !important; + -moz-margin-end: 20px !important; +} + +#itemList { + -moz-appearance: listbox; + margin: 3px 4px 10px 4px; + height: 14em; +} + +#itemWarningIntro { + -moz-margin-start: 8px; +} + +#dialogContentBox { + padding: 5px; +} + +installitem { + padding: 5px 0 5px 5px; + border-bottom: 1px dotted #C0C0C0; + margin-bottom: 5px; +} + +.warning { + font-weight: bold; + font-size: 1.25em; + margin-bottom: 1em; +} + +.xpinstallIconContainer { + width: 32px; + height: 32px; + -moz-margin-end: 5px; +} + +.xpinstallItemName { + font-weight: bold; +} + +.xpinstallItemSigned { + font-style: italic; + font-size: 0.9em; +} + +.xpinstallItemURL { + -moz-appearance: none; + border: none; + background-color: Window; + margin-top: 2px; + margin-bottom: 1px; + -moz-margin-start: 6px; + -moz-margin-end: 5px; +} + +.xpinstallItemIcon { + max-width: 32px; + max-height: 32px; + list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.png"); +} + +installitem[type="theme"] .xpinstallItemIcon { + list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png"); +} + +installitem[type="locale"] .xpinstallItemIcon { + list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png"); +} + +installitem[type="plugin"] .xpinstallItemIcon { + list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png"); +} + +installitem[type="dictionary"] .xpinstallItemIcon { + list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png"); +} diff --git a/toolkit/themes/osx/mozapps/handling/handling.css b/toolkit/themes/osx/mozapps/handling/handling.css new file mode 100644 index 0000000000..9598bedaed --- /dev/null +++ b/toolkit/themes/osx/mozapps/handling/handling.css @@ -0,0 +1,30 @@ +/* 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/. */ + +#description-image:not([src]) { + height: 32px; + width: 32px; +} + +richlistitem[type] { + min-height: 36px; /* Don't forget to update the richlistbox height! */ + padding-inline-start: 2px; + } + +richlistitem { + -moz-box-align: center; +} + +richlistbox { + /* 3 items high, plus 4px for top and bottom margins, less 2px for border */ + min-height: 110px; +} + +.name { + font-weight: bold; +} + +.description { + color: GrayText; +} diff --git a/toolkit/themes/osx/mozapps/jar.mn b/toolkit/themes/osx/mozapps/jar.mn new file mode 100644 index 0000000000..eabd2eddb5 --- /dev/null +++ b/toolkit/themes/osx/mozapps/jar.mn @@ -0,0 +1,79 @@ +# 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/. + +toolkit.jar: +#include ../../shared/mozapps.inc.mn + skin/classic/mozapps/downloads/buttons.png (downloads/buttons.png) + skin/classic/mozapps/downloads/downloadIcon.png (downloads/downloadIcon.png) +* skin/classic/mozapps/downloads/downloads.css (downloads/downloads.css) + skin/classic/mozapps/downloads/unknownContentType.css (downloads/unknownContentType.css) + skin/classic/mozapps/extensions/category-search.png (extensions/category-search.png) + skin/classic/mozapps/extensions/category-discover.png (extensions/category-discover.png) + skin/classic/mozapps/extensions/category-languages.png (extensions/localeGeneric.png) + skin/classic/mozapps/extensions/category-searchengines.png (extensions/category-searchengines.png) + skin/classic/mozapps/extensions/category-extensions.png (extensions/extensionGeneric.png) + skin/classic/mozapps/extensions/category-themes.png (extensions/themeGeneric.png) + skin/classic/mozapps/extensions/category-plugins.png (extensions/category-plugins.png) + skin/classic/mozapps/extensions/category-service.png (extensions/category-service.png) + skin/classic/mozapps/extensions/category-dictionaries.png (extensions/category-dictionaries.png) + skin/classic/mozapps/extensions/category-experiments.png (extensions/category-experiments.png) + skin/classic/mozapps/extensions/category-recent.png (extensions/category-recent.png) + skin/classic/mozapps/extensions/category-available.png (extensions/category-available.png) + skin/classic/mozapps/extensions/discover-logo.png (extensions/discover-logo.png) + skin/classic/mozapps/extensions/extensionGeneric.png (extensions/extensionGeneric.png) + skin/classic/mozapps/extensions/extensionGeneric-16.png (extensions/extensionGeneric-16.png) + skin/classic/mozapps/extensions/themeGeneric.png (extensions/themeGeneric.png) + skin/classic/mozapps/extensions/themeGeneric-16.png (extensions/themeGeneric-16.png) + skin/classic/mozapps/extensions/dictionaryGeneric.png (extensions/dictionaryGeneric.png) + skin/classic/mozapps/extensions/dictionaryGeneric-16.png (extensions/dictionaryGeneric-16.png) + skin/classic/mozapps/extensions/experimentGeneric.png (extensions/experimentGeneric.png) + skin/classic/mozapps/extensions/localeGeneric.png (extensions/localeGeneric.png) + skin/classic/mozapps/extensions/rating-won.png (extensions/rating-won.png) + skin/classic/mozapps/extensions/rating-not-won.png (extensions/rating-not-won.png) + skin/classic/mozapps/extensions/cancel.png (extensions/cancel.png) + skin/classic/mozapps/extensions/utilities.svg (../../shared/extensions/utilities.svg) + skin/classic/mozapps/extensions/toolbarbutton-dropmarker.png (extensions/toolbarbutton-dropmarker.png) + skin/classic/mozapps/extensions/heart.png (extensions/heart.png) + skin/classic/mozapps/extensions/navigation.png (extensions/navigation.png) + skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png) + skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png) + skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png) + skin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png) + skin/classic/mozapps/extensions/alerticon-warning.png (extensions/alerticon-warning.png) + skin/classic/mozapps/extensions/alerticon-error.png (extensions/alerticon-error.png) + skin/classic/mozapps/extensions/alerticon-info-positive.png (extensions/alerticon-info-positive.png) + skin/classic/mozapps/extensions/alerticon-info-negative.png (extensions/alerticon-info-negative.png) + skin/classic/mozapps/extensions/search.png (extensions/search.png) + skin/classic/mozapps/extensions/about.css (extensions/about.css) +* skin/classic/mozapps/extensions/extensions.css (extensions/extensions.css) +* skin/classic/mozapps/extensions/selectAddons.css (extensions/selectAddons.css) + skin/classic/mozapps/extensions/update.css (extensions/update.css) + skin/classic/mozapps/extensions/eula.css (extensions/eula.css) + skin/classic/mozapps/extensions/blocklist.css (extensions/blocklist.css) +* skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css) + skin/classic/mozapps/passwordmgr/key.png (passwordmgr/key.png) + skin/classic/mozapps/passwordmgr/key-16.png (passwordmgr/key-16.png) + skin/classic/mozapps/passwordmgr/key-64.png (passwordmgr/key-64.png) + skin/classic/mozapps/plugins/notifyPluginGeneric.png (plugins/notifyPluginGeneric.png) + skin/classic/mozapps/plugins/pluginGeneric.png (plugins/pluginGeneric.png) + skin/classic/mozapps/plugins/pluginBlocked.png (plugins/pluginBlocked.png) + skin/classic/mozapps/plugins/pluginBlocked-64.png (plugins/pluginBlocked-64.png) + skin/classic/mozapps/plugins/pluginGeneric-16.png (plugins/pluginGeneric-16.png) + skin/classic/mozapps/plugins/pluginHelp-16.png (plugins/pluginHelp-16.png) + skin/classic/mozapps/profile/profileicon.png (profile/profileicon.png) + skin/classic/mozapps/profile/profileSelection.css (profile/profileSelection.css) + skin/classic/mozapps/profile/profileicon-selected.png (profile/profileicon-selected.png) + skin/classic/mozapps/update/buttons.png (update/buttons.png) +* skin/classic/mozapps/update/updates.css (update/updates.css) + skin/classic/mozapps/viewsource/viewsource.css (viewsource/viewsource.css) + skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png) + skin/classic/mozapps/xpinstall/xpinstallConfirm.css (extensions/xpinstallConfirm.css) + skin/classic/mozapps/handling/handling.css (handling/handling.css) + +#ifdef MOZ_PHOENIX +[browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar: +#elif MOZ_SEPARATE_MANIFEST_FOR_THEME_OVERRIDES +[extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar: +#endif +% override chrome://mozapps/skin/plugins/notifyPluginCrashed.png chrome://mozapps/skin/plugins/notifyPluginGeneric.png diff --git a/toolkit/themes/osx/mozapps/moz.build b/toolkit/themes/osx/mozapps/moz.build new file mode 100644 index 0000000000..635fa39c99 --- /dev/null +++ b/toolkit/themes/osx/mozapps/moz.build @@ -0,0 +1,6 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# 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/. + +JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file diff --git a/toolkit/themes/osx/mozapps/passwordmgr/key-16.png b/toolkit/themes/osx/mozapps/passwordmgr/key-16.png Binary files differnew file mode 100644 index 0000000000..ac135b847e --- /dev/null +++ b/toolkit/themes/osx/mozapps/passwordmgr/key-16.png diff --git a/toolkit/themes/osx/mozapps/passwordmgr/key-64.png b/toolkit/themes/osx/mozapps/passwordmgr/key-64.png Binary files differnew file mode 100644 index 0000000000..0fb69f3828 --- /dev/null +++ b/toolkit/themes/osx/mozapps/passwordmgr/key-64.png diff --git a/toolkit/themes/osx/mozapps/passwordmgr/key.png b/toolkit/themes/osx/mozapps/passwordmgr/key.png Binary files differnew file mode 100644 index 0000000000..b5e8afefca --- /dev/null +++ b/toolkit/themes/osx/mozapps/passwordmgr/key.png diff --git a/toolkit/themes/osx/mozapps/plugins/notifyPluginGeneric.png b/toolkit/themes/osx/mozapps/plugins/notifyPluginGeneric.png Binary files differnew file mode 100644 index 0000000000..449e081496 --- /dev/null +++ b/toolkit/themes/osx/mozapps/plugins/notifyPluginGeneric.png diff --git a/toolkit/themes/osx/mozapps/plugins/pluginBlocked-64.png b/toolkit/themes/osx/mozapps/plugins/pluginBlocked-64.png Binary files differnew file mode 100644 index 0000000000..56b8a3322d --- /dev/null +++ b/toolkit/themes/osx/mozapps/plugins/pluginBlocked-64.png diff --git a/toolkit/themes/osx/mozapps/plugins/pluginBlocked.png b/toolkit/themes/osx/mozapps/plugins/pluginBlocked.png Binary files differnew file mode 100644 index 0000000000..6e8e1761bf --- /dev/null +++ b/toolkit/themes/osx/mozapps/plugins/pluginBlocked.png diff --git a/toolkit/themes/osx/mozapps/plugins/pluginGeneric-16.png b/toolkit/themes/osx/mozapps/plugins/pluginGeneric-16.png Binary files differnew file mode 100644 index 0000000000..6956ffef81 --- /dev/null +++ b/toolkit/themes/osx/mozapps/plugins/pluginGeneric-16.png diff --git a/toolkit/themes/osx/mozapps/plugins/pluginGeneric.png b/toolkit/themes/osx/mozapps/plugins/pluginGeneric.png Binary files differnew file mode 100644 index 0000000000..6ada1616bb --- /dev/null +++ b/toolkit/themes/osx/mozapps/plugins/pluginGeneric.png diff --git a/toolkit/themes/osx/mozapps/plugins/pluginHelp-16.png b/toolkit/themes/osx/mozapps/plugins/pluginHelp-16.png Binary files differnew file mode 100644 index 0000000000..9a577c08f2 --- /dev/null +++ b/toolkit/themes/osx/mozapps/plugins/pluginHelp-16.png diff --git a/toolkit/themes/osx/mozapps/profile/profileSelection.css b/toolkit/themes/osx/mozapps/profile/profileSelection.css new file mode 100644 index 0000000000..cc3ab451c7 --- /dev/null +++ b/toolkit/themes/osx/mozapps/profile/profileSelection.css @@ -0,0 +1,29 @@ +/* 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/. */ + + +@import url("chrome://global/skin/global.css"); + +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); + +#profiles > listitem { + list-style-image: url("chrome://mozapps/skin/profile/profileicon.png"); +} + +#profiles:focus > listitem[selected="true"] { + list-style-image: url("chrome://mozapps/skin/profile/profileicon-selected.png"); +} + +#profiles > listitem > listcell > image { + width: 16px; + height: 16px; +} + +box#managebuttons > button { + min-width: 8em; +} + +#managebuttons { + padding-top: 1em; +} diff --git a/toolkit/themes/osx/mozapps/profile/profileicon-selected.png b/toolkit/themes/osx/mozapps/profile/profileicon-selected.png Binary files differnew file mode 100644 index 0000000000..f3e1f8e110 --- /dev/null +++ b/toolkit/themes/osx/mozapps/profile/profileicon-selected.png diff --git a/toolkit/themes/osx/mozapps/profile/profileicon.png b/toolkit/themes/osx/mozapps/profile/profileicon.png Binary files differnew file mode 100644 index 0000000000..f67a43714e --- /dev/null +++ b/toolkit/themes/osx/mozapps/profile/profileicon.png diff --git a/toolkit/themes/osx/mozapps/update/buttons.png b/toolkit/themes/osx/mozapps/update/buttons.png Binary files differnew file mode 100644 index 0000000000..04da26a252 --- /dev/null +++ b/toolkit/themes/osx/mozapps/update/buttons.png diff --git a/toolkit/themes/osx/mozapps/update/updates.css b/toolkit/themes/osx/mozapps/update/updates.css new file mode 100644 index 0000000000..9bd78ef6f8 --- /dev/null +++ b/toolkit/themes/osx/mozapps/update/updates.css @@ -0,0 +1,171 @@ +%include ../../global/shared.inc + +/* General */ +/* Specify the size for the wizardpage so the billboard has a fixed size. 3rd + party themes should typically specify the same values. */ +wizardpage { + height: 360px; + width: 700px; +} + +/* Remove margin and padding so the billboard will extend to the edge of the + window. 3rd party themes should typically specify the same values. */ +#updates, .wizard-page-box { + margin: 0; + padding: 0; +} + +.update-content { + padding: 6px 12px 12px 12px; +} + +.wizard-header-box-text { + padding: 0; +} + +.wizard-header { + margin: 12px 12px 0 12px; +} + +.wizard-buttons-btm { + padding: 15px 12px; +} + +/* Don't use top margin - it can cause a scrollbar on some pages */ +.wizard-buttons { + padding: 0; + -moz-appearance: statusbar; + -moz-window-dragging: drag; +} + +.wizard-buttons button { + -moz-appearance: toolbarbutton; + color: ButtonText; + min-height: 22px; + margin: 0 6px; + padding: 0; + text-shadow: @loweredShadow@; +} + +#finishedBackgroundMore { + margin-bottom: 6px; +} + +.inline-link { + color: -moz-nativehyperlinktext; + text-decoration: none; +} + +.inline-link:hover { + text-decoration: underline; +} + +/* Unsupported Page */ +#unsupportedLabel, #unsupportedLinkLabel { + margin-inline-start: 0; + padding-inline-start: 0; +} + +/* Update Found Basic Page */ +#updateName, #updateFinishedName { + font-weight: bold; + font-size: larger; +} + +/* Downloading Page */ +#downloadStatusLine { + -moz-box-align: center; +} + +#downloadStatus { + height: 3em !important; +} + +#downloadStatusProgress { + padding-right: 5px; +} + +#pauseButton { + list-style-image: url(chrome://mozapps/skin/update/buttons.png); + -moz-image-region: rect(48px, 16px, 64px, 0px); + -moz-appearance: none; + background-color: transparent; + border: none; + min-height: 16px; + min-width: 16px; + max-height: 16px; + max-width: 16px; + margin: 0 1px 0 1px; + padding: 0; +} + +/* !Important must be used otherwise this won't immediately take affect */ +#pauseButton > .button-box { + padding: 0 !important; +} + +#pauseButton:hover { + -moz-image-region: rect(48px, 32px, 64px, 16px); +} + +#pauseButton:not([disabled="true"]):hover:active { + -moz-image-region: rect(48px, 48px, 64px, 32px); +} + +#pauseButton[disabled="true"] { + -moz-image-region: rect(48px, 16px, 64px, 0px); +} + +#pauseButton[paused="true"] { + -moz-image-region: rect(16px, 16px, 32px, 0px); +} + +#pauseButton[paused="true"]:hover { + -moz-image-region: rect(16px, 32px, 32px, 16px); +} + +#pauseButton[paused="true"]:hover:active { + -moz-image-region: rect(16px, 48px, 32px, 32px); +} + +#verificationFailedIcon { + margin-left: 5px; + list-style-image: url("chrome://global/skin/icons/notfound.png"); +} + +/* Error Page */ +#errorReason { + margin-top: 1px; + margin-bottom: 2px; + margin-inline-start: 6px !important; + margin-inline-end: 5px; + font-weight: bold; +} + +/* Update History Window */ +update { + border-bottom: 1px dotted #C0C0C0; +} + +.update-name { + font-weight: bold; +} + +.update-label-column { + -moz-box-align: end; +} + +.update-type { + font-weight: bold; + color: #990000; +} + +#historyItems { + -moz-appearance: listbox; + height: 200px; + margin: 1px 5px 4px 5px; +} + +#historyItems > scrollbox { + margin-bottom: 1px; +} diff --git a/toolkit/themes/osx/mozapps/viewsource/viewsource.css b/toolkit/themes/osx/mozapps/viewsource/viewsource.css new file mode 100644 index 0000000000..76c7d00b9d --- /dev/null +++ b/toolkit/themes/osx/mozapps/viewsource/viewsource.css @@ -0,0 +1,5 @@ +/* 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/. */ + +/* This is for styling the menus of the viewsource window */ diff --git a/toolkit/themes/osx/reftests/482681-ref.xul b/toolkit/themes/osx/reftests/482681-ref.xul new file mode 100644 index 0000000000..62fb4bb8d5 --- /dev/null +++ b/toolkit/themes/osx/reftests/482681-ref.xul @@ -0,0 +1,21 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="data:text/css, +vbox { height: 50px; } +box { + -moz-appearance: button; +} +" type="text/css"?> + +<window title="Reference for mini, small and regular button sizes" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <vbox> + <hbox><box width="79" height="16"/></hbox> + </vbox> + <vbox> + <hbox><box width="79" height="19"/></hbox> + </vbox> + <vbox> + <hbox><box width="79" height="22"/></hbox> + </vbox> +</window> diff --git a/toolkit/themes/osx/reftests/482681.xul b/toolkit/themes/osx/reftests/482681.xul new file mode 100644 index 0000000000..6cb9aaeae4 --- /dev/null +++ b/toolkit/themes/osx/reftests/482681.xul @@ -0,0 +1,22 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="data:text/css, +vbox { height: 50px; } +button { + color: transparent; + margin: 0; +} +" type="text/css"?> + +<window title="Buttons with mini, small and regular control font" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <vbox style="font-size: 9px"> + <hbox><button label="Mini"/></hbox> + </vbox> + <vbox style="font: message-box"> + <hbox><button label="Small"/></hbox> + </vbox> + <vbox style="font: -moz-dialog"> + <hbox><button label="Regular"/></hbox> + </vbox> +</window> diff --git a/toolkit/themes/osx/reftests/baseline.xul b/toolkit/themes/osx/reftests/baseline.xul new file mode 100644 index 0000000000..2ec6f5132f --- /dev/null +++ b/toolkit/themes/osx/reftests/baseline.xul @@ -0,0 +1,175 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> + +<!-- + * This is a complicated test. + * XUL authors like to place several different widgets on the same line by + * putting them in a <hbox align="center">. In order for this to look good, + * the baselines of the text contained in the widgets should line up. + * This is what this test is testing. + * The test passes if it's completely white. + * + * It works like this: + * For every combination of two different widgets (where widget is one of + * label, radio, checkbox, button, textbox, menulist, menulist[editable="true"] or + * filefield), there's a stack with two layers. The back layer in the stack is + * just a vertically centered label with a bunch of underscores. This is the + * baseline that the text on the widgets should hit. + * On the foreground layer in the stack we've placed the pair of widgets we're + * testing. They also have underscores in their labels. + * + * Now we want to test whether the underscores in the foreground layer are directly + * on top of those in the back layer. For that we use color-keying and a tricky + * SVG color transformation. + * The back layer of the stack has a red background; the underscores of the + * back label are in white (and have a white text-shadow in order to fill up the + * gaps between the individual letters). + * Now we want the foreground layer to be solid white, except for those pixels + * that make up the labels: These should be transparent. + * So if the baselines line up, everything is white, since at those pixels where + * the foreground is transparent, only the white pixels from the back layer shine + * through. If the baselines don't line up, red pixels from the background will + * shine through, and the comparison with about:blank (completely white) will fail. + * + * So how do we get the foreground white and transparent? That's the job of the + * SVG color transformation filter. It's a simple matrix that makes turns opaque + * yellow into transparent and all other colors into white. + * --> + +<window title="Baseline test" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + xmlns:html="http://www.w3.org/1999/xhtml" + xmlns:svg="http://www.w3.org/2000/svg" + orient="vertical" + class="reftest-wait" + onload="loaded()"> + +<html:style><![CDATA[ +window { + -moz-appearance: none; + background-color: white; +} +.regular { + font: -moz-dialog; +} +.small { + font: message-box; +} +.spacer { + height: 40px; +} +stack > hbox:first-child { + background: red; + color: white; + text-shadow: 5px 0 white, -5px 0 white; +} +stack > .foreground { + filter: url(#yellow2transparent); +} +stack > hbox:last-child > * { + color: yellow; +} +]]> +</html:style> + + <svg:svg style="visibility: collapse;"> + <svg:filter id="yellow2transparent" color-interpolation-filters="sRGB"> + <svg:feColorMatrix type="matrix" + values="0 0 0 0 1 + 0 0 0 0 1 + 0 0 0 0 1 + -100 -100 100 -100 300"/> + </svg:filter> + </svg:svg> + +<script type="application/javascript;version=1.8"><![CDATA[ + +function cE(elem) { + return document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", elem); +} +function elWithValue(elem, val) { + let e = cE(elem); + e.setAttribute(elem == "label" || elem == "textbox" ? "value" : "label", val); + return e; +} + +function allPairs(set) { + let ps = []; + for(let i = 0; i < set.length; ++i) { + for (let j = i + 1; j < set.length; ++j) { + ps.push([set[i], set[j]]); + } + } + return ps; +} + +function createLabel(v) { + return elWithValue("label", v); +} +function createRadio(v) { + return elWithValue("radio", v); +} +function createCheckbox(v) { + return elWithValue("checkbox", v); +} +function createButton(v) { + return elWithValue("button", v); +} +function createTextField(v) { + return elWithValue("textbox", v); +} +function createMenulist(v) { + let [list, popup, item] = [cE("menulist"), cE("menupopup"), elWithValue("menuitem", v)]; + item.setAttribute("selected", "true"); + popup.appendChild(item); + list.appendChild(popup); + return list; +} +function createEditableMenulist(v) { + let list = createMenulist(v); + list.setAttribute("editable", "true"); + return list; +} +function createFileField(v) { + let field = elWithValue("filefield", v); + field.setAttribute("image", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAChJREFUSMftzUEBAAAEBLCjf2dK8NsKrCaTT51nAoFAIBAIBAKB4MoCtVsCPjrGuiwAAAAASUVORK5CYII="); + return field; +} +function loaded() { + let template = document.getElementById("template"); + ["regular", "small"].forEach(function(size) { + let wrapper = document.querySelectorAll("#wrapper > ." + size)[0]; + allPairs([ + createLabel, createRadio, createCheckbox, createButton, createMenulist, createTextField, + /* createEditableMenulist, createFileField, */ /* These don't inherit "color" properly */ + ]).forEach(function(elemList) { + let newBox = template.cloneNode(true); + newBox.className = "spacer"; + let foregroundRow = newBox.firstChild.lastChild; + elemList.forEach(function(creator) { + foregroundRow.appendChild(creator("______")); + }); + wrapper.appendChild(newBox); + }); + }); + document.documentElement.className = ""; +} + +]]></script> + <vbox id="template"> + <stack> + <hbox align="center"> + <label value="______________________________________________"/> + </hbox> + <hbox align="center" class="foreground"> + </hbox> + </stack> + </vbox> + <hbox id="wrapper"> + <vbox class="regular" flex="1"/> + <vbox class="small" flex="1"/> + </hbox> + + <spacer flex="1"/> + +</window> diff --git a/toolkit/themes/osx/reftests/checkboxsize-ref.xul b/toolkit/themes/osx/reftests/checkboxsize-ref.xul new file mode 100644 index 0000000000..08d1e9a670 --- /dev/null +++ b/toolkit/themes/osx/reftests/checkboxsize-ref.xul @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="data:text/css, +vbox { height: 50px; } +box { + -moz-appearance: checkbox; + margin-left: 2px; + margin-top: 1px; +} +" type="text/css"?> + +<window title="Reference for mini, small and regular checkbox sizes" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <vbox> + <hbox><box width="11" height="11"/></hbox> + </vbox> + <vbox> + <hbox><box width="13" height="13"/></hbox> + </vbox> + <vbox> + <hbox><box width="16" height="16"/></hbox> + </vbox> + <vbox> + <hbox checked="true"><box width="11" height="11"/></hbox> + </vbox> + <vbox> + <hbox checked="true"><box width="13" height="13"/></hbox> + </vbox> + <vbox> + <hbox checked="true"><box width="16" height="16"/></hbox> + </vbox> +</window> diff --git a/toolkit/themes/osx/reftests/checkboxsize.xul b/toolkit/themes/osx/reftests/checkboxsize.xul new file mode 100644 index 0000000000..55429ef8f8 --- /dev/null +++ b/toolkit/themes/osx/reftests/checkboxsize.xul @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="data:text/css, +vbox { height: 50px; } +checkbox { + color: transparent; + margin: 0; +} +" type="text/css"?> + +<window title="Checkboxes with mini, small and regular control font" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <vbox style="font-size: 9px"> + <hbox><checkbox label="Mini"/></hbox> + </vbox> + <vbox style="font: message-box"> + <hbox><checkbox label="Small"/></hbox> + </vbox> + <vbox style="font: -moz-dialog"> + <hbox><checkbox label="Regular"/></hbox> + </vbox> + <vbox style="font-size: 9px"> + <hbox><checkbox label="Mini" checked="true"/></hbox> + </vbox> + <vbox style="font: message-box"> + <hbox><checkbox label="Small" checked="true"/></hbox> + </vbox> + <vbox style="font: -moz-dialog"> + <hbox><checkbox label="Regular" checked="true"/></hbox> + </vbox> +</window> diff --git a/toolkit/themes/osx/reftests/nostretch-ref.xul b/toolkit/themes/osx/reftests/nostretch-ref.xul new file mode 100644 index 0000000000..a1aee555e6 --- /dev/null +++ b/toolkit/themes/osx/reftests/nostretch-ref.xul @@ -0,0 +1,107 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> + +<window title="Stretched controls test reference" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + xmlns:html="http://www.w3.org/1999/xhtml" + xmlns:svg="http://www.w3.org/2000/svg" + orient="vertical" + class="reftest-wait" + onload="loaded()"> + +<html:style><![CDATA[ +.regular { + font: -moz-dialog; +} +.small { + font: message-box; +} +.spacer { + height: 40px; +} +.foreground > :nth-child(2) { + display: none; /* <----- This is the only difference from nostretch.xul */ +} +]]> +</html:style> + +<script type="application/javascript;version=1.8"><![CDATA[ + +function cE(elem) { + return document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", elem); +} +function elWithValue(elem, val) { + let e = cE(elem); + e.setAttribute(elem == "label" || elem == "textbox" ? "value" : "label", val); + return e; +} + +function allPairs(set) { + let ps = []; + for(let i = 0; i < set.length; ++i) { + for (let j = 0; j < set.length; ++j) { + if (i != j) + ps.push([set[i], set[j]]); + } + } + return ps; +} + +function createLabel(v) { + return elWithValue("label", v); +} +function createRadio(v) { + return elWithValue("radio", v); +} +function createCheckbox(v) { + return elWithValue("checkbox", v); +} +function createButton(v) { + return elWithValue("button", v); +} +function createTextField(v) { + return elWithValue("textbox", v); +} +function createMenulist(v) { + let [list, popup, item] = [cE("menulist"), cE("menupopup"), elWithValue("menuitem", v)]; + item.setAttribute("selected", "true"); + popup.appendChild(item); + list.appendChild(popup); + return list; +} +function createEditableMenulist(v) { + let list = createMenulist(v); + list.setAttribute("editable", "true"); + return list; +} +function loaded() { + let template = document.getElementById("template"); + ["regular", "small"].forEach(function(size) { + let wrapper = document.querySelectorAll("#wrapper > ." + size)[0]; + allPairs([ + createButton, createMenulist, createTextField, createEditableMenulist, + ]).forEach(function(elemList) { + let newBox = template.cloneNode(true); + newBox.className = "spacer"; + let foregroundRow = newBox.firstChild; + elemList.forEach(function(creator) { + foregroundRow.appendChild(creator("Label")); + }); + wrapper.appendChild(newBox); + }); + }); + document.documentElement.className = ""; +} + +]]></script> + <vbox id="template"> + <hbox class="foreground"/> + </vbox> + <hbox id="wrapper"> + <vbox class="regular" width="500"/> + <vbox class="small" flex="1"/> + </hbox> + + <spacer flex="1"/> + +</window> diff --git a/toolkit/themes/osx/reftests/nostretch.xul b/toolkit/themes/osx/reftests/nostretch.xul new file mode 100644 index 0000000000..cd28fa1b7b --- /dev/null +++ b/toolkit/themes/osx/reftests/nostretch.xul @@ -0,0 +1,120 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> + +<!-- + * This test tests whether you can put different widgets in the same + * hbox without stretching them, even if you don't set align="center". + * I.e. prior to the fix that added this patch, having a button and a + * menulist in the same hbox next to each other would stretch the menulist + * vertically because the button had such a big vertical margin. + * + * The test works like this: Two widgets are placed in a hbox, and the second + * widget is visibility: hidden. In the reference (nostretch-ref.xul), the + * second widget is display: none. If test and reference look the same, + * adding the second widget hasn't affected the appearance of the first widget, + * and everything's fine. + * --> +<window title="Stretched controls test" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + xmlns:html="http://www.w3.org/1999/xhtml" + xmlns:svg="http://www.w3.org/2000/svg" + orient="vertical" + class="reftest-wait" + onload="loaded()"> + +<html:style><![CDATA[ +.regular { + font: -moz-dialog; +} +.small { + font: message-box; +} +.spacer { + height: 40px; +} +.foreground > :nth-child(2) { + visibility: hidden; +} +]]> +</html:style> + +<script type="application/javascript;version=1.8"><![CDATA[ + +function cE(elem) { + return document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", elem); +} +function elWithValue(elem, val) { + let e = cE(elem); + e.setAttribute(elem == "label" || elem == "textbox" ? "value" : "label", val); + return e; +} + +function allPairs(set) { + let ps = []; + for(let i = 0; i < set.length; ++i) { + for (let j = 0; j < set.length; ++j) { + if (i != j) + ps.push([set[i], set[j]]); + } + } + return ps; +} + +function createLabel(v) { + return elWithValue("label", v); +} +function createRadio(v) { + return elWithValue("radio", v); +} +function createCheckbox(v) { + return elWithValue("checkbox", v); +} +function createButton(v) { + return elWithValue("button", v); +} +function createTextField(v) { + return elWithValue("textbox", v); +} +function createMenulist(v) { + let [list, popup, item] = [cE("menulist"), cE("menupopup"), elWithValue("menuitem", v)]; + item.setAttribute("selected", "true"); + popup.appendChild(item); + list.appendChild(popup); + return list; +} +function createEditableMenulist(v) { + let list = createMenulist(v); + list.setAttribute("editable", "true"); + return list; +} +function loaded() { + let template = document.getElementById("template"); + ["regular", "small"].forEach(function(size) { + let wrapper = document.querySelectorAll("#wrapper > ." + size)[0]; + allPairs([ + createButton, createMenulist, createTextField, createEditableMenulist, + ]).forEach(function(elemList) { + let newBox = template.cloneNode(true); + newBox.className = "spacer"; + let foregroundRow = newBox.firstChild; + elemList.forEach(function(creator) { + foregroundRow.appendChild(creator("Label")); + }); + wrapper.appendChild(newBox); + }); + }); + document.documentElement.className = ""; +} + +]]></script> + <vbox id="template"> + <hbox class="foreground"/> + </vbox> + <hbox id="wrapper"> + <vbox class="regular" width="500"/> + <vbox class="small" flex="1"/> + </hbox> + + <spacer flex="1"/> + +</window> diff --git a/toolkit/themes/osx/reftests/radiosize-ref.xul b/toolkit/themes/osx/reftests/radiosize-ref.xul new file mode 100644 index 0000000000..632f39e41f --- /dev/null +++ b/toolkit/themes/osx/reftests/radiosize-ref.xul @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="data:text/css, +vbox { height: 50px; } +box { + -moz-appearance: radio; + margin-left: 2px; + margin-top: 1px; +} +" type="text/css"?> + +<window title="Reference for mini, small and regular radio button sizes" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <vbox> + <hbox><box width="11" height="11"/></hbox> + </vbox> + <vbox> + <hbox><box width="13" height="13"/></hbox> + </vbox> + <vbox> + <hbox><box width="16" height="16"/></hbox> + </vbox> + <vbox> + <hbox selected="true"><box width="11" height="11"/></hbox> + </vbox> + <vbox> + <hbox selected="true"><box width="13" height="13"/></hbox> + </vbox> + <vbox> + <hbox selected="true"><box width="16" height="16"/></hbox> + </vbox> +</window> diff --git a/toolkit/themes/osx/reftests/radiosize.xul b/toolkit/themes/osx/reftests/radiosize.xul new file mode 100644 index 0000000000..44f735db07 --- /dev/null +++ b/toolkit/themes/osx/reftests/radiosize.xul @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> +<?xml-stylesheet href="data:text/css, +vbox { height: 50px; } +radio { + color: transparent; + margin: 0; +} +" type="text/css"?> + +<window title="Radio buttons with mini, small and regular control font" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + <vbox style="font-size: 9px"> + <hbox><radio label="Mini"/></hbox> + </vbox> + <vbox style="font: message-box"> + <hbox><radio label="Small"/></hbox> + </vbox> + <vbox style="font: -moz-dialog"> + <hbox><radio label="Regular"/></hbox> + </vbox> + <vbox style="font-size: 9px"> + <hbox><radio label="Mini" selected="true"/></hbox> + </vbox> + <vbox style="font: message-box"> + <hbox><radio label="Small" selected="true"/></hbox> + </vbox> + <vbox style="font: -moz-dialog"> + <hbox><radio label="Regular" selected="true"/></hbox> + </vbox> +</window> diff --git a/toolkit/themes/osx/reftests/reftest-stylo.list b/toolkit/themes/osx/reftests/reftest-stylo.list new file mode 100644 index 0000000000..82df4273dc --- /dev/null +++ b/toolkit/themes/osx/reftests/reftest-stylo.list @@ -0,0 +1,6 @@ +# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing +skip-if(!cocoaWidget) == 482681.xul 482681.xul +skip-if(!cocoaWidget) == radiosize.xul radiosize.xul +skip-if(!cocoaWidget) == checkboxsize.xul checkboxsize.xul +skip-if(!cocoaWidget) == baseline.xul baseline.xul +skip-if(!cocoaWidget) == nostretch.xul nostretch.xul diff --git a/toolkit/themes/osx/reftests/reftest.list b/toolkit/themes/osx/reftests/reftest.list new file mode 100644 index 0000000000..27034dd862 --- /dev/null +++ b/toolkit/themes/osx/reftests/reftest.list @@ -0,0 +1,5 @@ +skip-if(!cocoaWidget) == 482681.xul 482681-ref.xul +skip-if(!cocoaWidget) == radiosize.xul radiosize-ref.xul +skip-if(!cocoaWidget) == checkboxsize.xul checkboxsize-ref.xul +skip-if(!cocoaWidget) == baseline.xul about:blank +skip-if(!cocoaWidget) == nostretch.xul nostretch-ref.xul diff --git a/toolkit/xre/MacApplicationDelegate.h b/toolkit/xre/MacApplicationDelegate.h new file mode 100644 index 0000000000..74f9a93ed2 --- /dev/null +++ b/toolkit/xre/MacApplicationDelegate.h @@ -0,0 +1,16 @@ +/* -*- 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/. */ + +// This file defines the interface between Cocoa-specific Obj-C++ and generic C++, +// so it itself cannot have any Obj-C bits in it. + +#ifndef MacApplicationDelegate_h_ +#define MacApplicationDelegate_h_ + +void EnsureUseCocoaDockAPI(void); +void SetupMacApplicationDelegate(void); +void ProcessPendingGetURLAppleEvents(void); + +#endif diff --git a/toolkit/xre/MacApplicationDelegate.mm b/toolkit/xre/MacApplicationDelegate.mm new file mode 100644 index 0000000000..2b295aa7d9 --- /dev/null +++ b/toolkit/xre/MacApplicationDelegate.mm @@ -0,0 +1,396 @@ +/* -*- 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/. */ + +// NSApplication delegate for Mac OS X Cocoa API. + +// As of 10.4 Tiger, the system can send six kinds of Apple Events to an application; +// a well-behaved XUL app should have some kind of handling for all of them. +// +// See http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_handle_AEs/chapter_11_section_3.html for details. + +#import <Cocoa/Cocoa.h> +#import <Carbon/Carbon.h> + +#include "nsCOMPtr.h" +#include "nsINativeAppSupport.h" +#include "nsAppRunner.h" +#include "nsAppShell.h" +#include "nsComponentManagerUtils.h" +#include "nsIServiceManager.h" +#include "nsServiceManagerUtils.h" +#include "nsIAppStartup.h" +#include "nsIObserverService.h" +#include "nsISupportsPrimitives.h" +#include "nsObjCExceptions.h" +#include "nsIFile.h" +#include "nsDirectoryServiceDefs.h" +#include "nsICommandLineRunner.h" +#include "nsIMacDockSupport.h" +#include "nsIStandaloneNativeMenu.h" +#include "nsILocalFileMac.h" +#include "nsString.h" +#include "nsCommandLineServiceMac.h" + +class AutoAutoreleasePool { +public: + AutoAutoreleasePool() + { + mLocalPool = [[NSAutoreleasePool alloc] init]; + } + ~AutoAutoreleasePool() + { + [mLocalPool release]; + } +private: + NSAutoreleasePool *mLocalPool; +}; + +@interface MacApplicationDelegate : NSObject<NSApplicationDelegate> +{ +} + +@end + +static bool sProcessedGetURLEvent = false; + +// Methods that can be called from non-Objective-C code. + +// This is needed, on relaunch, to force the OS to use the "Cocoa Dock API" +// instead of the "Carbon Dock API". For more info see bmo bug 377166. +void +EnsureUseCocoaDockAPI() +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK; + + [GeckoNSApplication sharedApplication]; + + NS_OBJC_END_TRY_ABORT_BLOCK; +} + +void +SetupMacApplicationDelegate() +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK; + + // this is called during startup, outside an event loop, and therefore + // needs an autorelease pool to avoid cocoa object leakage (bug 559075) + AutoAutoreleasePool pool; + + // Ensure that ProcessPendingGetURLAppleEvents() doesn't regress bug 377166. + [GeckoNSApplication sharedApplication]; + + // This call makes it so that application:openFile: doesn't get bogus calls + // from Cocoa doing its own parsing of the argument string. And yes, we need + // to use a string with a boolean value in it. That's just how it works. + [[NSUserDefaults standardUserDefaults] setObject:@"NO" + forKey:@"NSTreatUnknownArgumentsAsOpen"]; + + // Create the delegate. This should be around for the lifetime of the app. + id<NSApplicationDelegate> delegate = [[MacApplicationDelegate alloc] init]; + [[GeckoNSApplication sharedApplication] setDelegate:delegate]; + + NS_OBJC_END_TRY_ABORT_BLOCK; +} + +// Indirectly make the OS process any pending GetURL Apple events. This is +// done via _DPSNextEvent() (an undocumented AppKit function called from +// [NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]). Apple +// events are only processed if 'dequeue' is 'YES' -- so we need to call +// [NSApplication sendEvent:] on any event that gets returned. 'event' will +// never itself be an Apple event, and it may be 'nil' even when Apple events +// are processed. +void +ProcessPendingGetURLAppleEvents() +{ + AutoAutoreleasePool pool; + bool keepSpinning = true; + while (keepSpinning) { + sProcessedGetURLEvent = false; + NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:nil + inMode:NSDefaultRunLoopMode + dequeue:YES]; + if (event) + [NSApp sendEvent:event]; + keepSpinning = sProcessedGetURLEvent; + } +} + +@implementation MacApplicationDelegate + +- (id)init +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; + + if ((self = [super init])) { + NSAppleEventManager *aeMgr = [NSAppleEventManager sharedAppleEventManager]; + + [aeMgr setEventHandler:self + andSelector:@selector(handleAppleEvent:withReplyEvent:) + forEventClass:kInternetEventClass + andEventID:kAEGetURL]; + + [aeMgr setEventHandler:self + andSelector:@selector(handleAppleEvent:withReplyEvent:) + forEventClass:'WWW!' + andEventID:'OURL']; + + [aeMgr setEventHandler:self + andSelector:@selector(handleAppleEvent:withReplyEvent:) + forEventClass:kCoreEventClass + andEventID:kAEOpenDocuments]; + + if (![NSApp windowsMenu]) { + // If the application has a windows menu, it will keep it up to date and + // prepend the window list to the Dock menu automatically. + NSMenu* windowsMenu = [[NSMenu alloc] initWithTitle:@"Window"]; + [NSApp setWindowsMenu:windowsMenu]; + [windowsMenu release]; + } + } + return self; + + NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(nil); +} + +- (void)dealloc +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK; + + NSAppleEventManager *aeMgr = [NSAppleEventManager sharedAppleEventManager]; + [aeMgr removeEventHandlerForEventClass:kInternetEventClass andEventID:kAEGetURL]; + [aeMgr removeEventHandlerForEventClass:'WWW!' andEventID:'OURL']; + [aeMgr removeEventHandlerForEventClass:kCoreEventClass andEventID:kAEOpenDocuments]; + [super dealloc]; + + NS_OBJC_END_TRY_ABORT_BLOCK; +} + +// The method that NSApplication calls upon a request to reopen, such as when +// the Dock icon is clicked and no windows are open. A "visible" window may be +// miniaturized, so we can't skip nsCocoaNativeReOpen() if 'flag' is 'true'. +- (BOOL)applicationShouldHandleReopen:(NSApplication*)theApp hasVisibleWindows:(BOOL)flag +{ + nsCOMPtr<nsINativeAppSupport> nas = do_CreateInstance(NS_NATIVEAPPSUPPORT_CONTRACTID); + NS_ENSURE_TRUE(nas, NO); + + // Go to the common Carbon/Cocoa reopen method. + nsresult rv = nas->ReOpen(); + NS_ENSURE_SUCCESS(rv, NO); + + // NO says we don't want NSApplication to do anything else for us. + return NO; +} + +// The method that NSApplication calls when documents are requested to be opened. +// It will be called once for each selected document. +- (BOOL)application:(NSApplication*)theApplication openFile:(NSString*)filename +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; + + NSURL *url = [NSURL fileURLWithPath:filename]; + if (!url) + return NO; + + NSString *urlString = [url absoluteString]; + if (!urlString) + return NO; + + // Add the URL to any command line we're currently setting up. + if (CommandLineServiceMac::AddURLToCurrentCommandLine([urlString UTF8String])) + return YES; + + nsCOMPtr<nsILocalFileMac> inFile; + nsresult rv = NS_NewLocalFileWithCFURL((CFURLRef)url, true, getter_AddRefs(inFile)); + if (NS_FAILED(rv)) + return NO; + + nsCOMPtr<nsICommandLineRunner> cmdLine(do_CreateInstance("@mozilla.org/toolkit/command-line;1")); + if (!cmdLine) { + NS_ERROR("Couldn't create command line!"); + return NO; + } + + nsCString filePath; + rv = inFile->GetNativePath(filePath); + if (NS_FAILED(rv)) + return NO; + + nsCOMPtr<nsIFile> workingDir; + rv = NS_GetSpecialDirectory(NS_OS_CURRENT_WORKING_DIR, getter_AddRefs(workingDir)); + if (NS_FAILED(rv)) + return NO; + + const char *argv[3] = {nullptr, "-file", filePath.get()}; + rv = cmdLine->Init(3, argv, workingDir, nsICommandLine::STATE_REMOTE_EXPLICIT); + if (NS_FAILED(rv)) + return NO; + + if (NS_SUCCEEDED(cmdLine->Run())) + return YES; + + return NO; + + NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO); +} + +// The method that NSApplication calls when documents are requested to be printed +// from the Finder (under the "File" menu). +// It will be called once for each selected document. +- (BOOL)application:(NSApplication*)theApplication printFile:(NSString*)filename +{ + return NO; +} + +// Create the menu that shows up in the Dock. +- (NSMenu*)applicationDockMenu:(NSApplication*)sender +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; + + // Create the NSMenu that will contain the dock menu items. + NSMenu *menu = [[[NSMenu alloc] initWithTitle:@""] autorelease]; + [menu setAutoenablesItems:NO]; + + // Add application-specific dock menu items. On error, do not insert the + // dock menu items. + nsresult rv; + nsCOMPtr<nsIMacDockSupport> dockSupport = do_GetService("@mozilla.org/widget/macdocksupport;1", &rv); + if (NS_FAILED(rv) || !dockSupport) + return menu; + + nsCOMPtr<nsIStandaloneNativeMenu> dockMenu; + rv = dockSupport->GetDockMenu(getter_AddRefs(dockMenu)); + if (NS_FAILED(rv) || !dockMenu) + return menu; + + // Determine if the dock menu items should be displayed. This also gives + // the menu the opportunity to update itself before display. + bool shouldShowItems; + rv = dockMenu->MenuWillOpen(&shouldShowItems); + if (NS_FAILED(rv) || !shouldShowItems) + return menu; + + // Obtain a copy of the native menu. + NSMenu * nativeDockMenu; + rv = dockMenu->GetNativeMenu(reinterpret_cast<void **>(&nativeDockMenu)); + if (NS_FAILED(rv) || !nativeDockMenu) + return menu; + + // Loop through the application-specific dock menu and insert its + // contents into the dock menu that we are building for Cocoa. + int numDockMenuItems = [nativeDockMenu numberOfItems]; + if (numDockMenuItems > 0) { + if ([menu numberOfItems] > 0) + [menu addItem:[NSMenuItem separatorItem]]; + + for (int i = 0; i < numDockMenuItems; i++) { + NSMenuItem * itemCopy = [[nativeDockMenu itemAtIndex:i] copy]; + [menu addItem:itemCopy]; + [itemCopy release]; + } + } + + return menu; + + NS_OBJC_END_TRY_ABORT_BLOCK_NIL; +} + +// If we don't handle applicationShouldTerminate:, a call to [NSApp terminate:] +// (from the browser or from the OS) can result in an unclean shutdown. +- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender +{ + nsCOMPtr<nsIObserverService> obsServ = + do_GetService("@mozilla.org/observer-service;1"); + if (!obsServ) + return NSTerminateNow; + + nsCOMPtr<nsISupportsPRBool> cancelQuit = + do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID); + if (!cancelQuit) + return NSTerminateNow; + + cancelQuit->SetData(false); + obsServ->NotifyObservers(cancelQuit, "quit-application-requested", nullptr); + + bool abortQuit; + cancelQuit->GetData(&abortQuit); + if (abortQuit) + return NSTerminateCancel; + + nsCOMPtr<nsIAppStartup> appService = + do_GetService("@mozilla.org/toolkit/app-startup;1"); + if (appService) + appService->Quit(nsIAppStartup::eForceQuit); + + return NSTerminateNow; +} + +- (void)handleAppleEvent:(NSAppleEventDescriptor*)event withReplyEvent:(NSAppleEventDescriptor*)replyEvent +{ + if (!event) + return; + + AutoAutoreleasePool pool; + + bool isGetURLEvent = + ([event eventClass] == kInternetEventClass && [event eventID] == kAEGetURL); + if (isGetURLEvent) + sProcessedGetURLEvent = true; + + if (isGetURLEvent || + ([event eventClass] == 'WWW!' && [event eventID] == 'OURL')) { + NSString* urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; + + // don't open chrome URLs + NSString* schemeString = [[NSURL URLWithString:urlString] scheme]; + if (!schemeString || + [schemeString compare:@"chrome" + options:NSCaseInsensitiveSearch + range:NSMakeRange(0, [schemeString length])] == NSOrderedSame) { + return; + } + + // Add the URL to any command line we're currently setting up. + if (CommandLineServiceMac::AddURLToCurrentCommandLine([urlString UTF8String])) + return; + + nsCOMPtr<nsICommandLineRunner> cmdLine(do_CreateInstance("@mozilla.org/toolkit/command-line;1")); + if (!cmdLine) { + NS_ERROR("Couldn't create command line!"); + return; + } + nsCOMPtr<nsIFile> workingDir; + nsresult rv = NS_GetSpecialDirectory(NS_OS_CURRENT_WORKING_DIR, getter_AddRefs(workingDir)); + if (NS_FAILED(rv)) + return; + const char *argv[3] = {nullptr, "-url", [urlString UTF8String]}; + rv = cmdLine->Init(3, argv, workingDir, nsICommandLine::STATE_REMOTE_EXPLICIT); + if (NS_FAILED(rv)) + return; + rv = cmdLine->Run(); + } + else if ([event eventClass] == kCoreEventClass && [event eventID] == kAEOpenDocuments) { + NSAppleEventDescriptor* fileListDescriptor = [event paramDescriptorForKeyword:keyDirectObject]; + if (!fileListDescriptor) + return; + + // Descriptor list indexing is one-based... + NSInteger numberOfFiles = [fileListDescriptor numberOfItems]; + for (NSInteger i = 1; i <= numberOfFiles; i++) { + NSString* urlString = [[fileListDescriptor descriptorAtIndex:i] stringValue]; + if (!urlString) + continue; + + // We need a path, not a URL + NSURL* url = [NSURL URLWithString:urlString]; + if (!url) + continue; + + [self application:NSApp openFile:[url path]]; + } + } +} + +@end diff --git a/toolkit/xre/MacAutoreleasePool.h b/toolkit/xre/MacAutoreleasePool.h new file mode 100644 index 0000000000..7668957f19 --- /dev/null +++ b/toolkit/xre/MacAutoreleasePool.h @@ -0,0 +1,31 @@ +/* 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 MacAutoreleasePool_h_ +#define MacAutoreleasePool_h_ + +// This needs to be #include-able from non-ObjC code in nsAppRunner.cpp +#ifdef __OBJC__ +@class NSAutoreleasePool; +#else +class NSAutoreleasePool; +#endif + +namespace mozilla { + +class MacAutoreleasePool { +public: + MacAutoreleasePool(); + ~MacAutoreleasePool(); + +private: + NSAutoreleasePool *mPool; + + MacAutoreleasePool(const MacAutoreleasePool&); + void operator=(const MacAutoreleasePool&); +}; + +} // namespace mozilla + +#endif // MacAutoreleasePool_h_ diff --git a/toolkit/xre/MacAutoreleasePool.mm b/toolkit/xre/MacAutoreleasePool.mm new file mode 100644 index 0000000000..ae8ad51ff1 --- /dev/null +++ b/toolkit/xre/MacAutoreleasePool.mm @@ -0,0 +1,20 @@ +/* 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/. */ + +#include "MacAutoreleasePool.h" +#include "nsDebug.h" + +#import <Foundation/Foundation.h> + +using mozilla::MacAutoreleasePool; + +MacAutoreleasePool::MacAutoreleasePool() +{ + mPool = [[NSAutoreleasePool alloc] init]; + NS_ASSERTION(mPool != nullptr, "failed to create pool, objects will leak"); +} + +MacAutoreleasePool::~MacAutoreleasePool() { + [mPool release]; +} diff --git a/toolkit/xre/MacLaunchHelper.h b/toolkit/xre/MacLaunchHelper.h new file mode 100644 index 0000000000..08035c53b6 --- /dev/null +++ b/toolkit/xre/MacLaunchHelper.h @@ -0,0 +1,23 @@ +/* -*- Mode: C++; tab-width: 2; 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 MacLaunchHelper_h_ +#define MacLaunchHelper_h_ + +#include <stdint.h> + +#include <unistd.h> + +extern "C" { + /** + * Passing an aPid parameter to LaunchChildMac will wait for the launched + * process to terminate. When the process terminates, aPid will be set to the + * pid of the terminated process to confirm that it executed successfully. + */ + void LaunchChildMac(int aArgc, char** aArgv, pid_t* aPid = 0); + bool LaunchElevatedUpdate(int aArgc, char** aArgv, pid_t* aPid = 0); +} + +#endif diff --git a/toolkit/xre/MacLaunchHelper.mm b/toolkit/xre/MacLaunchHelper.mm new file mode 100644 index 0000000000..0dadb8de88 --- /dev/null +++ b/toolkit/xre/MacLaunchHelper.mm @@ -0,0 +1,137 @@ +/* -*- Mode: C++; tab-width: 2; 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/. */ + +#include "MacLaunchHelper.h" + +#include "MacAutoreleasePool.h" +#include "mozilla/UniquePtr.h" +#include "nsIAppStartup.h" +#include "nsMemory.h" + +#include <Cocoa/Cocoa.h> +#include <crt_externs.h> +#include <ServiceManagement/ServiceManagement.h> +#include <Security/Authorization.h> +#include <spawn.h> +#include <stdio.h> + +using namespace mozilla; + +void LaunchChildMac(int aArgc, char** aArgv, pid_t* aPid) +{ + MacAutoreleasePool pool; + + @try { + NSString* launchPath = [NSString stringWithUTF8String:aArgv[0]]; + NSMutableArray* arguments = [NSMutableArray arrayWithCapacity:aArgc - 1]; + for (int i = 1; i < aArgc; i++) { + [arguments addObject:[NSString stringWithUTF8String:aArgv[i]]]; + } + NSTask* child = [NSTask launchedTaskWithLaunchPath:launchPath + arguments:arguments]; + if (aPid) { + *aPid = [child processIdentifier]; + // We used to use waitpid to wait for the process to terminate. This is + // incompatible with NSTask and we wait for the process to exit here + // instead. + [child waitUntilExit]; + } + } @catch (NSException* e) { + NSLog(@"%@: %@", e.name, e.reason); + } +} + +BOOL InstallPrivilegedHelper() +{ + AuthorizationRef authRef = NULL; + OSStatus status = AuthorizationCreate(NULL, + kAuthorizationEmptyEnvironment, + kAuthorizationFlagDefaults | + kAuthorizationFlagInteractionAllowed, + &authRef); + if (status != errAuthorizationSuccess) { + // AuthorizationCreate really shouldn't fail. + NSLog(@"AuthorizationCreate failed! NSOSStatusErrorDomain / %d", + (int)status); + return NO; + } + + BOOL result = NO; + AuthorizationItem authItem = { kSMRightBlessPrivilegedHelper, 0, NULL, 0 }; + AuthorizationRights authRights = { 1, &authItem }; + AuthorizationFlags flags = kAuthorizationFlagDefaults | + kAuthorizationFlagInteractionAllowed | + kAuthorizationFlagPreAuthorize | + kAuthorizationFlagExtendRights; + + // Obtain the right to install our privileged helper tool. + status = AuthorizationCopyRights(authRef, + &authRights, + kAuthorizationEmptyEnvironment, + flags, + NULL); + if (status != errAuthorizationSuccess) { + NSLog(@"AuthorizationCopyRights failed! NSOSStatusErrorDomain / %d", + (int)status); + } else { + CFErrorRef cfError; + // This does all the work of verifying the helper tool against the + // application and vice-versa. Once verification has passed, the embedded + // launchd.plist is extracted and placed in /Library/LaunchDaemons and then + // loaded. The executable is placed in /Library/PrivilegedHelperTools. + result = (BOOL)SMJobBless(kSMDomainSystemLaunchd, + (CFStringRef)@"org.mozilla.updater", + authRef, + &cfError); + if (!result) { + NSLog(@"Unable to install helper!"); + CFRelease(cfError); + } + } + + return result; +} + +void AbortElevatedUpdate() +{ + mozilla::MacAutoreleasePool pool; + + id updateServer = nil; + int currTry = 0; + const int numRetries = 10; // Number of IPC connection retries before + // giving up. + while (currTry < numRetries) { + @try { + updateServer = (id)[NSConnection + rootProxyForConnectionWithRegisteredName: + @"org.mozilla.updater.server" + host:nil + usingNameServer:[NSSocketPortNameServer sharedInstance]]; + if (updateServer && + [updateServer respondsToSelector:@selector(abort)]) { + [updateServer performSelector:@selector(abort)]; + return; + } + NSLog(@"Server doesn't exist or doesn't provide correct selectors."); + sleep(1); // Wait 1 second. + currTry++; + } @catch (NSException* e) { + NSLog(@"Encountered exception, retrying: %@: %@", e.name, e.reason); + sleep(1); // Wait 1 second. + currTry++; + } + } + NSLog(@"Unable to clean up updater."); +} + +bool LaunchElevatedUpdate(int aArgc, char** aArgv, pid_t* aPid) +{ + LaunchChildMac(aArgc, aArgv, aPid); + bool didSucceed = InstallPrivilegedHelper(); + if (!didSucceed) { + AbortElevatedUpdate(); + } + return didSucceed; +} diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build index b717e971c3..4072fe134f 100644 --- a/toolkit/xre/moz.build +++ b/toolkit/xre/moz.build @@ -19,6 +19,15 @@ if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']: if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': UNIFIED_SOURCES += ['nsNativeAppSupportWin.cpp'] +elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + UNIFIED_SOURCES += [ + 'MacApplicationDelegate.mm', + 'MacAutoreleasePool.mm', + 'MacLaunchHelper.mm', + 'nsCommandLineServiceMac.cpp', + 'nsNativeAppSupportCocoa.mm', + 'updaterfileutils_osx.mm', + ] elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit': UNIFIED_SOURCES += [ 'nsNativeAppSupportDefault.cpp', @@ -112,6 +121,12 @@ LOCAL_INCLUDES += [ '/xpcom/build', ] +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': + LOCAL_INCLUDES += [ + '/widget', + '/widget/cocoa', + ] + if CONFIG['MOZ_ENABLE_XREMOTE']: LOCAL_INCLUDES += [ '/widget/xremoteclient', |