This commit is contained in:
Ms2ger 2012-05-05 10:58:40 +02:00
Родитель a6f2573921 4f39d5530d
Коммит 734d977b10
16 изменённых файлов: 85 добавлений и 68 удалений

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

@ -4456,10 +4456,10 @@ var FullScreen = {
XPCOMUtils.defineLazyGetter(FullScreen, "useLionFullScreen", function() {
// We'll only use OS X Lion full screen if we're
// * on OS X
// * on Lion (Darwin 11.x) -- this will need to be updated for OS X 10.8
// * on Lion or higher (Darwin 11+)
// * have fullscreenbutton="true"
#ifdef XP_MACOSX
return /^11\./.test(Services.sysinfo.getProperty("version")) &&
return parseFloat(Services.sysinfo.getProperty("version")) >= 11 &&
document.documentElement.getAttribute("fullscreenbutton") == "true";
#else
return false;

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

@ -811,7 +811,7 @@ BrowserGlue.prototype = {
try {
// This will throw NS_ERROR_NOT_AVAILABLE if the notification cannot
// be displayed per the idl.
notifier.showAlertNotification("post-update-notification", title, text,
notifier.showAlertNotification(null, title, text,
true, url, clickCallback);
}
catch (e) {

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

@ -34,7 +34,7 @@ function onTabViewWindowLoaded() {
is(appTabCount(groupItemOne), 0, "there are no app tab icons");
// pin the tab, make sure the TabItem goes away and the icon comes on
whenAppTabIconAdded(function() {
whenAppTabIconAdded(groupItemOne, function () {
is(groupItemOne._children.length, 0,
"the app tab's TabItem was removed from the group");
is(appTabCount(groupItemOne), 1, "there's now one app tab icon");
@ -43,7 +43,7 @@ function onTabViewWindowLoaded() {
box.offset(box.width + 20, 0);
let groupItemTwo = new contentWindow.GroupItem([],
{ bounds: box, title: "test2" });
whenAppTabIconAdded(function() {
whenAppTabIconAdded(groupItemTwo, function() {
is(contentWindow.GroupItems.groupItems.length, 3, "we now have three groups");
is(appTabCount(groupItemTwo), 1,
"there's an app tab icon in the second group");
@ -58,7 +58,7 @@ function onTabViewWindowLoaded() {
is(appTabCount(groupItemOne), 0, "the icon is gone from group one");
is(appTabCount(groupItemTwo), 0, "the icon is gone from group two");
whenAppTabIconAdded(function() {
whenAppTabIconAdded(groupItemOne, function() {
// close the second group
groupItemTwo.close();

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

@ -53,7 +53,7 @@ function onTabViewShown(win) {
"$appTabTray container is not visible");
// pin the tab, make sure the TabItem goes away and the icon comes on
whenAppTabIconAdded(function() {
whenAppTabIconAdded(groupItem, function () {
is(groupItem._children.length, 0,
"the app tab's TabItem was removed from the group");
is(appTabCount(groupItem), 1, "there's now one app tab icon");
@ -80,7 +80,7 @@ function onTabViewShown(win) {
// add one more tab
xulTabs.push(gBrowser.loadOneTab("about:blank"));
whenAppTabIconAdded(function() {
whenAppTabIconAdded(groupItem, function () {
is(tray.css("-moz-column-count"), 3,
"$appTabTray column count is 3");
@ -129,7 +129,7 @@ function onTabViewShown(win) {
executeSoon(finish);
}, win);
}, win);
});
win.gBrowser.pinTab(xulTabs[xulTabs.length-1]);
};
@ -137,13 +137,13 @@ function onTabViewShown(win) {
let returnCount = 0;
for (let i = 1; i < icons; i++) {
xulTabs.push(gBrowser.loadOneTab("about:blank"));
whenAppTabIconAdded(function() {
whenAppTabIconAdded(groupItem, function () {
if (++returnCount == (icons - 1))
executeSoon(pinnedSomeTabs);
}, win);
});
win.gBrowser.pinTab(xulTabs[i]);
}
}, win);
});
win.gBrowser.pinTab(xulTabs[0]);
}

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

@ -18,13 +18,14 @@ function test() {
newTab = gBrowser.addTab();
showTabView(function() {
whenAppTabIconAdded(onTabPinned);
let cw = TabView.getContentWindow();
whenAppTabIconAdded(cw.GroupItems.groupItems[0], onTabPinned);
gBrowser.pinTab(newTab);
})
}
function onTabPinned() {
let contentWindow = document.getElementById("tab-view").contentWindow;
let contentWindow = TabView.getContentWindow();
is(contentWindow.GroupItems.groupItems.length, 1,
"There is one group item on startup");

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

@ -23,9 +23,9 @@ function test() {
groupItem = contentWindow.GroupItems.groupItems[0];
whenAppTabIconAdded(function() {
whenAppTabIconAdded(function() {
whenAppTabIconAdded(function() {
whenAppTabIconAdded(groupItem, function () {
whenAppTabIconAdded(groupItem, function () {
whenAppTabIconAdded(groupItem, function () {
is(xulTabForAppTabIcon(0), newTabOne,
"New tab one matches the first app tab icon in tabview");

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

@ -25,12 +25,12 @@ function test() {
is(newTabItemOne.$favImage[0].src, ICON_URL, "The tab item is showing the right icon.");
// test pin tab
whenAppTabIconAdded(function() {
whenAppTabIconAdded(groupItem, function() {
let icon = cw.iQ(".appTabIcon", groupItem.$appTabTray)[0];
is(icon.src, ICON_URL, "The app tab is showing the right icon");
finish();
}, win);
});
win.gBrowser.pinTab(newTabTwo);
});
}, function(win) {

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

@ -8,8 +8,8 @@ function test() {
let tab = gBrowser.addTab();
registerCleanupFunction(function () gBrowser.removeTab(tab));
whenAppTabIconAdded(function() {
let cw = TabView.getContentWindow();
whenAppTabIconAdded(cw.GroupItems.groupItems[0], function() {
let body = cw.document.body;
let [appTabIcon] = cw.iQ(".appTabTray .appTabIcon");

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

@ -411,15 +411,9 @@ function goToNextGroup(win) {
}
// ----------
function whenAppTabIconAdded(callback, win) {
win = win || window;
let contentWindow = win.TabView.getContentWindow();
let groupItems = contentWindow.GroupItems.groupItems;
let groupItem = groupItems[(groupItems.length - 1)];
function whenAppTabIconAdded(groupItem, callback) {
groupItem.addSubscriber("appTabIconAdded", function onAppTabIconAdded() {
groupItem.removeSubscriber("appTabIconAdded", onAppTabIconAdded);
callback();
executeSoon(callback);
});
}

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

@ -507,6 +507,10 @@ class ShutdownLeakLogger(object):
created = line[:2] == "++"
id = self._parseValue(line, "serial")
# log line has invalid format
if not id:
return
if self.currentTest:
windows = self.currentTest["windows"]
if created:
@ -520,6 +524,10 @@ class ShutdownLeakLogger(object):
created = line[:2] == "++"
id = self._parseValue(line, "id")
# log line has invalid format
if not id:
return
if self.currentTest:
docShells = self.currentTest["docShells"]
if created:
@ -530,7 +538,10 @@ class ShutdownLeakLogger(object):
self.leakedDocShells.add(id)
def _parseValue(self, line, name):
return re.search("\[%s = (.+?)\]" % name, line).group(1)
match = re.search("\[%s = (.+?)\]" % name, line)
if match:
return match.group(1)
return None
def _parseLeakingTests(self):
leakingTests = []

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

@ -214,6 +214,9 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI,
// Make sure that the channel remembers where it was
// originally loaded from.
nsLoadFlags loadFlags = 0;
result->GetLoadFlags(&loadFlags);
result->SetLoadFlags(loadFlags & ~nsIChannel::LOAD_REPLACE);
rv = result->SetOriginalURI(aURI);
if (NS_FAILED(rv)) return rv;

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

@ -33,9 +33,6 @@
<uses-permission android:name="android.permission.READ_SMS"/>
#endif
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
<uses-feature android:name="android.hardware.location" android:required="false"/>
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
<uses-feature android:name="android.hardware.touchscreen"/>

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

@ -38,6 +38,8 @@
#include "mozilla/Util.h"
#include "KeyboardLayout.h"
#include "nsWindow.h"
#include "nsIMM32Handler.h"
#include "nsMemory.h"
#include "nsToolkit.h"
@ -227,9 +229,9 @@ VirtualKey::GetNativeUniChars(PRUint8 aShiftState,
}
NativeKey::NativeKey(HKL aKeyboardLayout,
HWND aWnd,
nsWindow* aWindow,
const MSG& aKeyOrCharMessage) :
mVirtualKeyCode(0), mOriginalVirtualKeyCode(0)
mDOMKeyCode(0), mVirtualKeyCode(0), mOriginalVirtualKeyCode(0)
{
mScanCode = WinUtils::GetScanCode(aKeyOrCharMessage.lParam);
mIsExtended = WinUtils::IsExtendedScanCode(aKeyOrCharMessage.lParam);
@ -249,7 +251,8 @@ NativeKey::NativeKey(HKL aKeyboardLayout,
break;
case VK_PROCESSKEY:
mVirtualKeyCode = mOriginalVirtualKeyCode =
static_cast<PRUint8>(::ImmGetVirtualKey(aWnd));
static_cast<PRUint8>(
::ImmGetVirtualKey(aWindow->GetWindowHandle()));
break;
default:
mVirtualKeyCode = mOriginalVirtualKeyCode;
@ -268,6 +271,7 @@ NativeKey::NativeKey(HKL aKeyboardLayout,
mVirtualKeyCode = mOriginalVirtualKeyCode = static_cast<PRUint8>(
::MapVirtualKeyEx(GetScanCodeWithExtendedFlag(),
MAPVK_VSC_TO_VK_EX, aKeyboardLayout));
break;
default:
MOZ_NOT_REACHED("Unsupported message");
break;
@ -276,6 +280,26 @@ NativeKey::NativeKey(HKL aKeyboardLayout,
if (!mVirtualKeyCode) {
mVirtualKeyCode = mOriginalVirtualKeyCode;
}
mDOMKeyCode = mOriginalVirtualKeyCode;
if (nsIMM32Handler::IsComposingOn(aWindow)) {
return;
}
switch (mOriginalVirtualKeyCode) {
// 0xBA, For the US standard keyboard, the ';:' key
case VK_OEM_1:
mDOMKeyCode = NS_VK_SEMICOLON;
break;
// 0xBB, For any country/region, the '+' key
case VK_OEM_PLUS:
mDOMKeyCode = NS_VK_ADD;
break;
// 0xBD, For any country/region, the '-' key
case VK_OEM_MINUS:
mDOMKeyCode = NS_VK_SUBTRACT;
break;
}
}
UINT

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

@ -47,6 +47,8 @@
#define VK_OEM_PLUS 0xBB // '+' any country
#define VK_OEM_MINUS 0xBD // '-' any country
class nsWindow;
namespace mozilla {
namespace widget {
@ -134,21 +136,25 @@ public:
class NativeKey {
public:
NativeKey() :
mVirtualKeyCode(0), mOriginalVirtualKeyCode(0),
mDOMKeyCode(0), mVirtualKeyCode(0), mOriginalVirtualKeyCode(0),
mScanCode(0), mIsExtended(false)
{
}
NativeKey(HKL aKeyboardLayout,
HWND aWnd,
nsWindow* aWindow,
const MSG& aKeyOrCharMessage);
PRUint32 GetDOMKeyCode() const { return mDOMKeyCode; }
// The result is one of nsIDOMKeyEvent::DOM_KEY_LOCATION_*.
PRUint32 GetKeyLocation() const;
WORD GetScanCode() const { return mScanCode; }
PRUint8 GetVirtualKeyCode() const { return mVirtualKeyCode; }
PRUint8 GetOriginalVirtualKeyCode() const { return mOriginalVirtualKeyCode; }
private:
PRUint32 mDOMKeyCode;
// mVirtualKeyCode distinguishes left key or right key of modifier key.
PRUint8 mVirtualKeyCode;
// mOriginalVirtualKeyCode doesn't distinguish left key or right key of

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

@ -5569,7 +5569,7 @@ LRESULT nsWindow::ProcessCharMessage(const MSG &aMsg, bool *aEventDispatched)
// These must be checked here too as a lone WM_CHAR could be received
// if a child window didn't handle it (for example Alt+Space in a content window)
nsModifierKeyState modKeyState;
NativeKey nativeKey(gKbdLayout.GetLayout(), mWnd, aMsg);
NativeKey nativeKey(gKbdLayout.GetLayout(), this, aMsg);
return OnChar(aMsg, nativeKey, modKeyState, aEventDispatched);
}
@ -6226,16 +6226,6 @@ StringCaseInsensitiveEquals(const PRUnichar* aChars1, const PRUint32 aNumChars1,
return comp(aChars1, aChars2, aNumChars1, aNumChars2) == 0;
}
UINT nsWindow::MapFromNativeToDOM(UINT aNativeKeyCode)
{
switch (aNativeKeyCode) {
case VK_OEM_1: return NS_VK_SEMICOLON; // 0xBA, For the US standard keyboard, the ';:' key
case VK_OEM_PLUS: return NS_VK_ADD; // 0xBB, For any country/region, the '+' key
case VK_OEM_MINUS: return NS_VK_SUBTRACT; // 0xBD, For any country/region, the '-' key
}
return aNativeKeyCode;
}
/* static */
bool nsWindow::IsRedirectedKeyDownMessage(const MSG &aMsg)
{
@ -6258,14 +6248,13 @@ LRESULT nsWindow::OnKeyDown(const MSG &aMsg,
bool *aEventDispatched,
nsFakeCharMessage* aFakeCharMessage)
{
NativeKey nativeKey(gKbdLayout.GetLayout(), mWnd, aMsg);
NativeKey nativeKey(gKbdLayout.GetLayout(), this, aMsg);
UINT virtualKeyCode = nativeKey.GetOriginalVirtualKeyCode();
gKbdLayout.OnKeyDown(virtualKeyCode);
// Use only DOMKeyCode for XP processing.
// Use virtualKeyCode for gKbdLayout and native processing.
UINT DOMKeyCode = nsIMM32Handler::IsComposingOn(this) ?
virtualKeyCode : MapFromNativeToDOM(virtualKeyCode);
PRUint32 DOMKeyCode = nativeKey.GetDOMKeyCode();
#ifdef DEBUG
//PR_LOG(gWindowsLog, PR_LOG_ALWAYS, ("In OnKeyDown virt: %d\n", DOMKeyCode));
@ -6608,20 +6597,14 @@ LRESULT nsWindow::OnKeyUp(const MSG &aMsg,
nsModifierKeyState &aModKeyState,
bool *aEventDispatched)
{
UINT virtualKeyCode = aMsg.wParam;
PR_LOG(gWindowsLog, PR_LOG_ALWAYS,
("nsWindow::OnKeyUp VK=%d\n", virtualKeyCode));
if (!nsIMM32Handler::IsComposingOn(this)) {
virtualKeyCode = MapFromNativeToDOM(virtualKeyCode);
}
("nsWindow::OnKeyUp wParam(VK)=%d\n", aMsg.wParam));
if (aEventDispatched)
*aEventDispatched = true;
nsKeyEvent keyupEvent(true, NS_KEY_UP, this);
keyupEvent.keyCode = virtualKeyCode;
NativeKey nativeKey(gKbdLayout.GetLayout(), mWnd, aMsg);
NativeKey nativeKey(gKbdLayout.GetLayout(), this, aMsg);
keyupEvent.keyCode = nativeKey.GetDOMKeyCode();
InitKeyEvent(keyupEvent, nativeKey, aModKeyState);
return DispatchKeyEvent(keyupEvent, &aMsg);
}
@ -6650,19 +6633,17 @@ LRESULT nsWindow::OnChar(const MSG &aMsg,
if (aModKeyState.mIsAltDown && aModKeyState.mIsControlDown)
aModKeyState.mIsAltDown = aModKeyState.mIsControlDown = false;
wchar_t uniChar;
if (nsIMM32Handler::IsComposingOn(this)) {
ResetInputState();
}
wchar_t uniChar;
if (aModKeyState.mIsControlDown && charCode <= 0x1A) { // Ctrl+A Ctrl+Z, see Programming Windows 3.1 page 110 for details
// need to account for shift here. bug 16486
if (aModKeyState.mIsShiftDown)
uniChar = charCode - 1 + 'A';
else
uniChar = charCode - 1 + 'a';
charCode = 0;
}
else if (aModKeyState.mIsControlDown && charCode <= 0x1F) {
// Fix for 50255 - <ctrl><[> and <ctrl><]> are not being processed.
@ -6670,20 +6651,18 @@ LRESULT nsWindow::OnChar(const MSG &aMsg,
// for some reason the keypress handler need to have the uniChar code set
// with the addition of a upper case A not the lower case.
uniChar = charCode - 1 + 'A';
charCode = 0;
} else { // 0x20 - SPACE, 0x3D - EQUALS
if (charCode < 0x20 || (charCode == 0x3D && aModKeyState.mIsControlDown)) {
uniChar = 0;
} else {
uniChar = charCode;
charCode = 0;
}
}
// Keep the characters unshifted for shortcuts and accesskeys and make sure
// that numbers are always passed as such (among others: bugs 50255 and 351310)
if (uniChar && (aModKeyState.mIsControlDown || aModKeyState.mIsAltDown)) {
UINT virtualKeyCode = ::MapVirtualKeyEx(WinUtils::GetScanCode(aMsg.lParam),
UINT virtualKeyCode = ::MapVirtualKeyEx(aNativeKey.GetScanCode(),
MAPVK_VSC_TO_VK,
gKbdLayout.GetLayout());
UINT unshiftedCharCode =
@ -6706,6 +6685,9 @@ LRESULT nsWindow::OnChar(const MSG &aMsg,
nsKeyEvent keypressEvent(true, NS_KEY_PRESS, this);
keypressEvent.flags |= aFlags;
keypressEvent.charCode = uniChar;
if (!keypressEvent.charCode) {
keypressEvent.keyCode = aNativeKey.GetDOMKeyCode();
}
InitKeyEvent(keypressEvent, aNativeKey, aModKeyState);
bool result = DispatchKeyEvent(keypressEvent, &aMsg);
if (aEventDispatched)

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

@ -477,7 +477,6 @@ protected:
/**
* Misc.
*/
UINT MapFromNativeToDOM(UINT aNativeKeyCode);
void StopFlashing();
static bool IsTopLevelMouseExit(HWND aWnd);
nsresult SetWindowClipRegion(const nsTArray<nsIntRect>& aRects,