From 4412714dedc27f87be98faaf003c6678ce2f0518 Mon Sep 17 00:00:00 2001 From: Alexander Surkov Date: Fri, 25 Jun 2010 18:50:23 +0900 Subject: [PATCH 001/172] Bug 573910 - switch nsApplicationAccessible to nsAccessible::Append/RemoveChild, r=davidb, sr=roc --- accessible/public/nsIAccessibilityService.h | 6 +-- .../src/atk/nsApplicationAccessibleWrap.cpp | 27 +++++----- .../src/atk/nsApplicationAccessibleWrap.h | 8 +-- .../src/base/nsAccessibilityService.cpp | 49 ++++++++----------- accessible/src/base/nsAccessibilityService.h | 5 +- .../src/base/nsApplicationAccessible.cpp | 38 ++++++-------- accessible/src/base/nsApplicationAccessible.h | 6 +-- accessible/src/base/nsRootAccessible.cpp | 10 ++-- widget/src/gtk2/nsAccessibilityHelper.cpp | 8 +-- 9 files changed, 64 insertions(+), 93 deletions(-) diff --git a/accessible/public/nsIAccessibilityService.h b/accessible/public/nsIAccessibilityService.h index f8ab5e11a69d..77b7f91e4410 100644 --- a/accessible/public/nsIAccessibilityService.h +++ b/accessible/public/nsIAccessibilityService.h @@ -132,10 +132,8 @@ public: * Adds/remove ATK root accessible for gtk+ native window to/from children * of the application accessible. */ - virtual nsresult AddNativeRootAccessible(void *aAtkAccessible, - nsIAccessible **aAccessible) = 0; - virtual nsresult - RemoveNativeRootAccessible(nsIAccessible *aRootAccessible) = 0; + virtual nsAccessible* AddNativeRootAccessible(void* aAtkAccessible) = 0; + virtual void RemoveNativeRootAccessible(nsAccessible* aRootAccessible) = 0; /** * Used to describe sort of changes leading to accessible tree invalidation. diff --git a/accessible/src/atk/nsApplicationAccessibleWrap.cpp b/accessible/src/atk/nsApplicationAccessibleWrap.cpp index fce39d7e7afe..2b1c6cf67337 100644 --- a/accessible/src/atk/nsApplicationAccessibleWrap.cpp +++ b/accessible/src/atk/nsApplicationAccessibleWrap.cpp @@ -653,16 +653,13 @@ gboolean fireRootAccessibleAddedCB(gpointer data) return FALSE; } -nsresult -nsApplicationAccessibleWrap::AddRootAccessible(nsIAccessible *aRootAccWrap) +PRBool +nsApplicationAccessibleWrap::AppendChild(nsAccessible *aChild) { - NS_ENSURE_ARG_POINTER(aRootAccWrap); + if (!nsApplicationAccessible::AppendChild(aChild)) + return PR_FALSE; - // add by weak reference - nsresult rv = nsApplicationAccessible::AddRootAccessible(aRootAccWrap); - NS_ENSURE_SUCCESS(rv, rv); - - AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aRootAccWrap); + AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild); atk_object_set_parent(atkAccessible, mAtkObject); PRUint32 count = mChildren.Length(); @@ -680,22 +677,20 @@ nsApplicationAccessibleWrap::AddRootAccessible(nsIAccessible *aRootAccWrap) g_timeout_add(0, fireRootAccessibleAddedCB, eventData); } - return NS_OK; + return PR_TRUE; } -nsresult -nsApplicationAccessibleWrap::RemoveRootAccessible(nsIAccessible *aRootAccWrap) +PRBool +nsApplicationAccessibleWrap::RemoveChild(nsAccessible* aChild) { - NS_ENSURE_ARG_POINTER(aRootAccWrap); + PRInt32 index = aChild->GetIndexInParent(); - PRInt32 index = mChildren.IndexOf(aRootAccWrap); - - AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aRootAccWrap); + AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aChild); atk_object_set_parent(atkAccessible, NULL); g_signal_emit_by_name(mAtkObject, "children_changed::remove", index, atkAccessible, NULL); - return nsApplicationAccessible::RemoveRootAccessible(aRootAccWrap); + return nsApplicationAccessible::RemoveChild(aChild); } void diff --git a/accessible/src/atk/nsApplicationAccessibleWrap.h b/accessible/src/atk/nsApplicationAccessibleWrap.h index 9991c4b69c90..b3f03bb05f70 100644 --- a/accessible/src/atk/nsApplicationAccessibleWrap.h +++ b/accessible/src/atk/nsApplicationAccessibleWrap.h @@ -57,12 +57,12 @@ public: // nsAccessNode virtual PRBool Init(); + // nsAccessible + virtual PRBool AppendChild(nsAccessible* aChild); + virtual PRBool RemoveChild(nsAccessible* aChild); + // return the atk object for app root accessible NS_IMETHOD GetNativeInterface(void **aOutAccessible); - - // nsApplicationAccessible - virtual nsresult AddRootAccessible(nsIAccessible *aRootAccWrap); - virtual nsresult RemoveRootAccessible(nsIAccessible *aRootAccWrap); }; #endif /* __NS_APP_ROOT_ACCESSIBLE_H__ */ diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp index 668be79428f7..29ef684f8388 100644 --- a/accessible/src/base/nsAccessibilityService.cpp +++ b/accessible/src/base/nsAccessibilityService.cpp @@ -1901,45 +1901,36 @@ nsAccessibilityService::CreateAccessibleByType(nsIContent *aContent, //////////////////////////////////////////////////////////////////////////////// // nsIAccessibilityService (DON'T put methods here) -nsresult -nsAccessibilityService::AddNativeRootAccessible(void *aAtkAccessible, - nsIAccessible **aRootAccessible) -{ +nsAccessible* +nsAccessibilityService::AddNativeRootAccessible(void* aAtkAccessible) + { #ifdef MOZ_ACCESSIBILITY_ATK - nsNativeRootAccessibleWrap* rootAccWrap = - new nsNativeRootAccessibleWrap((AtkObject*)aAtkAccessible); - - *aRootAccessible = static_cast(rootAccWrap); - NS_ADDREF(*aRootAccessible); - - nsApplicationAccessible *applicationAcc = + nsApplicationAccessible* applicationAcc = nsAccessNode::GetApplicationAccessible(); - NS_ENSURE_STATE(applicationAcc); + if (!applicationAcc) + return nsnull; - applicationAcc->AddRootAccessible(*aRootAccessible); + nsNativeRootAccessibleWrap* nativeRootAcc = + new nsNativeRootAccessibleWrap((AtkObject*)aAtkAccessible); + if (!nativeRootAcc) + return nsnull; - return NS_OK; -#else - return NS_ERROR_NOT_IMPLEMENTED; + if (applicationAcc->AppendChild(nativeRootAcc)) + return nativeRootAcc; #endif -} -nsresult -nsAccessibilityService::RemoveNativeRootAccessible(nsIAccessible *aRootAccessible) + return nsnull; + } + +void +nsAccessibilityService::RemoveNativeRootAccessible(nsAccessible* aAccessible) { #ifdef MOZ_ACCESSIBILITY_ATK - void* atkAccessible; - aRootAccessible->GetNativeInterface(&atkAccessible); - - nsApplicationAccessible *applicationAcc = + nsApplicationAccessible* applicationAcc = nsAccessNode::GetApplicationAccessible(); - NS_ENSURE_STATE(applicationAcc); - applicationAcc->RemoveRootAccessible(aRootAccessible); - - return NS_OK; -#else - return NS_ERROR_NOT_IMPLEMENTED; + if (applicationAcc) + applicationAcc->RemoveChild(aAccessible); #endif } diff --git a/accessible/src/base/nsAccessibilityService.h b/accessible/src/base/nsAccessibilityService.h index 15d551b9ae22..f4683055924d 100644 --- a/accessible/src/base/nsAccessibilityService.h +++ b/accessible/src/base/nsAccessibilityService.h @@ -114,9 +114,8 @@ public: virtual nsresult CreateHTMLCaptionAccessible(nsIFrame *aFrame, nsIAccessible **aAccessible); - virtual nsresult AddNativeRootAccessible(void *aAtkAccessible, - nsIAccessible **aAccessible); - virtual nsresult RemoveNativeRootAccessible(nsIAccessible *aRootAccessible); + virtual nsAccessible* AddNativeRootAccessible(void* aAtkAccessible); + virtual void RemoveNativeRootAccessible(nsAccessible* aRootAccessible); virtual nsresult InvalidateSubtreeFor(nsIPresShell *aPresShell, nsIContent *aContent, diff --git a/accessible/src/base/nsApplicationAccessible.cpp b/accessible/src/base/nsApplicationAccessible.cpp index 7906235513d3..4dbf2f822449 100644 --- a/accessible/src/base/nsApplicationAccessible.cpp +++ b/accessible/src/base/nsApplicationAccessible.cpp @@ -414,8 +414,8 @@ nsApplicationAccessible::GetParent() void nsApplicationAccessible::InvalidateChildren() { - // Do nothing because application children are kept updated by - // AddRootAccessible() and RemoveRootAccessible() method calls. + // Do nothing because application children are kept updated by AppendChild() + // and RemoveChild() method calls. } //////////////////////////////////////////////////////////////////////////////// @@ -428,8 +428,8 @@ nsApplicationAccessible::CacheChildren() // children are requested because empty InvalidateChldren() prevents its // repeated calls. - // Basically children are kept updated by Add/RemoveRootAccessible method - // calls. However if there are open windows before accessibility was started + // Basically children are kept updated by Append/RemoveChild method calls. + // However if there are open windows before accessibility was started // then we need to make sure root accessibles for open windows are created so // that all root accessibles are stored in application accessible children // array. @@ -481,30 +481,22 @@ nsApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError) //////////////////////////////////////////////////////////////////////////////// // Public methods -nsresult -nsApplicationAccessible::AddRootAccessible(nsIAccessible *aRootAccessible) +PRBool +nsApplicationAccessible::AppendChild(nsAccessible* aChild) { - NS_ENSURE_ARG_POINTER(aRootAccessible); + if (!mChildren.AppendElement(aChild)) + return PR_FALSE; - nsRefPtr rootAcc = do_QueryObject(aRootAccessible); - - if (!mChildren.AppendElement(rootAcc)) - return NS_ERROR_FAILURE; - - rootAcc->SetParent(this); - - return NS_OK; + aChild->SetParent(this); + return PR_TRUE; } -nsresult -nsApplicationAccessible::RemoveRootAccessible(nsIAccessible *aRootAccessible) +PRBool +nsApplicationAccessible::RemoveChild(nsAccessible* aChild) { - NS_ENSURE_ARG_POINTER(aRootAccessible); - - // It's not needed to void root accessible parent because this method is - // called on root accessible shutdown and its parent will be cleared - // properly. - return mChildren.RemoveElement(aRootAccessible) ? NS_OK : NS_ERROR_FAILURE; + // It's not needed to unbind root accessible from parent because this method + // is called when root accessible is shutdown and it'll be unbound properly. + return mChildren.RemoveElement(aChild); } //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/src/base/nsApplicationAccessible.h b/accessible/src/base/nsApplicationAccessible.h index e8b65ec25fd1..41bf2d31cc86 100644 --- a/accessible/src/base/nsApplicationAccessible.h +++ b/accessible/src/base/nsApplicationAccessible.h @@ -116,10 +116,8 @@ public: virtual nsAccessible* GetParent(); virtual void InvalidateChildren(); - - // nsApplicationAccessible - virtual nsresult AddRootAccessible(nsIAccessible *aRootAccWrap); - virtual nsresult RemoveRootAccessible(nsIAccessible *aRootAccWrap); + virtual PRBool AppendChild(nsAccessible* aChild); + virtual PRBool RemoveChild(nsAccessible* aChild); protected: diff --git a/accessible/src/base/nsRootAccessible.cpp b/accessible/src/base/nsRootAccessible.cpp index a47f6c209aa4..cc8bfc258ed4 100644 --- a/accessible/src/base/nsRootAccessible.cpp +++ b/accessible/src/base/nsRootAccessible.cpp @@ -831,11 +831,9 @@ PRBool nsRootAccessible::Init() { nsApplicationAccessible *applicationAcc = GetApplicationAccessible(); - if (!applicationAcc) + if (!applicationAcc || !applicationAcc->AppendChild(this)) return PR_FALSE; - applicationAcc->AddRootAccessible(this); - return nsDocAccessibleWrap::Init(); } @@ -850,7 +848,7 @@ nsRootAccessible::Shutdown() if (!applicationAcc) return; - applicationAcc->RemoveRootAccessible(this); + applicationAcc->RemoveChild(this); mCurrentARIAMenubar = nsnull; @@ -940,8 +938,8 @@ nsRootAccessible::GetRelationByType(PRUint32 aRelationType, nsAccessible* nsRootAccessible::GetParent() { - // Parent has been setted in nsApplicationAccesible::AddRootAccessible() - // when root accessible was intialized. + // Parent has been set in nsApplicationAccesible::AppendChild() when root + // accessible was initialized. return mParent; } diff --git a/widget/src/gtk2/nsAccessibilityHelper.cpp b/widget/src/gtk2/nsAccessibilityHelper.cpp index c93c12db0537..16c192664eae 100644 --- a/widget/src/gtk2/nsAccessibilityHelper.cpp +++ b/widget/src/gtk2/nsAccessibilityHelper.cpp @@ -54,19 +54,19 @@ gint RunDialog(GtkDialog* aDialog) nsCOMPtr accService = do_GetService ("@mozilla.org/accessibilityService;1"); - nsCOMPtr accessible; // Attach the dialog accessible to app accessible tree + nsAccessible* windowAcc = nsnull; if (accService) { AtkObject* gailWindow = gtk_widget_get_accessible(GTK_WIDGET(aDialog)); - accService->AddNativeRootAccessible(gailWindow, getter_AddRefs(accessible)); + windowAcc = accService->AddNativeRootAccessible(gailWindow); } gint result = gtk_dialog_run (aDialog); // Deattach the dialog accessible - if (accService && accessible) { - accService->RemoveNativeRootAccessible(accessible); + if (accService && windowAcc) { + accService->RemoveNativeRootAccessible(windowAcc); } return result; From 5e880dbc8a004b9329ee1872826366591922e01a Mon Sep 17 00:00:00 2001 From: timeless Date: Fri, 25 Jun 2010 20:49:02 +0900 Subject: [PATCH 002/172] Bug 573934 - Crash with Last pass addon on trying to edit passwords/user names in Lastpass (no primaryColumn [@nsCoreUtils::IsColumnHiddenm, r=surkov --- accessible/src/xul/nsXULTreeAccessible.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accessible/src/xul/nsXULTreeAccessible.cpp b/accessible/src/xul/nsXULTreeAccessible.cpp index 49bf246fad5c..e7ac8217afc8 100644 --- a/accessible/src/xul/nsXULTreeAccessible.cpp +++ b/accessible/src/xul/nsXULTreeAccessible.cpp @@ -1124,7 +1124,8 @@ nsXULTreeItemAccessibleBase::IsExpandable() nsCOMPtr primaryColumn; if (columns) { columns->GetPrimaryColumn(getter_AddRefs(primaryColumn)); - if (!nsCoreUtils::IsColumnHidden(primaryColumn)) + if (primaryColumn && + !nsCoreUtils::IsColumnHidden(primaryColumn)) return PR_TRUE; } } From fcce45e7242923cc6f813858146c51016f292785 Mon Sep 17 00:00:00 2001 From: Oleg Romashin Date: Fri, 25 Jun 2010 07:18:56 -0400 Subject: [PATCH 003/172] Bug 574581 - "Conditional jump or move depends on uninitialised value(s)" in ThebesLayerOGL::EnsureSurface(). r=jones.chris.g --HG-- extra : rebase_source : 6934d7596614430ae5366da61b2a0846fd90c311 --- gfx/layers/opengl/ThebesLayerOGL.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/gfx/layers/opengl/ThebesLayerOGL.cpp b/gfx/layers/opengl/ThebesLayerOGL.cpp index deb77c94a1f5..7be496444807 100644 --- a/gfx/layers/opengl/ThebesLayerOGL.cpp +++ b/gfx/layers/opengl/ThebesLayerOGL.cpp @@ -78,6 +78,7 @@ ThebesLayerOGL::ThebesLayerOGL(LayerManagerOGL *aManager) , LayerOGL(aManager) , mTexture(0) , mOffscreenFormat(gfxASurface::ImageFormatUnknown) + , mOffscreenSize(-1,-1) { mImplData = static_cast(this); } From f48d5e9dd00d4e782b75c0f1b38e883f069a6020 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 25 Jun 2010 14:02:24 +0200 Subject: [PATCH 004/172] Bug 569586 - XPCOM compilation failure on mingw-w64 due to pointer to int cast loosing precision. r=benjamin --HG-- extra : rebase_source : e4d0b0b110992af5f397aea52c36a5f5ed9f56c5 --- xpcom/base/nsStackWalk.cpp | 2 +- xpcom/ds/nsWindowsRegKey.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xpcom/base/nsStackWalk.cpp b/xpcom/base/nsStackWalk.cpp index a091af95e6cb..bac8fc27cabb 100644 --- a/xpcom/base/nsStackWalk.cpp +++ b/xpcom/base/nsStackWalk.cpp @@ -1031,7 +1031,7 @@ NS_DescribeCodeAddress(void *aPC, nsCodeAddressDetails *aDetails) // This just makes sure we get good info if available. // - DWORD addr = (DWORD)aPC; + DWORD_PTR addr = (DWORD_PTR)aPC; IMAGEHLP_MODULE modInfo; IMAGEHLP_LINE lineInfo; BOOL modInfoRes; diff --git a/xpcom/ds/nsWindowsRegKey.cpp b/xpcom/ds/nsWindowsRegKey.cpp index 8e7cc1df4e30..0fa484f006cf 100644 --- a/xpcom/ds/nsWindowsRegKey.cpp +++ b/xpcom/ds/nsWindowsRegKey.cpp @@ -139,7 +139,7 @@ nsWindowsRegKey::OpenChild(const nsAString &path, PRUint32 mode, if (!child) return NS_ERROR_OUT_OF_MEMORY; - nsresult rv = child->Open((PRUint32) mKey, path, mode); + nsresult rv = child->Open((uintptr_t) mKey, path, mode); if (NS_FAILED(rv)) return rv; @@ -157,7 +157,7 @@ nsWindowsRegKey::CreateChild(const nsAString &path, PRUint32 mode, if (!child) return NS_ERROR_OUT_OF_MEMORY; - nsresult rv = child->Create((PRUint32) mKey, path, mode); + nsresult rv = child->Create((uintptr_t) mKey, path, mode); if (NS_FAILED(rv)) return rv; From 629079c1ebd34c3371abe1a531bcc4f7172ea305 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 25 Jun 2010 14:06:26 +0200 Subject: [PATCH 005/172] Bug 449292 - gfxHarfBuzzShaper.cpp mingw fix. r=jfkthame --HG-- extra : rebase_source : 4a9dae1e9123206f89ff6d6197a32752077570ee --- gfx/thebes/src/gfxHarfBuzzShaper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gfx/thebes/src/gfxHarfBuzzShaper.cpp b/gfx/thebes/src/gfxHarfBuzzShaper.cpp index db3c09f674f3..45c68e495692 100644 --- a/gfx/thebes/src/gfxHarfBuzzShaper.cpp +++ b/gfx/thebes/src/gfxHarfBuzzShaper.cpp @@ -407,8 +407,8 @@ gfxHarfBuzzShaper::InitTextRun(gfxContext *aContext, hb_buffer_set_script(buffer, hb_script_t(aRunScript)); // hb_buffer_set_language(buffer, HB_OT_TAG_DEFAULT_LANGUAGE); - hb_buffer_add_utf16(buffer, aString + aRunStart, aRunLength, - 0, aRunLength); + hb_buffer_add_utf16(buffer, reinterpret_cast(aString + aRunStart), + aRunLength, 0, aRunLength); hb_shape(font, mHBFace, buffer, features.Elements(), features.Length()); From 289901d403ebac71c86e0367f341e9f5c9aef386 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 25 Jun 2010 14:09:22 +0200 Subject: [PATCH 006/172] Bug 569590 - nsNativeAppSupportWin.cpp compilation failure on mingw-w64 due to pointer to int casts loosing precision r=timeless --HG-- extra : rebase_source : 7d8365f7e7a8a507b55a21c232b1df2d819e4a09 --- toolkit/xre/nsNativeAppSupportWin.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/toolkit/xre/nsNativeAppSupportWin.cpp b/toolkit/xre/nsNativeAppSupportWin.cpp index b234a229c304..4a85b7c13e86 100644 --- a/toolkit/xre/nsNativeAppSupportWin.cpp +++ b/toolkit/xre/nsNativeAppSupportWin.cpp @@ -389,7 +389,7 @@ nsNativeAppSupportWin::CheckConsole() { // all cases. See http://support.microsoft.com/support/kb/articles/q105/3/05.asp. // stdout - int hCrt = ::_open_osfhandle( (long)GetStdHandle( STD_OUTPUT_HANDLE ), + int hCrt = ::_open_osfhandle( (intptr_t)GetStdHandle( STD_OUTPUT_HANDLE ), _O_TEXT ); if ( hCrt != -1 ) { FILE *hf = ::_fdopen( hCrt, "w" ); @@ -402,7 +402,7 @@ nsNativeAppSupportWin::CheckConsole() { } // stderr - hCrt = ::_open_osfhandle( (long)::GetStdHandle( STD_ERROR_HANDLE ), + hCrt = ::_open_osfhandle( (intptr_t)::GetStdHandle( STD_ERROR_HANDLE ), _O_TEXT ); if ( hCrt != -1 ) { FILE *hf = ::_fdopen( hCrt, "w" ); @@ -646,7 +646,7 @@ struct MessageWindow { // Get current window and return its window handle. nsCOMPtr win; GetMostRecentWindow( 0, getter_AddRefs( win ) ); - return win ? (long)hwndForDOMWindow( win ) : 0; + return win ? (LRESULT)hwndForDOMWindow( win ) : 0; } return DefWindowProc( msgWindow, msg, wp, lp ); } @@ -1160,8 +1160,6 @@ nsNativeAppSupportWin::HandleDDENotification( UINT uType, // transaction t #if MOZ_DEBUG_DDE printf( "Handling dde request: [%s]...\n", (char*)request ); #endif - // Default is to open in current window. - PRBool new_window = PR_FALSE; nsAutoString url; ParseDDEArg((const WCHAR*) request, 0, url); @@ -1261,7 +1259,7 @@ void nsNativeAppSupportWin::ParseDDEArg( const WCHAR* args, int index, nsString& // Utility to parse out argument from a DDE item string. void nsNativeAppSupportWin::ParseDDEArg( HSZ args, int index, nsString& aString) { - DWORD argLen = DdeQueryStringW( mInstance, args, NULL, NULL, CP_WINUNICODE ); + DWORD argLen = DdeQueryStringW( mInstance, args, NULL, 0, CP_WINUNICODE ); // there wasn't any string, so return empty string if ( !argLen ) return; nsAutoString temp; From e3b73e2d7b20058855b3135eb978182d42856f0e Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 25 Jun 2010 14:10:54 +0200 Subject: [PATCH 007/172] Bug 569608 - gfxTextRunWordCache.cpp compilation failure on mingw-w64 due to pointer to long cast loosing precision r=vladimir --HG-- extra : rebase_source : 3142d17d9c28beb1a2034a555b2ffe4a95e71f9c --- gfx/thebes/src/gfxTextRunWordCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/thebes/src/gfxTextRunWordCache.cpp b/gfx/thebes/src/gfxTextRunWordCache.cpp index 294dea25280e..1e4b0bb1ec21 100644 --- a/gfx/thebes/src/gfxTextRunWordCache.cpp +++ b/gfx/thebes/src/gfxTextRunWordCache.cpp @@ -945,7 +945,7 @@ TextRunWordCache::CacheHashEntry::HashKey(const KeyTypePointer aKey) PRUint32 fontSetGen; LL_L2UI(fontSetGen, aKey->mUserFontSetGeneration); - return aKey->mStringHash + fontSetGen + (long)aKey->mFontOrGroup + aKey->mAppUnitsPerDevUnit + + return aKey->mStringHash + fontSetGen + (PRUint32)(intptr_t)aKey->mFontOrGroup + aKey->mAppUnitsPerDevUnit + aKey->mIsDoubleByteText + aKey->mIsRTL*2 + aKey->mEnabledOptionalLigatures*4 + aKey->mOptimizeSpeed*8; } From 8dbc202a27571d0b0b93a2e237597bdf1bf17ea5 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 25 Jun 2010 14:13:17 +0200 Subject: [PATCH 008/172] Bug 569587 - nsBidiKeyboard.cpp compilation failure on mingw-w64 due to pointer to int casts loosing precision r=roc --HG-- extra : rebase_source : 35f06b84e0445a946607bdae61e5feadab45b361 --- widget/src/windows/nsBidiKeyboard.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/widget/src/windows/nsBidiKeyboard.cpp b/widget/src/windows/nsBidiKeyboard.cpp index 6b27f2435dbe..3bd96b33c9eb 100644 --- a/widget/src/windows/nsBidiKeyboard.cpp +++ b/widget/src/windows/nsBidiKeyboard.cpp @@ -158,12 +158,12 @@ nsresult nsBidiKeyboard::SetupBidiKeyboards() locale = buf[keyboards]; if (IsRTLLanguage(locale)) { _snwprintf(mRTLKeyboard, KL_NAMELENGTH, L"%.*x", KL_NAMELENGTH - 1, - LANGIDFROMLCID((DWORD)locale)); + LANGIDFROMLCID((DWORD_PTR)locale)); isRTLKeyboardSet = PR_TRUE; } else { _snwprintf(mLTRKeyboard, KL_NAMELENGTH, L"%.*x", KL_NAMELENGTH - 1, - LANGIDFROMLCID((DWORD)locale)); + LANGIDFROMLCID((DWORD_PTR)locale)); isLTRKeyboardSet = PR_TRUE; } } @@ -213,7 +213,7 @@ nsresult nsBidiKeyboard::SetupBidiKeyboards() PRBool nsBidiKeyboard::IsRTLLanguage(HKL aLocale) { LOCALESIGNATURE localesig; - return (::GetLocaleInfoW(PRIMARYLANGID((DWORD)aLocale), + return (::GetLocaleInfoW(PRIMARYLANGID((DWORD_PTR)aLocale), LOCALE_FONTSIGNATURE, (LPWSTR)&localesig, (sizeof(localesig)/sizeof(WCHAR))) && From b12784751c23e65ae654d7dccc571f6f48e2eb82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Fri, 25 Jun 2010 14:19:12 +0200 Subject: [PATCH 009/172] Bug 574435 - Hide the menu bar by default on Win Vista and 7. r=gavin --HG-- extra : rebase_source : b09d158f092ac116577a5ae91eb4eedca2305948 --- browser/base/content/browser.js | 11 +++++- browser/base/content/win6BrowserOverlay.xul | 44 +++++++++++++++++++++ browser/base/jar.mn | 6 +++ 3 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 browser/base/content/win6BrowserOverlay.xul diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index a2c67ed8504c..f445f232ebe3 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -4640,8 +4640,15 @@ var TabsOnTop = { #ifdef MENUBAR_CAN_AUTOHIDE function updateAppButtonDisplay() { - document.getElementById("appmenu-button-container").hidden = - document.getElementById("toolbar-menubar").getAttribute("autohide") != "true"; + var menubarHidden = + document.getElementById("toolbar-menubar").getAttribute("autohide") == "true"; + + document.getElementById("appmenu-button-container").hidden = !menubarHidden; + + if (menubarHidden) + document.documentElement.setAttribute("chromemargin", "0,-1,-1,-1"); + else + document.documentElement.removeAttribute("chromemargin"); } #endif diff --git a/browser/base/content/win6BrowserOverlay.xul b/browser/base/content/win6BrowserOverlay.xul new file mode 100644 index 000000000000..c2dbaf3fb34b --- /dev/null +++ b/browser/base/content/win6BrowserOverlay.xul @@ -0,0 +1,44 @@ + +# -*- Mode: HTML -*- +# +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org Code. +# +# The Initial Developer of the Original Code is the Mozilla Foundation. +# Portions created by the Initial Developer are Copyright (C) 2010 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Dão Gottwald (Original Author) +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + + + + diff --git a/browser/base/jar.mn b/browser/base/jar.mn index 6b1051af84de..21fdaa9cca88 100644 --- a/browser/base/jar.mn +++ b/browser/base/jar.mn @@ -6,6 +6,9 @@ browser.jar: % overlay chrome://global/content/console.xul chrome://browser/content/jsConsoleOverlay.xul % overlay chrome://mozapps/content/update/updates.xul chrome://browser/content/softwareUpdateOverlay.xul #endif +#ifdef XP_WIN +% overlay chrome://browser/content/browser.xul chrome://browser/content/win6BrowserOverlay.xul os=WINNT osversion>=6 +#endif % overlay chrome://global/content/viewSource.xul chrome://browser/content/viewSourceOverlay.xul % overlay chrome://global/content/viewPartialSource.xul chrome://browser/content/viewSourceOverlay.xul % style chrome://global/content/customizeToolbar.xul chrome://browser/content/browser.css @@ -59,6 +62,9 @@ browser.jar: * content/browser/softwareUpdateOverlay.xul (content/softwareUpdateOverlay.xul) #endif * content/browser/viewSourceOverlay.xul (content/viewSourceOverlay.xul) +#ifdef XP_WIN +* content/browser/win6BrowserOverlay.xul (content/win6BrowserOverlay.xul) +#endif # the following files are browser-specific overrides * content/browser/license.html (/toolkit/content/license.html) % override chrome://global/content/license.html chrome://browser/content/license.html From e2e6234ae2ef6b684f1578ecf467a93e6bbfe864 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Fri, 25 Jun 2010 14:20:33 +0200 Subject: [PATCH 010/172] Bug 573326 - In the toolbar customization window, hide the toolbarbutton label and replicate it on the wrapper. r=gavin --HG-- extra : rebase_source : d70c7db9eac07e0df16b1ca824802654395278eb --- toolkit/content/customizeToolbar.css | 5 +++++ toolkit/content/customizeToolbar.js | 2 ++ 2 files changed, 7 insertions(+) diff --git a/toolkit/content/customizeToolbar.css b/toolkit/content/customizeToolbar.css index 6bb38ce087e5..89a753e8f221 100644 --- a/toolkit/content/customizeToolbar.css +++ b/toolkit/content/customizeToolbar.css @@ -57,3 +57,8 @@ #main-box > box { overflow: hidden; } + +/* Hide the toolbarbutton label because we replicate it on the wrapper */ +toolbarpaletteitem[place="palette"] > .toolbarbutton-1 > .toolbarbutton-text { + display: none; +} diff --git a/toolkit/content/customizeToolbar.js b/toolkit/content/customizeToolbar.js index a0c7183668a3..587e09c44ac7 100644 --- a/toolkit/content/customizeToolbar.js +++ b/toolkit/content/customizeToolbar.js @@ -455,6 +455,8 @@ function cleanUpItemForPalette(aItem, aWrapper) if (aItem.hasAttribute("title")) aWrapper.setAttribute("title", aItem.getAttribute("title")); + else if (aItem.hasAttribute("label")) + aWrapper.setAttribute("title", aItem.getAttribute("label")); else if (isSpecialItem(aItem)) { var stringBundle = document.getElementById("stringBundle"); // Remove the common "toolbar" prefix to generate the string name. From eb59bf141ef4e7ac1b42c5e0ada8d070b0918f85 Mon Sep 17 00:00:00 2001 From: Mounir Lamouri Date: Fri, 25 Jun 2010 14:23:10 +0200 Subject: [PATCH 011/172] Bug 573698 - When looking for tooltips, don't look at SVG elements if SVG is disabled. r=gavin --HG-- extra : rebase_source : 2700089c813b5c7976855f9ed09caf5cb0a56fc2 --- browser/base/content/browser.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index f445f232ebe3..e19d213ce954 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -2673,7 +2673,11 @@ function FillInHTMLTooltip(tipElement) var titleText = null; var XLinkTitleText = null; var SVGTitleText = null; +#ifdef MOZ_SVG var lookingForSVGTitle = true; +#else + var lookingForSVGTitle = false; +#endif // MOZ_SVG var direction = tipElement.ownerDocument.dir; while (!titleText && !XLinkTitleText && !SVGTitleText && tipElement) { From d8a28816248acf1ea38bb526de8280d8974aacb7 Mon Sep 17 00:00:00 2001 From: "Mike Kristoffersen ext:(%3E)" Date: Fri, 25 Jun 2010 14:25:31 +0200 Subject: [PATCH 012/172] Bug 562181 - Add support for MozOrientation on Qt. r=dougt --HG-- rename : widget/src/android/nsAccelerometerAndroid.cpp => dom/system/android/nsAccelerometerSystem.cpp rename : widget/src/android/nsAccelerometerAndroid.h => dom/system/android/nsAccelerometerSystem.h rename : widget/src/cocoa/nsAccelerometerX.h => dom/system/cocoa/nsAccelerometerSystem.h rename : widget/src/cocoa/nsAccelerometerX.mm => dom/system/cocoa/nsAccelerometerSystem.mm rename : widget/src/xpwidgets/nsAccelerometer.cpp => dom/system/nsAccelerometer.cpp rename : widget/src/xpwidgets/nsAccelerometer.h => dom/system/nsAccelerometer.h rename : widget/src/gtk2/nsAccelerometerUnix.cpp => dom/system/unix/nsAccelerometerSystem.cpp rename : widget/src/gtk2/nsAccelerometerUnix.h => dom/system/unix/nsAccelerometerSystem.h rename : widget/src/windows/nsAccelerometerWin.cpp => dom/system/windows/nsAccelerometerSystem.cpp rename : widget/src/windows/nsAccelerometerWin.h => dom/system/windows/nsAccelerometerSystem.h rename : widget/public/nsIAccelerometer.idl => xpcom/system/nsIAccelerometer.idl extra : rebase_source : f9c352566a6d4088e8d448587214fb87402a4dc3 --- dom/Makefile.in | 1 + dom/base/nsGlobalWindow.cpp | 3 +- dom/system/Makefile.in | 80 +++++++++++++++++++ dom/system/android/Makefile.in | 59 ++++++++++++++ .../system/android/nsAccelerometerSystem.cpp | 12 +-- .../system/android/nsAccelerometerSystem.h | 12 +-- dom/system/cocoa/Makefile.in | 58 ++++++++++++++ .../system/cocoa/nsAccelerometerSystem.h | 10 +-- .../system/cocoa/nsAccelerometerSystem.mm | 38 ++++----- .../system}/nsAccelerometer.cpp | 0 .../system}/nsAccelerometer.h | 6 ++ dom/system/unix/Makefile.in | 58 ++++++++++++++ .../system/unix/nsAccelerometerSystem.cpp | 18 ++--- .../system/unix/nsAccelerometerSystem.h | 14 ++-- dom/system/windows/Makefile.in | 58 ++++++++++++++ .../system/windows/nsAccelerometerSystem.cpp | 24 +++--- .../system/windows/nsAccelerometerSystem.h | 10 +-- layout/build/Makefile.in | 31 +++++++ layout/build/nsLayoutModule.cpp | 23 ++++++ widget/public/Makefile.in | 1 - widget/public/nsWidgetsCID.h | 6 -- widget/src/android/Makefile.in | 2 +- widget/src/android/nsAppShell.cpp | 4 +- widget/src/android/nsWidgetFactory.cpp | 9 +-- widget/src/build/nsWinWidgetFactory.cpp | 8 -- widget/src/cocoa/Makefile.in | 1 - widget/src/cocoa/nsWidgetFactory.mm | 6 -- widget/src/gtk2/Makefile.in | 1 - widget/src/gtk2/nsWidgetFactory.cpp | 6 -- widget/src/windows/Makefile.in | 1 - widget/src/xpwidgets/Makefile.in | 1 - xpcom/system/Makefile.in | 1 + .../system}/nsIAccelerometer.idl | 0 33 files changed, 449 insertions(+), 113 deletions(-) create mode 100644 dom/system/Makefile.in create mode 100644 dom/system/android/Makefile.in rename widget/src/android/nsAccelerometerAndroid.cpp => dom/system/android/nsAccelerometerSystem.cpp (88%) rename widget/src/android/nsAccelerometerAndroid.h => dom/system/android/nsAccelerometerSystem.h (89%) create mode 100644 dom/system/cocoa/Makefile.in rename widget/src/cocoa/nsAccelerometerX.h => dom/system/cocoa/nsAccelerometerSystem.h (91%) rename widget/src/cocoa/nsAccelerometerX.mm => dom/system/cocoa/nsAccelerometerSystem.mm (94%) rename {widget/src/xpwidgets => dom/system}/nsAccelerometer.cpp (100%) rename {widget/src/xpwidgets => dom/system}/nsAccelerometer.h (93%) create mode 100644 dom/system/unix/Makefile.in rename widget/src/gtk2/nsAccelerometerUnix.cpp => dom/system/unix/nsAccelerometerSystem.cpp (94%) rename widget/src/gtk2/nsAccelerometerUnix.h => dom/system/unix/nsAccelerometerSystem.h (89%) create mode 100644 dom/system/windows/Makefile.in rename widget/src/windows/nsAccelerometerWin.cpp => dom/system/windows/nsAccelerometerSystem.cpp (96%) rename widget/src/windows/nsAccelerometerWin.h => dom/system/windows/nsAccelerometerSystem.h (92%) rename {widget/public => xpcom/system}/nsIAccelerometer.idl (100%) diff --git a/dom/Makefile.in b/dom/Makefile.in index 3f8e157058c8..fae851fd05a9 100644 --- a/dom/Makefile.in +++ b/dom/Makefile.in @@ -81,6 +81,7 @@ DIRS += \ locales \ plugins \ indexedDB \ + system \ $(NULL) ifdef ENABLE_TESTS diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 61c3c438b3f7..f9b41b554cf5 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -86,8 +86,7 @@ #include "nsCanvasFrame.h" #include "nsIWidget.h" #include "nsIBaseWindow.h" -#include "nsIAccelerometer.h" -#include "nsWidgetsCID.h" +#include "nsAccelerometer.h" #include "nsIContent.h" #include "nsIContentViewerEdit.h" #include "nsIDocShell.h" diff --git a/dom/system/Makefile.in b/dom/system/Makefile.in new file mode 100644 index 000000000000..a4a3c179fa5b --- /dev/null +++ b/dom/system/Makefile.in @@ -0,0 +1,80 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Foundation. +# Portions created by the Initial Developer are Copyright (C) 2010 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# +# 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"), +# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH = ../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +MODULE = dom +LIBRARY_NAME = domsystem_s +LIBXUL_LIBRARY = 1 + +ifneq (,$(filter qt gtk2,$(MOZ_WIDGET_TOOLKIT))) +DIRS = unix +endif + +ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT))) +DIRS = windows +endif + +ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT))) +DIRS = cocoa +endif + +ifneq (,$(filter android,$(MOZ_WIDGET_TOOLKIT))) +DIRS = android +endif + +CPPSRCS = \ + nsAccelerometer.cpp \ + $(NULL) + +EXPORTS = \ + nsAccelerometer.h \ + $(NULL) + +include $(topsrcdir)/config/config.mk + +# we don't want the shared lib, but we want to force the creation of a static lib. +LIBXUL_LIBRARY = 1 +FORCE_STATIC_LIB = 1 +EXPORT_LIBRARY = 1 + +include $(topsrcdir)/config/rules.mk + diff --git a/dom/system/android/Makefile.in b/dom/system/android/Makefile.in new file mode 100644 index 000000000000..478b4d228710 --- /dev/null +++ b/dom/system/android/Makefile.in @@ -0,0 +1,59 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org build system. +# +# The Initial Developer of the Original Code is Mozilla Foundation +# Portions created by the Initial Developer are Copyright (C) 2010 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mike Kristoffersen +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH = ../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +MODULE = dom +LIBRARY_NAME = domsystemandroid_s + +# we don't want the shared lib, but we want to force the creation of a static lib. +LIBXUL_LIBRARY = 1 +FORCE_STATIC_LIB = 1 +EXPORT_LIBRARY = 1 + +include $(topsrcdir)/config/config.mk + +CPPSRCS = \ + nsAccelerometerSystem.cpp \ + $(NULL) + +include $(topsrcdir)/config/rules.mk + diff --git a/widget/src/android/nsAccelerometerAndroid.cpp b/dom/system/android/nsAccelerometerSystem.cpp similarity index 88% rename from widget/src/android/nsAccelerometerAndroid.cpp rename to dom/system/android/nsAccelerometerSystem.cpp index 7fce6d481dcd..8debd3ca6bbc 100644 --- a/widget/src/android/nsAccelerometerAndroid.cpp +++ b/dom/system/android/nsAccelerometerSystem.cpp @@ -34,29 +34,29 @@ * * ***** END LICENSE BLOCK ***** */ -#include "nsAccelerometerAndroid.h" +#include "nsAccelerometerSystem.h" #include "AndroidBridge.h" using namespace mozilla; -extern nsAccelerometerAndroid *gAccel; +extern nsAccelerometerSystem *gAccel; -nsAccelerometerAndroid::nsAccelerometerAndroid() +nsAccelerometerSystem::nsAccelerometerSystem() { gAccel = this; } -nsAccelerometerAndroid::~nsAccelerometerAndroid() +nsAccelerometerSystem::~nsAccelerometerSystem() { } -void nsAccelerometerAndroid::Startup() +void nsAccelerometerSystem::Startup() { AndroidBridge::Bridge()->EnableAccelerometer(true); } -void nsAccelerometerAndroid::Shutdown() +void nsAccelerometerSystem::Shutdown() { AndroidBridge::Bridge()->EnableAccelerometer(false); } diff --git a/widget/src/android/nsAccelerometerAndroid.h b/dom/system/android/nsAccelerometerSystem.h similarity index 89% rename from widget/src/android/nsAccelerometerAndroid.h rename to dom/system/android/nsAccelerometerSystem.h index 417a80fa9c87..8d6cf3c060d8 100644 --- a/widget/src/android/nsAccelerometerAndroid.h +++ b/dom/system/android/nsAccelerometerSystem.h @@ -34,21 +34,21 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef nsAccelerometerAndroid_h -#define nsAccelerometerAndroid_h +#ifndef nsAccelerometerSystem_h +#define nsAccelerometerSystem_h #include "nsAccelerometer.h" -class nsAccelerometerAndroid : public nsAccelerometer +class nsAccelerometerSystem : public nsAccelerometer { public: - nsAccelerometerAndroid(); - virtual ~nsAccelerometerAndroid(); + nsAccelerometerSystem(); + virtual ~nsAccelerometerSystem(); private: virtual void Startup(); virtual void Shutdown(); }; -#endif /* nsAccelerometerAndroid_h */ +#endif /* nsAccelerometerSystem_h */ diff --git a/dom/system/cocoa/Makefile.in b/dom/system/cocoa/Makefile.in new file mode 100644 index 000000000000..aa50e19c3531 --- /dev/null +++ b/dom/system/cocoa/Makefile.in @@ -0,0 +1,58 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org build system. +# +# The Initial Developer of the Original Code is Mozilla Foundation +# Portions created by the Initial Developer are Copyright (C) 2010 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mike Kristoffersen +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH = ../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +MODULE = dom +LIBRARY_NAME = domsystemcocoa_s + +# we don't want the shared lib, but we want to force the creation of a static lib. +LIBXUL_LIBRARY = 1 +FORCE_STATIC_LIB = 1 +EXPORT_LIBRARY = 1 + +include $(topsrcdir)/config/config.mk + +CMMSRCS = \ + nsAccelerometerSystem.mm \ + $(NULL) + +include $(topsrcdir)/config/rules.mk diff --git a/widget/src/cocoa/nsAccelerometerX.h b/dom/system/cocoa/nsAccelerometerSystem.h similarity index 91% rename from widget/src/cocoa/nsAccelerometerX.h rename to dom/system/cocoa/nsAccelerometerSystem.h index c70459087e5d..0ba7da7b14c1 100644 --- a/widget/src/cocoa/nsAccelerometerX.h +++ b/dom/system/cocoa/nsAccelerometerSystem.h @@ -34,19 +34,19 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef nsAccelerometerX_h -#define nsAccelerometerX_h +#ifndef nsAccelerometerSystem_h +#define nsAccelerometerSystem_h #include #include #include "nsAccelerometer.h" -class nsAccelerometerX : public nsAccelerometer +class nsAccelerometerSystem : public nsAccelerometer { public: - nsAccelerometerX(); - ~nsAccelerometerX(); + nsAccelerometerSystem(); + ~nsAccelerometerSystem(); void Startup(); void Shutdown(); diff --git a/widget/src/cocoa/nsAccelerometerX.mm b/dom/system/cocoa/nsAccelerometerSystem.mm similarity index 94% rename from widget/src/cocoa/nsAccelerometerX.mm rename to dom/system/cocoa/nsAccelerometerSystem.mm index f248524765b2..655ea39791fa 100644 --- a/widget/src/cocoa/nsAccelerometerX.mm +++ b/dom/system/cocoa/nsAccelerometerSystem.mm @@ -34,7 +34,7 @@ * * ***** END LICENSE BLOCK ***** */ -#include "nsAccelerometerX.h" +#include "nsAccelerometerSystem.h" #include "nsIServiceManager.h" #include "stdlib.h" @@ -45,11 +45,11 @@ #define MODEL_NAME_LENGTH 64 static char gModelName[MODEL_NAME_LENGTH]; -nsAccelerometerX::nsAccelerometerX() +nsAccelerometerSystem::nsAccelerometerSystem() { } -nsAccelerometerX::~nsAccelerometerX() +nsAccelerometerSystem::~nsAccelerometerSystem() { } @@ -72,9 +72,9 @@ typedef struct #define SMSDATA_USED_SIZE (sizeof(SmsData) - SMSDATA_PADDING_SIZE) void -nsAccelerometerX::UpdateHandler(nsITimer *aTimer, void *aClosure) +nsAccelerometerSystem::UpdateHandler(nsITimer *aTimer, void *aClosure) { - nsAccelerometerX *self = reinterpret_cast(aClosure); + nsAccelerometerSystem *self = reinterpret_cast(aClosure); if (!self) { NS_ERROR("no self"); return; @@ -87,7 +87,7 @@ nsAccelerometerX::UpdateHandler(nsITimer *aTimer, void *aClosure) if (!input || !output) return; - + memset(input, 0, bufferLen); memset(output, 0, bufferLen); @@ -115,14 +115,14 @@ nsAccelerometerX::UpdateHandler(nsITimer *aTimer, void *aClosure) } SmsData *data = (SmsData*) output; - + float xf, yf, zf; // we want to normalize the return result from the chip to // something between -1 and 1 where 0 is the balance point. const int normalizeFactor = 250.5; - + if (!strcmp(gModelName, "MacBookPro5,1")) { xf = ((float)data->x) / normalizeFactor; yf = (((float)data->y) / normalizeFactor) * -1; @@ -146,7 +146,7 @@ nsAccelerometerX::UpdateHandler(nsITimer *aTimer, void *aClosure) self->AccelerationChanged( xf, yf, zf ); } -void nsAccelerometerX::Startup() +void nsAccelerometerSystem::Startup() { // we can fail, and that just means the caller will not see any changes. @@ -154,31 +154,31 @@ void nsAccelerometerX::Startup() kern_return_t result = ::IOMasterPort(MACH_PORT_NULL, &port); if (result != kIOReturnSuccess) return; - + CFMutableDictionaryRef dict = ::IOServiceMatching("SMCMotionSensor"); if (!dict) return; - + io_iterator_t iter; result = ::IOServiceGetMatchingServices(port, dict, &iter); if (result != kIOReturnSuccess) return; - + io_object_t device = ::IOIteratorNext(iter); ::IOObjectRelease(iter); - + if (!device) return; - + result = ::IOServiceOpen(device, mach_task_self(), 0, &mSmsConnection); ::IOObjectRelease(device); - + if (result != kIOReturnSuccess) return; - + mach_port_deallocate(mach_task_self(), port); - + /* get the version of the hardware we are running on. */ int mib[2]; size_t len = MODEL_NAME_LENGTH; @@ -194,11 +194,11 @@ void nsAccelerometerX::Startup() nsITimer::TYPE_REPEATING_SLACK); } -void nsAccelerometerX::Shutdown() +void nsAccelerometerSystem::Shutdown() { if (mSmsConnection) ::IOServiceClose(mSmsConnection); - + if (mUpdateTimer) { mUpdateTimer->Cancel(); mUpdateTimer = nsnull; diff --git a/widget/src/xpwidgets/nsAccelerometer.cpp b/dom/system/nsAccelerometer.cpp similarity index 100% rename from widget/src/xpwidgets/nsAccelerometer.cpp rename to dom/system/nsAccelerometer.cpp diff --git a/widget/src/xpwidgets/nsAccelerometer.h b/dom/system/nsAccelerometer.h similarity index 93% rename from widget/src/xpwidgets/nsAccelerometer.h rename to dom/system/nsAccelerometer.h index 0f87d52e60ed..f8d1f3cc69cf 100644 --- a/widget/src/xpwidgets/nsAccelerometer.h +++ b/dom/system/nsAccelerometer.h @@ -42,6 +42,12 @@ #include "nsCOMPtr.h" #include "nsITimer.h" +#define NS_ACCELEROMETER_CID \ +{ 0xecba5203, 0x77da, 0x465a, \ +{ 0x86, 0x5e, 0x78, 0xb7, 0xaf, 0x10, 0xd8, 0xf7 } } + +#define NS_ACCELEROMETER_CONTRACTID "@mozilla.org/accelerometer;1" + class nsIDOMWindow; class nsAccelerometer : public nsIAccelerometer diff --git a/dom/system/unix/Makefile.in b/dom/system/unix/Makefile.in new file mode 100644 index 000000000000..b498b728463b --- /dev/null +++ b/dom/system/unix/Makefile.in @@ -0,0 +1,58 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org build system. +# +# The Initial Developer of the Original Code is Mozilla Foundation +# Portions created by the Initial Developer are Copyright (C) 2010 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mike Kristoffersen +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH = ../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +MODULE = dom +LIBRARY_NAME = domsystemunix_s + +# we don't want the shared lib, but we want to force the creation of a static lib. +LIBXUL_LIBRARY = 1 +FORCE_STATIC_LIB = 1 +EXPORT_LIBRARY = 1 + +include $(topsrcdir)/config/config.mk + +CPPSRCS = \ + nsAccelerometerSystem.cpp \ + $(NULL) + +include $(topsrcdir)/config/rules.mk \ No newline at end of file diff --git a/widget/src/gtk2/nsAccelerometerUnix.cpp b/dom/system/unix/nsAccelerometerSystem.cpp similarity index 94% rename from widget/src/gtk2/nsAccelerometerUnix.cpp rename to dom/system/unix/nsAccelerometerSystem.cpp index 4d6802ea5bca..bb4e59bac0ba 100644 --- a/widget/src/gtk2/nsAccelerometerUnix.cpp +++ b/dom/system/unix/nsAccelerometerSystem.cpp @@ -36,13 +36,13 @@ * ***** END LICENSE BLOCK ***** */ #include -#include "nsAccelerometerUnix.h" +#include "nsAccelerometerSystem.h" #include "nsIServiceManager.h" typedef struct { const char* mPosition; const char* mCalibrate; - nsAccelerometerUnixDriver mToken; + nsAccelerometerSystemDriver mToken; } Accelerometer; static const Accelerometer gAccelerometers[] = { @@ -64,21 +64,21 @@ static const Accelerometer gAccelerometers[] = { eHPdv7Sensor}, }; -nsAccelerometerUnix::nsAccelerometerUnix() : +nsAccelerometerSystem::nsAccelerometerSystem() : mPositionFile(NULL), mCalibrateFile(NULL), mType(eNoSensor) { } -nsAccelerometerUnix::~nsAccelerometerUnix() +nsAccelerometerSystem::~nsAccelerometerSystem() { } void -nsAccelerometerUnix::UpdateHandler(nsITimer *aTimer, void *aClosure) +nsAccelerometerSystem::UpdateHandler(nsITimer *aTimer, void *aClosure) { - nsAccelerometerUnix *self = reinterpret_cast(aClosure); + nsAccelerometerSystem *self = reinterpret_cast(aClosure); if (!self) { NS_ERROR("no self"); return; @@ -190,7 +190,7 @@ nsAccelerometerUnix::UpdateHandler(nsITimer *aTimer, void *aClosure) self->AccelerationChanged( xf, yf, zf ); } -void nsAccelerometerUnix::Startup() +void nsAccelerometerSystem::Startup() { // Accelerometers in Linux are used by reading a file (yay UNIX!), which is // in a slightly different location depending on the driver. @@ -213,7 +213,7 @@ void nsAccelerometerUnix::Startup() if (mType == eNoSensor) return; - + mUpdateTimer = do_CreateInstance("@mozilla.org/timer;1"); if (mUpdateTimer) mUpdateTimer->InitWithFuncCallback(UpdateHandler, @@ -222,7 +222,7 @@ void nsAccelerometerUnix::Startup() nsITimer::TYPE_REPEATING_SLACK); } -void nsAccelerometerUnix::Shutdown() +void nsAccelerometerSystem::Shutdown() { if (mPositionFile) { fclose(mPositionFile); diff --git a/widget/src/gtk2/nsAccelerometerUnix.h b/dom/system/unix/nsAccelerometerSystem.h similarity index 89% rename from widget/src/gtk2/nsAccelerometerUnix.h rename to dom/system/unix/nsAccelerometerSystem.h index 7cf0dbdf53be..5971ce39c83e 100644 --- a/widget/src/gtk2/nsAccelerometerUnix.h +++ b/dom/system/unix/nsAccelerometerSystem.h @@ -35,13 +35,13 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef nsAccelerometerUnix_h -#define nsAccelerometerUnix_h +#ifndef nsAccelerometerSystem_h +#define nsAccelerometerSystem_h #include #include "nsAccelerometer.h" -enum nsAccelerometerUnixDriver +enum nsAccelerometerSystemDriver { eNoSensor, eAppleSensor, @@ -50,18 +50,18 @@ enum nsAccelerometerUnixDriver eHPdv7Sensor }; -class nsAccelerometerUnix : public nsAccelerometer +class nsAccelerometerSystem : public nsAccelerometer { public: - nsAccelerometerUnix(); - ~nsAccelerometerUnix(); + nsAccelerometerSystem(); + ~nsAccelerometerSystem(); void Startup(); void Shutdown(); FILE* mPositionFile; FILE* mCalibrateFile; - nsAccelerometerUnixDriver mType; + nsAccelerometerSystemDriver mType; nsCOMPtr mUpdateTimer; static void UpdateHandler(nsITimer *aTimer, void *aClosure); diff --git a/dom/system/windows/Makefile.in b/dom/system/windows/Makefile.in new file mode 100644 index 000000000000..bdbb71a4316a --- /dev/null +++ b/dom/system/windows/Makefile.in @@ -0,0 +1,58 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org build system. +# +# The Initial Developer of the Original Code is Mozilla Foundation +# Portions created by the Initial Developer are Copyright (C) 2010 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Mike Kristoffersen +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +DEPTH = ../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ + +include $(DEPTH)/config/autoconf.mk + +MODULE = dom +LIBRARY_NAME = domsystemwindows_s + +# we don't want the shared lib, but we want to force the creation of a static lib. +LIBXUL_LIBRARY = 1 +FORCE_STATIC_LIB = 1 +EXPORT_LIBRARY = 1 + +include $(topsrcdir)/config/config.mk + +CPPSRCS = \ + nsAccelerometerSystem.cpp \ + $(NULL) + +include $(topsrcdir)/config/rules.mk diff --git a/widget/src/windows/nsAccelerometerWin.cpp b/dom/system/windows/nsAccelerometerSystem.cpp similarity index 96% rename from widget/src/windows/nsAccelerometerWin.cpp rename to dom/system/windows/nsAccelerometerSystem.cpp index bdf720f562a0..c4d309e70cc4 100644 --- a/widget/src/windows/nsAccelerometerWin.cpp +++ b/dom/system/windows/nsAccelerometerSystem.cpp @@ -35,14 +35,14 @@ * * ***** END LICENSE BLOCK ***** */ -#include "nsAccelerometerWin.h" +#include "nsAccelerometerSystem.h" #include "nsIServiceManager.h" #include "windows.h" #ifdef WINCE_WINDOWS_MOBILE //////////////////////////// -// HTC +// HTC //////////////////////////// @@ -91,7 +91,7 @@ PRBool HTCSensor::Startup() { HMODULE hSensorLib = LoadLibraryW(L"HTCSensorSDK.dll"); - + if (!hSensorLib) return PR_FALSE; @@ -183,8 +183,8 @@ typedef struct FLOAT z; /**< Z-direction value */ } SmiAccelerometerVector; -/** - * Specifies the capabilities of the Accelerometer device. +/** + * Specifies the capabilities of the Accelerometer device. */ typedef struct { @@ -450,13 +450,13 @@ ThinkPadSensor::GetValues(double *x, double *y, double *z) #endif -nsAccelerometerWin::nsAccelerometerWin(){} -nsAccelerometerWin::~nsAccelerometerWin(){} +nsAccelerometerSystem::nsAccelerometerSystem(){} +nsAccelerometerSystem::~nsAccelerometerSystem(){} void -nsAccelerometerWin::UpdateHandler(nsITimer *aTimer, void *aClosure) +nsAccelerometerSystem::UpdateHandler(nsITimer *aTimer, void *aClosure) { - nsAccelerometerWin *self = reinterpret_cast(aClosure); + nsAccelerometerSystem *self = reinterpret_cast(aClosure); if (!self || !self->mSensor) { NS_ERROR("no self or sensor"); return; @@ -466,7 +466,7 @@ nsAccelerometerWin::UpdateHandler(nsITimer *aTimer, void *aClosure) self->AccelerationChanged(x, y, z); } -void nsAccelerometerWin::Startup() +void nsAccelerometerSystem::Startup() { NS_ASSERTION(!mSensor, "mSensor should be null. Startup called twice?"); @@ -499,7 +499,7 @@ void nsAccelerometerWin::Startup() started = mSensor->Startup(); #endif - + if (!started) return; @@ -511,7 +511,7 @@ void nsAccelerometerWin::Startup() nsITimer::TYPE_REPEATING_SLACK); } -void nsAccelerometerWin::Shutdown() +void nsAccelerometerSystem::Shutdown() { if (mUpdateTimer) { mUpdateTimer->Cancel(); diff --git a/widget/src/windows/nsAccelerometerWin.h b/dom/system/windows/nsAccelerometerSystem.h similarity index 92% rename from widget/src/windows/nsAccelerometerWin.h rename to dom/system/windows/nsAccelerometerSystem.h index 2c76e268792a..2ff277f345a5 100644 --- a/widget/src/windows/nsAccelerometerWin.h +++ b/dom/system/windows/nsAccelerometerSystem.h @@ -34,8 +34,8 @@ * * ***** END LICENSE BLOCK ***** */ -#ifndef nsAccelerometerWin_h -#define nsAccelerometerWin_h +#ifndef nsAccelerometerSystem_h +#define nsAccelerometerSystem_h #include "nsAccelerometer.h" #include "nsAutoPtr.h" @@ -48,11 +48,11 @@ class Sensor virtual void GetValues(double *x, double *y, double *z) = 0; }; -class nsAccelerometerWin : public nsAccelerometer +class nsAccelerometerSystem : public nsAccelerometer { public: - nsAccelerometerWin(); - ~nsAccelerometerWin(); + nsAccelerometerSystem(); + ~nsAccelerometerSystem(); void Startup(); void Shutdown(); diff --git a/layout/build/Makefile.in b/layout/build/Makefile.in index 7b77211ffcc1..d3358be33e91 100644 --- a/layout/build/Makefile.in +++ b/layout/build/Makefile.in @@ -104,6 +104,7 @@ SHARED_LIBRARY_LIBS = \ $(DEPTH)/dom/src/storage/$(LIB_PREFIX)jsdomstorage_s.$(LIB_SUFFIX) \ $(DEPTH)/dom/src/offline/$(LIB_PREFIX)jsdomoffline_s.$(LIB_SUFFIX) \ $(DEPTH)/dom/src/geolocation/$(LIB_PREFIX)jsdomgeolocation_s.$(LIB_SUFFIX) \ + $(DEPTH)/dom/system/$(LIB_PREFIX)domsystem_s.$(LIB_SUFFIX) \ $(DEPTH)/dom/src/threads/$(LIB_PREFIX)domthreads_s.$(LIB_SUFFIX) \ $(DEPTH)/dom/indexedDB/$(LIB_PREFIX)dom_indexeddb_s.$(LIB_SUFFIX) \ $(DEPTH)/editor/libeditor/text/$(LIB_PREFIX)texteditor_s.$(LIB_SUFFIX) \ @@ -112,6 +113,36 @@ SHARED_LIBRARY_LIBS = \ $(DEPTH)/caps/src/$(LIB_PREFIX)caps_s.$(LIB_SUFFIX) \ $(NULL) +ifneq (,$(filter qt gtk2,$(MOZ_WIDGET_TOOLKIT))) +SHARED_LIBRARY_LIBS += \ + $(DEPTH)/dom/system/unix/$(LIB_PREFIX)domsystemunix_s.$(LIB_SUFFIX) \ + $(NULL) +LOCAL_INCLUDES += \ + -I$(topsrcdir)/dom/system/unix \ + $(NULL) +else ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT))) +SHARED_LIBRARY_LIBS += \ + $(DEPTH)/dom/system/windows/$(LIB_PREFIX)domsystemwindows_s.$(LIB_SUFFIX) \ + $(NULL) +LOCAL_INCLUDES += \ + -I$(topsrcdir)/dom/system/windows \ + $(NULL) +else ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT))) +SHARED_LIBRARY_LIBS += \ + $(DEPTH)/dom/system/cocoa/$(LIB_PREFIX)domsystemcocoa_s.$(LIB_SUFFIX) \ + $(NULL) +LOCAL_INCLUDES += \ + -I$(topsrcdir)/dom/system/cocoa \ + $(NULL) +else ifneq (,$(filter android,$(MOZ_WIDGET_TOOLKIT))) +SHARED_LIBRARY_LIBS += \ + $(DEPTH)/dom/system/android/$(LIB_PREFIX)domsystemandroid_s.$(LIB_SUFFIX) \ + $(NULL) +LOCAL_INCLUDES += \ + -I$(topsrcdir)/dom/system/android \ + $(NULL) +endif + ifdef MOZ_VORBIS SHARED_LIBRARY_LIBS += \ $(DEPTH)/media/libvorbis/lib/$(LIB_PREFIX)vorbis.$(LIB_SUFFIX) \ diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index eaa7297486e6..ada8c7cc8ad4 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -279,6 +279,12 @@ static void Shutdown(); #endif #include "nsGeolocation.h" +#if defined(XP_UNIX) || \ + defined(_WINDOWS) || \ + defined(machintosh) || \ + defined(android) +#include "nsAccelerometerSystem.h" +#endif #include "nsCSPService.h" // Transformiix @@ -311,6 +317,12 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMParser) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsDOMStorageManager, nsDOMStorageManager::GetInstance) NS_GENERIC_FACTORY_CONSTRUCTOR(nsChannelPolicy) +#if defined(XP_UNIX) || \ + defined(_WINDOWS) || \ + defined(machintosh) || \ + defined(android) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsAccelerometerSystem) +#endif //----------------------------------------------------------------------------- @@ -1639,6 +1651,17 @@ static const nsModuleComponentInfo gLayoutComponents[] = { NS_EVENTLISTENERSERVICE_CONTRACTID, CreateEventListenerService }, +#if defined(XP_UNIX) || \ + defined(_WINDOWS) || \ + defined(machintosh) || \ + defined(android) + { "Accelerometer", + NS_ACCELEROMETER_CID, + NS_ACCELEROMETER_CONTRACTID, + nsAccelerometerSystemConstructor + }, +#endif + { "Global Message Manager", NS_GLOBALMESSAGEMANAGER_CID, NS_GLOBALMESSAGEMANAGER_CONTRACTID, diff --git a/widget/public/Makefile.in b/widget/public/Makefile.in index 8beba266d419..1e28f9f918e5 100644 --- a/widget/public/Makefile.in +++ b/widget/public/Makefile.in @@ -84,7 +84,6 @@ EXPORTS += \ endif XPIDLSRCS = \ - nsIAccelerometer.idl \ nsIAppShell.idl \ nsIFilePicker.idl \ nsIToolkit.idl \ diff --git a/widget/public/nsWidgetsCID.h b/widget/public/nsWidgetsCID.h index 84e31e3b14f0..4802f0a07911 100644 --- a/widget/public/nsWidgetsCID.h +++ b/widget/public/nsWidgetsCID.h @@ -194,9 +194,3 @@ { 0x06beec76, 0xa183, 0x4d9f, \ { 0x85, 0xdd, 0x08, 0x5f, 0x26, 0xda, 0x56, 0x5a } } -#define NS_ACCELEROMETER_CID \ -{ 0xecba5203, 0x77da, 0x465a, \ -{ 0x86, 0x5e, 0x78, 0xb7, 0xaf, 0x10, 0xd8, 0xf7 } } - -#define NS_ACCELEROMETER_CONTRACTID "@mozilla.org/accelerometer;1" - diff --git a/widget/src/android/Makefile.in b/widget/src/android/Makefile.in index 23b8283e66d0..f49a0bbcfd38 100644 --- a/widget/src/android/Makefile.in +++ b/widget/src/android/Makefile.in @@ -62,7 +62,6 @@ CPPSRCS = \ nsLookAndFeel.cpp \ nsScreenManagerAndroid.cpp \ nsIdleServiceAndroid.cpp \ - nsAccelerometerAndroid.cpp \ $(NULL) NOT_THERE_YET_CPPSRCS = \ @@ -98,6 +97,7 @@ DEFINES += -D_IMPL_NS_WIDGET LOCAL_INCLUDES += \ -I$(topsrcdir)/widget/src/xpwidgets \ + -I$(topsrcdir)/dom/system/android \ -I$(srcdir) \ $(NULL) diff --git a/widget/src/android/nsAppShell.cpp b/widget/src/android/nsAppShell.cpp index 2c8cb0b74dcb..9afeb5ced3ae 100644 --- a/widget/src/android/nsAppShell.cpp +++ b/widget/src/android/nsAppShell.cpp @@ -49,7 +49,7 @@ #include "prenv.h" #include "AndroidBridge.h" -#include "nsAccelerometerAndroid.h" +#include "nsAccelerometerSystem.h" #include #include @@ -70,7 +70,7 @@ using namespace mozilla; PRLogModuleInfo *gWidgetLog = nsnull; #endif -nsAccelerometerAndroid *gAccel = nsnull; +nsAccelerometerSystem *gAccel = nsnull; nsIGeolocationUpdate *gLocationCallback = nsnull; nsAppShell *nsAppShell::gAppShell = nsnull; diff --git a/widget/src/android/nsWidgetFactory.cpp b/widget/src/android/nsWidgetFactory.cpp index e7844bfe1efb..8f1733d283b5 100644 --- a/widget/src/android/nsWidgetFactory.cpp +++ b/widget/src/android/nsWidgetFactory.cpp @@ -49,14 +49,12 @@ #include "nsAppShellSingleton.h" #include "nsScreenManagerAndroid.h" -#include "nsAccelerometerAndroid.h" #include "nsIdleServiceAndroid.h" NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit) NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow) NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel) NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerAndroid) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsAccelerometerAndroid) NS_GENERIC_FACTORY_CONSTRUCTOR(nsIdleServiceAndroid) @@ -89,12 +87,7 @@ static const nsModuleComponentInfo components[] = { "Android Idle Service", NS_IDLE_SERVICE_CID, "@mozilla.org/widget/idleservice;1", - nsIdleServiceAndroidConstructor }, - { "Accelerometer", - NS_ACCELEROMETER_CID, - NS_ACCELEROMETER_CONTRACTID, - nsAccelerometerAndroidConstructor }, - + nsIdleServiceAndroidConstructor } }; static void diff --git a/widget/src/build/nsWinWidgetFactory.cpp b/widget/src/build/nsWinWidgetFactory.cpp index 706b443b9bdb..5519567304be 100644 --- a/widget/src/build/nsWinWidgetFactory.cpp +++ b/widget/src/build/nsWinWidgetFactory.cpp @@ -78,9 +78,6 @@ #include "nsPrintSession.h" #endif -#include "nsAccelerometerWin.h" -NS_GENERIC_FACTORY_CONSTRUCTOR(nsAccelerometerWin) - NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow) NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow) NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker) @@ -213,11 +210,6 @@ static const nsModuleComponentInfo components[] = nsBidiKeyboardConstructor }, #endif - { "Accelerometer", - NS_ACCELEROMETER_CID, - NS_ACCELEROMETER_CONTRACTID, - nsAccelerometerWinConstructor }, - #ifdef NS_PRINTING { "nsPrintOptionsWin", NS_PRINTSETTINGSSERVICE_CID, diff --git a/widget/src/cocoa/Makefile.in b/widget/src/cocoa/Makefile.in index 1ea291d9d68b..4d44ace8b7a0 100644 --- a/widget/src/cocoa/Makefile.in +++ b/widget/src/cocoa/Makefile.in @@ -88,7 +88,6 @@ CMMSRCS = \ nsPrintOptionsX.mm \ nsPrintSettingsX.mm \ nsIdleServiceX.mm \ - nsAccelerometerX.mm \ nsCocoaTextInputHandler.mm \ nsMacDockSupport.mm \ nsStandaloneNativeMenu.mm \ diff --git a/widget/src/cocoa/nsWidgetFactory.mm b/widget/src/cocoa/nsWidgetFactory.mm index 75b11c53f388..6ea558b5e0fe 100644 --- a/widget/src/cocoa/nsWidgetFactory.mm +++ b/widget/src/cocoa/nsWidgetFactory.mm @@ -57,7 +57,6 @@ #include "nsLookAndFeel.h" -#include "nsAccelerometerX.h" #include "nsSound.h" #include "nsIdleServiceX.h" @@ -73,7 +72,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker) NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit) NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel) NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsAccelerometerX) NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable) NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter) NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard) @@ -135,10 +133,6 @@ static const nsModuleComponentInfo gComponents[] = NS_SOUND_CID, "@mozilla.org/sound;1", nsSoundConstructor }, - { "Accelerometer", - NS_ACCELEROMETER_CID, - NS_ACCELEROMETER_CONTRACTID, - nsAccelerometerXConstructor }, { "Transferable", NS_TRANSFERABLE_CID, "@mozilla.org/widget/transferable;1", diff --git a/widget/src/gtk2/Makefile.in b/widget/src/gtk2/Makefile.in index 3f25f5775c23..7868061ad00d 100644 --- a/widget/src/gtk2/Makefile.in +++ b/widget/src/gtk2/Makefile.in @@ -78,7 +78,6 @@ CPPSRCS = \ nsScreenManagerGtk.cpp \ nsImageToPixbuf.cpp \ nsAccessibilityHelper.cpp \ - nsAccelerometerUnix.cpp \ nsGtkIMModule.cpp \ $(NULL) diff --git a/widget/src/gtk2/nsWidgetFactory.cpp b/widget/src/gtk2/nsWidgetFactory.cpp index 5aa391763b0c..bba1d97c566f 100644 --- a/widget/src/gtk2/nsWidgetFactory.cpp +++ b/widget/src/gtk2/nsWidgetFactory.cpp @@ -55,7 +55,6 @@ #include "nsBidiKeyboard.h" #include "nsNativeKeyBindings.h" #include "nsScreenManagerGtk.h" -#include "nsAccelerometerUnix.h" #ifdef NS_PRINTING #include "nsPrintOptionsGTK.h" @@ -102,7 +101,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService) NS_GENERIC_FACTORY_CONSTRUCTOR(nsSound) NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerGtk) NS_GENERIC_FACTORY_CONSTRUCTOR(nsImageToPixbuf) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsAccelerometerUnix) #ifdef NATIVE_THEME_SUPPORT @@ -254,10 +252,6 @@ static const nsModuleComponentInfo components[] = NS_SOUND_CID, "@mozilla.org/sound;1", nsSoundConstructor }, - { "Accelerometer", - NS_ACCELEROMETER_CID, - NS_ACCELEROMETER_CONTRACTID, - nsAccelerometerUnixConstructor }, { "Transferable", NS_TRANSFERABLE_CID, "@mozilla.org/widget/transferable;1", diff --git a/widget/src/windows/Makefile.in b/widget/src/windows/Makefile.in index 958a3ed2c836..245d95e06884 100644 --- a/widget/src/windows/Makefile.in +++ b/widget/src/windows/Makefile.in @@ -64,7 +64,6 @@ CPPSRCS = \ nsSound.cpp \ nsIMM32Handler.cpp \ WindowHook.cpp \ - nsAccelerometerWin.cpp \ WinTaskbar.cpp \ TaskbarPreview.cpp \ TaskbarTabPreview.cpp \ diff --git a/widget/src/xpwidgets/Makefile.in b/widget/src/xpwidgets/Makefile.in index c2b75987fe42..5ec94401056f 100644 --- a/widget/src/xpwidgets/Makefile.in +++ b/widget/src/xpwidgets/Makefile.in @@ -68,7 +68,6 @@ CPPSRCS = \ nsWidgetAtoms.cpp \ nsIdleService.cpp \ nsClipboardPrivacyHandler.cpp \ - nsAccelerometer.cpp \ $(NULL) ifneq (,$(filter beos os2 cocoa windows,$(MOZ_WIDGET_TOOLKIT))) diff --git a/xpcom/system/Makefile.in b/xpcom/system/Makefile.in index d244591fc5ba..0d1cd70119fa 100644 --- a/xpcom/system/Makefile.in +++ b/xpcom/system/Makefile.in @@ -52,6 +52,7 @@ XPIDLSRCS = \ nsIGnomeVFSService.idl \ nsIBlocklistService.idl \ nsIGIOService.idl \ + nsIAccelerometer.idl \ $(NULL) ifdef MOZ_CRASHREPORTER diff --git a/widget/public/nsIAccelerometer.idl b/xpcom/system/nsIAccelerometer.idl similarity index 100% rename from widget/public/nsIAccelerometer.idl rename to xpcom/system/nsIAccelerometer.idl From 10660f93fb7a797a309b57c2564b30d49bab6989 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 25 Jun 2010 14:26:50 +0200 Subject: [PATCH 013/172] Bug 570949 - Fix mingw compilation. r=ted --HG-- extra : rebase_source : 9aa909f76f4995c3be91402995ab0b5eabe96204 --- configure.in | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 193dbab604b3..d437a161e9a2 100644 --- a/configure.in +++ b/configure.in @@ -5911,7 +5911,7 @@ if test -n "$MOZ_WEBM"; then dnl Detect if we can use an assembler to compile optimized assembly for libvpx. dnl For Win32 (MSVC) we must use MASM. - if test "$OS_ARCH" = "WINNT" -a "$CPU_ARCH" = "x86" -a "$GNU_CC" != "yes"; then + if test "$OS_ARCH" = "WINNT" -a "$CPU_ARCH" = "x86" -a -z "$GNU_CC"; then AC_MSG_CHECKING([for MASM assembler]) AC_CHECK_PROGS(VPX_AS, ml, "") if test -n "$VPX_AS"; then @@ -5946,8 +5946,10 @@ if test -n "$MOZ_WEBM"; then VPX_X86_ASM=1 ;; WINNT:x86_64) - VPX_ASFLAGS="-f x64 -rnasm -pnasm" - VPX_X86_ASM=1 + if test -z "$GNU_CC"; then + VPX_ASFLAGS="-f x64 -rnasm -pnasm" + VPX_X86_ASM=1 + fi ;; esac fi # end have YASM From 6c13344d9a27ad502757ca6d60b9a866d0ae02d9 Mon Sep 17 00:00:00 2001 From: "mcdavis941.bugs@gmail.com" Date: Fri, 25 Jun 2010 14:29:07 +0200 Subject: [PATCH 014/172] Bug 571842 - add classes to split menu for CSS addressability. r=dao --HG-- extra : rebase_source : 29efb4b168ed74a99d53cf5d254af3aad2407daa --- browser/base/content/browser.xul | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 38b92c3fe22c..492ea8b65304 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -401,8 +401,9 @@ - + Date: Fri, 25 Jun 2010 21:43:10 +0900 Subject: [PATCH 015/172] Bug 561304. Use GDI shaper by default on XP and handle bitmap fonts better. r=jkew --- gfx/thebes/public/gfxFont.h | 1 + gfx/thebes/src/gfxFont.cpp | 4 +- gfx/thebes/src/gfxGDIFont.cpp | 118 +++++++++++++++--- gfx/thebes/src/gfxGDIFont.h | 6 +- gfx/thebes/src/gfxGDIFontList.cpp | 29 ++++- gfx/thebes/src/gfxGDIFontList.h | 4 + gfx/thebes/src/gfxGDIShaper.cpp | 5 + .../line-breaking/non-breakable-2-ref.html | 36 ++++++ .../line-breaking/non-breakable-2.html | 36 ++++++ layout/reftests/line-breaking/reftest.list | 1 + 10 files changed, 217 insertions(+), 23 deletions(-) create mode 100644 layout/reftests/line-breaking/non-breakable-2-ref.html create mode 100644 layout/reftests/line-breaking/non-breakable-2.html diff --git a/gfx/thebes/public/gfxFont.h b/gfx/thebes/public/gfxFont.h index a12147bd31b9..acbc33b8cb7e 100644 --- a/gfx/thebes/public/gfxFont.h +++ b/gfx/thebes/public/gfxFont.h @@ -210,6 +210,7 @@ public: return TestCharacterMap(ch); } + virtual PRBool SkipDuringSystemFallback() { return PR_FALSE; } virtual PRBool TestCharacterMap(PRUint32 aCh); nsresult InitializeUVSMap(); PRUint16 GetUVSGlyph(PRUint32 aCh, PRUint32 aVS); diff --git a/gfx/thebes/src/gfxFont.cpp b/gfx/thebes/src/gfxFont.cpp index a6e8f8145f1e..5650e3519f65 100644 --- a/gfx/thebes/src/gfxFont.cpp +++ b/gfx/thebes/src/gfxFont.cpp @@ -566,7 +566,9 @@ gfxFontFamily::FindFontForChar(FontSearch *aMatchData) PRUint32 numFonts = mAvailableFonts.Length(); for (PRUint32 i = 0; i < numFonts; i++) { gfxFontEntry *fe = mAvailableFonts[i]; - if (!fe) + + // skip certain fonts during system fallback + if (!fe || fe->SkipDuringSystemFallback()) continue; PRInt32 rank = 0; diff --git a/gfx/thebes/src/gfxGDIFont.cpp b/gfx/thebes/src/gfxGDIFont.cpp index 9d9ac4e1c856..d8f4e74a7b5d 100644 --- a/gfx/thebes/src/gfxGDIFont.cpp +++ b/gfx/thebes/src/gfxGDIFont.cpp @@ -45,6 +45,7 @@ #include "gfxHarfBuzzShaper.h" #include "gfxWindowsPlatform.h" #include "gfxContext.h" +#include "gfxUnicodeProperties.h" #include "cairo-win32.h" @@ -100,11 +101,7 @@ gfxGDIFont::~gfxGDIFont() void gfxGDIFont::CreatePlatformShaper() { - if (static_cast(mFontEntry.get())->mForceGDI) { - mPlatformShaper = new gfxGDIShaper(this); - } else { - mPlatformShaper = new gfxUniscribeShaper(this); - } + mPlatformShaper = new gfxGDIShaper(this); } gfxFont* @@ -114,6 +111,31 @@ gfxGDIFont::CopyWithAntialiasOption(AntialiasOption anAAOption) &mStyle, mNeedsBold, anAAOption); } +static PRBool +UseUniscribe(gfxTextRun *aTextRun, + const PRUnichar *aString, + PRUint32 aRunStart, + PRUint32 aRunLength) +{ + PRUint32 flags = aTextRun->GetFlags(); + PRBool useGDI; + + PRBool isXP = (gfxWindowsPlatform::WindowsOSVersion() + < gfxWindowsPlatform::kWindowsVista); + + // bug 561304 - Uniscribe bug produces bad positioning at certain + // font sizes on XP, so default to GDI on XP using logic of 3.6 + + useGDI = isXP && + (flags & + (gfxTextRunFactory::TEXT_OPTIMIZE_SPEED | + gfxTextRunFactory::TEXT_IS_RTL) + ) == gfxTextRunFactory::TEXT_OPTIMIZE_SPEED; + + return !useGDI || + ScriptIsComplex(aString + aRunStart, aRunLength, SIC_COMPLEX) == S_OK; +} + PRBool gfxGDIFont::InitTextRun(gfxContext *aContext, gfxTextRun *aTextRun, @@ -129,22 +151,84 @@ gfxGDIFont::InitTextRun(gfxContext *aContext, NS_WARNING("invalid font! expect incorrect text rendering"); return PR_FALSE; } - PRBool ok = gfxFont::InitTextRun(aContext, aTextRun, aString, - aRunStart, aRunLength, aRunScript); - if (!ok && mPlatformShaper) { - // shaping failed; if we were using uniscribe, fall back to GDI - GDIFontEntry *fe = static_cast(GetFontEntry()); - if (!fe->mForceGDI) { - NS_WARNING("uniscribe failed, switching to GDI shaper"); - fe->mForceGDI = PR_TRUE; - mPlatformShaper = new gfxGDIShaper(this); - ok = mPlatformShaper->InitTextRun(aContext, aTextRun, aString, - aRunStart, aRunLength, + + PRBool ok = PR_FALSE; + + if (mHarfBuzzShaper) { + if (gfxPlatform::GetPlatform()->UseHarfBuzzLevel() >= + gfxUnicodeProperties::ScriptShapingLevel(aRunScript)) { + ok = mHarfBuzzShaper->InitTextRun(aContext, aTextRun, aString, + aRunStart, aRunLength, aRunScript); - NS_WARN_IF_FALSE(ok, "GDI shaper failed!"); } } + if (!ok) { + GDIFontEntry *fe = static_cast(GetFontEntry()); + + if (UseUniscribe(aTextRun, aString, aRunStart, aRunLength) + && !fe->mForceGDI) + { + // first try Uniscribe + if (!mUniscribeShaper) { + mUniscribeShaper = new gfxUniscribeShaper(this); + } + + ok = mUniscribeShaper->InitTextRun(aContext, aTextRun, aString, + aRunStart, aRunLength, + aRunScript); + if (ok) { + return PR_TRUE; + } + + // fallback to GDI shaping + if (!mPlatformShaper) { + CreatePlatformShaper(); + } + + ok = mPlatformShaper->InitTextRun(aContext, aTextRun, aString, + aRunStart, aRunLength, + aRunScript); + + } else { + // first use GDI + if (!mPlatformShaper) { + CreatePlatformShaper(); + } + + ok = mPlatformShaper->InitTextRun(aContext, aTextRun, aString, + aRunStart, aRunLength, + aRunScript); + + if (ok) { + return PR_TRUE; + } + + // first try Uniscribe + if (!mUniscribeShaper) { + mUniscribeShaper = new gfxUniscribeShaper(this); + } + + // use Uniscribe shaping + ok = mUniscribeShaper->InitTextRun(aContext, aTextRun, aString, + aRunStart, aRunLength, + aRunScript); + } + +#if DEBUG + if (!ok) { + NS_ConvertUTF16toUTF8 name(GetName()); + char msg[256]; + + sprintf(msg, + "text shaping with both uniscribe and GDI failed for" + " font: %s", + name.get()); + NS_WARNING(msg); + } +#endif + } + return ok; } diff --git a/gfx/thebes/src/gfxGDIFont.h b/gfx/thebes/src/gfxGDIFont.h index 2e71737632b3..4c2cc5563ef1 100644 --- a/gfx/thebes/src/gfxGDIFont.h +++ b/gfx/thebes/src/gfxGDIFont.h @@ -59,7 +59,7 @@ public: virtual ~gfxGDIFont(); - HFONT GetHFONT() const { return mFont; } + HFONT GetHFONT() { if (!mMetrics) Initialize(); return mFont; } gfxFloat GetAdjustedSize() const { return mAdjustedSize; } @@ -96,6 +96,10 @@ protected: void FillLogFont(LOGFONTW& aLogFont, gfxFloat aSize); + // mPlatformShaper is used for the GDI shaper, mUniscribeShaper + // for the Uniscribe version if needed + nsAutoPtr mUniscribeShaper; + HFONT mFont; cairo_font_face_t *mFontFace; cairo_scaled_font_t *mScaledFont; diff --git a/gfx/thebes/src/gfxGDIFontList.cpp b/gfx/thebes/src/gfxGDIFontList.cpp index 5c90f0250ef1..f39e5398d2c8 100644 --- a/gfx/thebes/src/gfxGDIFontList.cpp +++ b/gfx/thebes/src/gfxGDIFontList.cpp @@ -205,6 +205,14 @@ GDIFontEntry::GDIFontEntry(const nsAString& aFaceName, gfxWindowsFontType aFontT nsresult GDIFontEntry::ReadCMAP() { + // skip non-SFNT fonts completely + if (mFontType != GFX_FONT_TYPE_PS_OPENTYPE && + mFontType != GFX_FONT_TYPE_TT_OPENTYPE && + mFontType != GFX_FONT_TYPE_TRUETYPE) + { + return NS_ERROR_FAILURE; + } + // attempt this once, if errors occur leave a blank cmap if (mCmapInitialized) return NS_OK; @@ -290,6 +298,8 @@ GDIFontEntry::FillLogFont(LOGFONTW *aLogFont, PRBool aItalic, aLogFont->lfQuality = (aUseCleartype ? CLEARTYPE_QUALITY : DEFAULT_QUALITY); } +#define MISSING_GLYPH 0x1F + PRBool GDIFontEntry::TestCharacterMap(PRUint32 aCh) { @@ -327,13 +337,24 @@ GDIFontEntry::TestCharacterMap(PRUint32 aCh) WORD glyph[1]; PRBool hasGlyph = PR_FALSE; + + // Bug 573038 - in some cases GetGlyphIndicesW returns 0xFFFF for a + // missing glyph or 0x1F in other cases to indicate the "invalid" + // glyph. Map both cases to "not found" if (IsType1() || mForceGDI) { - // Type1 fonts and uniscribe APIs don't get along. ScriptGetCMap will return E_HANDLE - DWORD ret = GetGlyphIndicesW(dc, str, 1, glyph, GGI_MARK_NONEXISTING_GLYPHS); - if (ret != GDI_ERROR && glyph[0] != 0xFFFF) + // Type1 fonts and uniscribe APIs don't get along. + // ScriptGetCMap will return E_HANDLE + DWORD ret = GetGlyphIndicesW(dc, str, 1, + glyph, GGI_MARK_NONEXISTING_GLYPHS); + if (ret != GDI_ERROR + && glyph[0] != 0xFFFF + && glyph[0] != MISSING_GLYPH) + { hasGlyph = PR_TRUE; + } } else { - // ScriptGetCMap works better than GetGlyphIndicesW for things like bitmap/vector fonts + // ScriptGetCMap works better than GetGlyphIndicesW + // for things like bitmap/vector fonts SCRIPT_CACHE sc = NULL; HRESULT rv = ScriptGetCMap(dc, &sc, str, 1, 0, glyph); if (rv == S_OK) diff --git a/gfx/thebes/src/gfxGDIFontList.h b/gfx/thebes/src/gfxGDIFontList.h index bfa502b51452..761a7786445a 100644 --- a/gfx/thebes/src/gfxGDIFontList.h +++ b/gfx/thebes/src/gfxGDIFontList.h @@ -271,6 +271,10 @@ public: return mUnicodeRanges.test(range); } + virtual PRBool SkipDuringSystemFallback() { + return !HasCmapTable(); // explicitly skip non-SFNT fonts + } + virtual PRBool TestCharacterMap(PRUint32 aCh); // create a font entry for a font with a given name diff --git a/gfx/thebes/src/gfxGDIShaper.cpp b/gfx/thebes/src/gfxGDIShaper.cpp index bfa7cfefc0d1..70ef821e30df 100644 --- a/gfx/thebes/src/gfxGDIShaper.cpp +++ b/gfx/thebes/src/gfxGDIShaper.cpp @@ -72,6 +72,11 @@ gfxGDIShaper::InitTextRun(gfxContext *aContext, if (ret == GDI_ERROR) { return PR_FALSE; } + + for (int k = 0; k < aRunLength; k++) { + if (glyphs[k] == 0xFFFF) + return PR_FALSE; + } SIZE size; nsAutoTArray partialWidthArray; diff --git a/layout/reftests/line-breaking/non-breakable-2-ref.html b/layout/reftests/line-breaking/non-breakable-2-ref.html new file mode 100644 index 000000000000..3e8302de1188 --- /dev/null +++ b/layout/reftests/line-breaking/non-breakable-2-ref.html @@ -0,0 +1,36 @@ + + + + + + + +

abcdef abcdef

+

abcdef) (abcdef

+

abcdef
 abcdef

+

abcdef 
abcdef

+

abcdef   abcdef

+ + +

abcdef abcdef

+

abcdef) (abcdef

+

abcdef
 abcdef

+

abcdef 
abcdef

+

abcdef   abcdef

+ + +

abcdef‑abcdef

+

abcdef)‑(abcdef

+

abcdef
‑abcdef

+

abcdef‑
abcdef

+

abcdef‑‑‑abcdef

+ + +

abcdef abcdef

+

abcdef) (abcdef

+

abcdef
 abcdef

+

abcdef 
abcdef

+

abcdef   abcdef

+ + + diff --git a/layout/reftests/line-breaking/non-breakable-2.html b/layout/reftests/line-breaking/non-breakable-2.html new file mode 100644 index 000000000000..8bc301bbcb8f --- /dev/null +++ b/layout/reftests/line-breaking/non-breakable-2.html @@ -0,0 +1,36 @@ + + + + + + + +

abcdef abcdef

+

abcdef) (abcdef

+

abcdef  abcdef

+

abcdef  abcdef

+

abcdef   abcdef

+ + +

abcdef abcdef

+

abcdef) (abcdef

+

abcdef  abcdef

+

abcdef  abcdef

+

abcdef   abcdef

+ + +

abcdef‑abcdef

+

abcdef)‑(abcdef

+

abcdef ‑abcdef

+

abcdef‑ abcdef

+

abcdef‑‑‑abcdef

+ + +

abcdef abcdef

+

abcdef) (abcdef

+

abcdef  abcdef

+

abcdef  abcdef

+

abcdef   abcdef

+ + + diff --git a/layout/reftests/line-breaking/reftest.list b/layout/reftests/line-breaking/reftest.list index 53728523c8e0..8fb894d28d42 100644 --- a/layout/reftests/line-breaking/reftest.list +++ b/layout/reftests/line-breaking/reftest.list @@ -12,6 +12,7 @@ random-if(MOZ_WIDGET_TOOLKIT=="cocoa") == ja-3.html ja-3-ref.html == leaders-1.html leaders-1-ref.html == markup-src-1.html markup-src-1-ref.html == non-breakable-1.html non-breakable-1-ref.html +== non-breakable-2.html non-breakable-2-ref.html == numerics-1.html numerics-1-ref.html == parentheses-1.html parentheses-1-ref.html == quotationmarks-1.html quotationmarks-1-ref.html From 5fb0a6803f66fa9612a99dd7966fe6c21ad6bddc Mon Sep 17 00:00:00 2001 From: "Alexander L. Slovesnik" Date: Fri, 25 Jun 2010 15:55:12 +0200 Subject: [PATCH 016/172] Bug 571129 - contextMenuSearchText should have numbered arguments. r=pike --- browser/locales/en-US/chrome/browser/browser.properties | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/browser/locales/en-US/chrome/browser/browser.properties b/browser/locales/en-US/chrome/browser/browser.properties index a80688a1b59a..8da51baa0b81 100644 --- a/browser/locales/en-US/chrome/browser/browser.properties +++ b/browser/locales/en-US/chrome/browser/browser.properties @@ -13,7 +13,9 @@ droponhomemsg=Do you want this document to be your new home page? # context menu strings -contextMenuSearchText=Search %S for "%S" +# LOCALIZATION NOTE (contextMenuSearchText): %1$S is the search engine, +# %2$S is the selection string. +contextMenuSearchText=Search %1$S for "%2$S" contextMenuSearchText.accesskey=S blockImages=Block Images from %S From 93dec03fb8fe256645157a265d85cf9c6d00c704 Mon Sep 17 00:00:00 2001 From: "hasse@jasajudeju.se" Date: Fri, 25 Jun 2010 15:55:54 +0200 Subject: [PATCH 017/172] Bug 454501 - Fix access keys in the PKCS#11 Device. r=kaie --- security/manager/pki/resources/content/load_device.xul | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/security/manager/pki/resources/content/load_device.xul b/security/manager/pki/resources/content/load_device.xul index 408e3edea438..0f38a9b74807 100644 --- a/security/manager/pki/resources/content/load_device.xul +++ b/security/manager/pki/resources/content/load_device.xul @@ -57,11 +57,13 @@ &loaddevice.info; - -