merge devtools to mozilla-central on a CLOSED TREE, a=davidb

This commit is contained in:
Rob Campbell 2011-03-30 08:24:53 -03:00
Родитель 1957405b7f cf31020680
Коммит 330ae79d73
4 изменённых файлов: 101 добавлений и 96 удалений

Просмотреть файл

@ -56,7 +56,7 @@
%define toolbarShadowOnTab -moz-linear-gradient(bottom, rgba(10%,10%,10%,.4) 1px, transparent 1px)
%define bgTabTexture -moz-linear-gradient(transparent, hsla(0,0%,45%,.1) 1px, hsla(0,0%,32%,.2) 80%, hsla(0,0%,0%,.2))
%define bgTabTextureHover -moz-linear-gradient(hsla(0,0%,100%,.3) 1px, hsla(0,0%,75%,.2) 80%, hsla(0,0%,60%,.2))
%define navbarTextboxCustomBorder border-color: rgba(0,0,0,.25) rgba(0,0,0,.32) rgba(0,0,0,.37);
%define navbarTextboxCustomBorder border-color: rgba(0,0,0,.32);
#menubar-items {
-moz-box-orient: vertical; /* for flex hack */
@ -605,12 +605,11 @@ menuitem.bookmark-item {
-moz-linear-gradient(rgba(251,252,253,.95), rgba(246,247,248,.47) 49%,
rgba(231,232,233,.45) 51%, rgba(225,226,229,.3));
background-clip: padding-box;
border-radius: 4.5px;
border-radius: 3.5px;
border: 1px solid;
border-color: rgba(0,0,0,.12) rgba(0,0,0,.19) rgba(0,0,0,.38);
box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset,
0 0 0 2px rgba(255,255,255,.1) inset,
0 1px 0 rgba(0,0,0,.15);
0 0 0 2px rgba(255,255,255,.1) inset;
color: black;
text-shadow: 0 0 2px white;
}
@ -671,7 +670,6 @@ menuitem.bookmark-item {
border-color: hsla(190,50%,65%,.8) hsla(190,50%,50%,.8) hsla(190,50%,40%,.8);
box-shadow: 0 0 0 1px rgba(255,255,255,.3) inset,
0 0 0 1.5px rgba(255,255,255,.1) inset,
0 1px 0 rgba(0,0,0,.1),
0 0 3.5px hsl(190,90%,80%);
-moz-transition: background-color .4s ease-in,
border-color .3s ease-in,
@ -801,8 +799,7 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
0 0 0 2px rgba(255,255,255,.1) inset,
0 0 0 1px rgba(0,0,0,.15),
0 1px 0 rgba(0,0,0,.4),
0 1px 1px rgba(0,0,0,.3),
1px 2px 1px rgba(0,0,0,.2);
0 1px 1px rgba(0,0,0,.3);
}
#navigator-toolbox[iconsize="large"][mode="icons"] > #nav-bar #back-button:not([disabled="true"]):not([open="true"]):not(:active):hover {
@ -811,7 +808,6 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
0 0 0 1px hsla(190,50%,40%,.3),
0 1px 0 rgba(0,0,0,.4),
0 1px 1px rgba(0,0,0,.3),
1px 2px 1px rgba(0,0,0,.2),
0 0 5px 1px hsl(190,90%,80%);
}
@ -1102,9 +1098,7 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
padding: 2px;
background-clip: padding-box;
border: 1px solid ThreeDDarkShadow;
border-radius: 4px;
box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
0 1px 0 rgba(255,255,255,.4);
border-radius: 3.5px;
}
@media all and (-moz-windows-default-theme) {

Просмотреть файл

@ -30,6 +30,7 @@
* Mark Hammond <mhammond@skippinet.com.au>
* Ryan Jones <sciguyryan@gmail.com>
* Jeff Walden <jwalden+code@mit.edu>
* Ben Bucksch <ben.bucksch beonex.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -67,6 +68,8 @@
#include "nsReadableUtils.h"
#include "nsDOMClassInfo.h"
#include "nsJSEnvironment.h"
#include "nsCharSeparatedTokenizer.h" // for Accept-Language parsing
#include "nsUnicharUtils.h"
// Other Classes
#include "nsIEventListenerManager.h"
@ -10565,19 +10568,56 @@ nsNavigator::GetAppName(nsAString& aAppName)
return NS_GetNavigatorAppName(aAppName);
}
/**
* JS property navigator.language, exposed to web content.
* Take first value from Accept-Languages (HTTP header), which is
* the "content language" freely set by the user in the Pref window.
*
* Do not use UI language (chosen app locale) here.
* See RFC 2616, Section 15.1.4 "Privacy Issues Connected to Accept Headers"
*
* "en", "en-US" and "i-cherokee" and "" are valid.
* Fallback in case of invalid pref should be "" (empty string), to
* let site do fallback, e.g. to site's local language.
*/
NS_IMETHODIMP
nsNavigator::GetLanguage(nsAString& aLanguage)
{
nsresult rv;
nsCOMPtr<nsIHttpProtocolHandler>
service(do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv));
if (NS_SUCCEEDED(rv)) {
nsCAutoString lang;
rv = service->GetLanguage(lang);
CopyASCIItoUTF16(lang, aLanguage);
}
// e.g. "de-de, en-us,en"
const nsAdoptingString& acceptLang =
nsContentUtils::GetLocalizedStringPref("intl.accept_languages");
// take everything before the first "," or ";", without trailing space
nsCharSeparatedTokenizer langTokenizer(acceptLang, ',');
const nsSubstring &firstLangPart = langTokenizer.nextToken();
nsCharSeparatedTokenizer qTokenizer(firstLangPart, ';');
aLanguage.Assign(qTokenizer.nextToken());
return rv;
// checks and fixups
// replace "_" with "-", to avoid POSIX/Windows "en_US" notation
if (aLanguage.Length() > 2 && aLanguage[2] == PRUnichar('_'))
aLanguage.Replace(2, 1, PRUnichar('-')); // TODO replace all
// use uppercase for country part, e.g. "en-US", not "en-us", see BCP47
// only uppercase 2-letter country codes, not "zh-Hant", "de-DE-x-goethe"
if (aLanguage.Length() > 2)
{
nsCharSeparatedTokenizer localeTokenizer(aLanguage, '-');
PRInt32 pos = 0;
bool first = true;
while (localeTokenizer.hasMoreTokens())
{
const nsSubstring &code = localeTokenizer.nextToken();
if (code.Length() == 2 && !first)
{
nsAutoString upper(code);
::ToUpperCase(upper);
aLanguage.Replace(pos, code.Length(), upper);
}
pos += code.Length() + 1; // 1 is the separator
if (first)
first = false;
}
}
return NS_OK;
}
NS_IMETHODIMP

Просмотреть файл

@ -469,7 +469,6 @@
}
.description-container {
margin-top: 8px;
-moz-margin-start: 6px;
-moz-box-align: center;
}
@ -494,11 +493,11 @@
-moz-box-align: stretch;
}
.advancedinfo-container,
.update-info-container {
-moz-box-align: center;
}
.advancedinfo-container,
.update-available {
-moz-box-align: end;
}

Просмотреть файл

@ -35,6 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
#addons-page {
-moz-appearance: none;
padding: 18px;
@ -103,7 +105,6 @@
.nav-button {
list-style-image: url(chrome://mozapps/skin/extensions/navigation.png);
min-width: 0;
}
#forward-btn {
@ -368,30 +369,33 @@
}
#header-search {
-moz-appearance: none;
color: black;
border: 1px solid;
border-color: rgba(0, 0, 0, 0.25) rgba(0, 0, 0, 0.32) rgba(0, 0, 0, 0.37);
border-radius: 4px;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1) inset,
0 1px 0 rgba(255, 255, 255, 0.4);
padding: 3px;
background-color: rgba(255, 255, 255, 0.8);
margin: 0;
}
#header-search .textbox-input:-moz-placeholder {
color: grey;
}
@media all and (-moz-windows-default-theme) {
#header-search {
-moz-appearance: none;
border: 1px solid;
border-color: rgba(0, 0, 0, 0.25) rgba(0, 0, 0, 0.32) rgba(0, 0, 0, 0.37);
border-radius: 4px;
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1) inset,
0 1px 0 rgba(255, 255, 255, 0.4);
padding-bottom: 2px;
background-color: rgba(255, 255, 255, 0.4);
}
#header-search[focused="true"] {
background-color: white;
#header-search:hover {
background-color: rgba(255, 255, 255, .75);
}
#header-search[focused] {
background-color: white;
}
}
#header-utils-btn {
min-width: 4.5em;
list-style-image: url("chrome://mozapps/skin/extensions/utilities.png");
-moz-margin-end: 18px;
-moz-margin-end: 16px;
}
.view-header {
@ -565,7 +569,6 @@
}
.description-container {
margin-top: 8px;
-moz-margin-start: 6px;
-moz-box-align: center;
}
@ -591,11 +594,11 @@
-moz-box-align: stretch;
}
.advancedinfo-container,
.update-info-container {
-moz-box-align: center;
}
.advancedinfo-container,
.update-available {
-moz-box-align: end;
}
@ -1122,38 +1125,23 @@
-moz-appearance: none;
color: black;
padding: 0 5px;
background-color: rgba(151,152,153,.05);
background-image: -moz-linear-gradient(rgba(251, 252, 253, 0.95), rgba(246, 247, 248, 0.47) 49%,
rgba(231, 232, 233, 0.45) 51%, rgba(225, 226, 229, 0.3));
background: -moz-linear-gradient(rgba(251, 252, 253, 0.95), rgba(246, 247, 248, 0) 49%,
rgba(211, 212, 213, 0.45) 51%, rgba(225, 226, 229, 0.3));
background-clip: padding-box;
border-radius: 3px;
border: 1px solid;
border-color: rgba(0, 0, 0, 0.12) rgba(0, 0, 0, 0.19) rgba(0, 0, 0, 0.38);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3) inset,
0 0 0 2px rgba(255, 255, 255, 0.1) inset;
}
.addon-control:not(:active):hover {
background-color: hsla(190, 60%, 70%, 0.5);
border-color: hsla(190, 50%, 65%, 0.8) hsla(190, 50%, 50%, 0.8) hsla(190, 50%, 40%, 0.8);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3) inset,
0 0 0 1.5px rgba(255, 255, 255, 0.1) inset,
0 1px 0 rgba(0, 0, 0, 0.1),
0 0 3.5px hsl(190, 90%, 80%);
-moz-transition: background-color .4s ease-in,
border-color .3s ease-in,
box-shadow .3s ease-in
border: 1px solid rgba(31, 64, 100, 0.4);
border-top-color: rgba(31, 64, 100, 0.3);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset,
0 0 2px 1px rgba(255, 255, 255, 0.25) inset;
}
.addon-control:active:hover {
background-color: transparent;
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,
0 1px 0 rgba(255, 255, 255, 0.4);
background-color: rgba(61, 76, 92, 0.2);
border-color: rgba(39, 53, 68, 0.5);
box-shadow: 0 0 3px 1px rgba(39, 53, 68, 0.2) inset;
}
.addon-control .button-box {
.addon-control > .button-box {
padding: 1px;
}
@ -1183,50 +1171,34 @@
.header-button {
-moz-appearance: none;
margin: 0;
background: rgba(151,152,153,.05)
-moz-linear-gradient(rgba(251, 252, 253, 0.95), rgba(246, 247, 248, 0.47) 49%,
rgba(231, 232, 233, 0.45) 51%, rgba(225, 226, 229, 0.3));
padding: 1px 3px;
color: #444;
text-shadow: 0 0 3px white;
background: -moz-linear-gradient(rgba(251, 252, 253, 0.95), rgba(246, 247, 248, 0) 49%,
rgba(211, 212, 213, 0.45) 51%, rgba(225, 226, 229, 0.3));
background-clip: padding-box;
border-radius: 4.5px;
border: 1px solid;
border-color: rgba(0, 0, 0, 0.12) rgba(0, 0, 0, 0.19) rgba(0, 0, 0, 0.38);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3) inset,
0 0 0 2px rgba(255, 255, 255, 0.1) inset;
border: 1px solid rgba(31, 64, 100, 0.4);
border-top-color: rgba(31, 64, 100, 0.3);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset,
0 0 2px 1px rgba(255, 255, 255, 0.25) inset;
}
.header-button[disabled="true"] {
-moz-border-top-colors: rgba(0, 0, 0, 0.12) !important;
-moz-border-left-colors: rgba(0, 0, 0, 0.19) !important;
-moz-border-right-colors: rgba(0, 0, 0, 0.19) !important;
-moz-border-bottom-colors: rgba(0, 0, 0, 0.38) !important;
opacity: 0.8;
}
.nav-button[disabled="true"] .toolbarbutton-icon {
.header-button[disabled="true"] > .toolbarbutton-icon {
opacity: 0.4;
}
.header-button:not([open="true"]):not([disabled="true"]):not(:active):hover {
background-color: hsla(190, 60%, 70%, 0.5);
border-color: hsla(190, 50%, 65%, 0.8) hsla(190, 50%, 50%, 0.8) hsla(190, 50%, 40%, 0.8);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3) inset,
0 0 0 1.5px rgba(255, 255, 255, 0.1) inset,
0 1px 0 rgba(0, 0, 0, 0.1),
0 0 3.5px hsl(190, 90%, 80%);
-moz-transition: background-color .4s ease-in,
border-color .3s ease-in,
box-shadow .3s ease-in
}
.header-button:not([disabled="true"]):active:hover,
.header-button[open="true"] {
background-color: transparent;
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;
background-color: rgba(61, 76, 92, 0.2);
border-color: rgba(39, 53, 68, 0.5);
box-shadow: 0 0 3px 1px rgba(39, 53, 68, 0.2) inset;
}
.header-button .toolbarbutton-text {
.header-button > .toolbarbutton-text {
display: none;
}