Backed out 5 changesets (bug 1015871, bug 1020257, bug 1015887, bug 1005888, bug 1015894) for desktop B2G mochitest failures on a CLOSED TREE.

Backed out changeset dbcb9974b640 (bug 1020257)
Backed out changeset 3220b7b2efc9 (bug 1015894)
Backed out changeset 4e23647ae247 (bug 1015887)
Backed out changeset 59df0cdacc15 (bug 1015871)
Backed out changeset e7124b07804b (bug 1005888)
This commit is contained in:
Ryan VanderMeulen 2014-06-04 16:07:06 -04:00
Родитель d6d20ed14c
Коммит 3d3ce28f0f
12 изменённых файлов: 101 добавлений и 72 удалений

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

@ -272,14 +272,7 @@ Target.prototype = {
},
_send: function target_send(data) {
let frame = this.frame;
let systemapp = document.querySelector('#systemapp');
if (this.frame === systemapp) {
frame = getContentWindow();
}
shell.sendEvent(frame, 'developer-hud-update', Cu.cloneInto(data, target));
shell.sendEvent(this.frame, 'developer-hud-update', Cu.cloneInto(data, this.frame));
}
};

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

@ -420,24 +420,7 @@ ContentPermissionPrompt.prototype = {
if (isApp) {
details.manifestURL = DOMApplicationRegistry.getManifestURLByLocalId(principal.appId);
}
// request.element is defined for OOP content, while request.window
// is defined for In-Process content.
// In both cases the message needs to be dispatched to the top-level
// <iframe mozbrowser> container in the system app.
// So the above code iterates over window.realFrameElement in order
// to crosss mozbrowser iframes boundaries and find the top-level
// one in the system app.
// window.realFrameElement will be |null| if the code try to cross
// content -> chrome boundaries.
let targetElement = request.element;
let targetWindow = request.window || targetElement.ownerDocument.defaultView;
while (targetWindow.realFrameElement) {
targetElement = targetWindow.realFrameElement;
targetWindow = targetElement.ownerDocument.defaultView;
}
SystemAppProxy.dispatchEvent(details, targetElement);
SystemAppProxy.dispatchEvent(details);
},
classID: Components.ID("{8c719f03-afe0-4aac-91ff-6c215895d467}"),

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

@ -58,10 +58,7 @@ let SystemAppProxy = {
* @param noPending Set to true to emit this event even before the system
* app is ready.
*/
_sendCustomEvent: function systemApp_sendCustomEvent(type,
details,
noPending,
target) {
_sendCustomEvent: function systemApp_sendCustomEvent(type, details, noPending) {
let content = this._frame ? this._frame.contentWindow : null;
// If the system app isn't ready yet,
@ -83,14 +80,14 @@ let SystemAppProxy = {
}
event.initCustomEvent(type, true, false, payload);
(target || content).dispatchEvent(event);
content.dispatchEvent(event);
return event;
},
// Now deprecated, use sendCustomEvent with a custom event name
dispatchEvent: function systemApp_sendChromeEvent(details, target) {
return this._sendCustomEvent('mozChromeEvent', details, false, target);
dispatchEvent: function systemApp_sendChromeEvent(details) {
return this._sendCustomEvent('mozChromeEvent', details);
},
// Listen for dom events on the system app

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

@ -8,7 +8,6 @@ Services.scriptloader.loadSubScript("resource://gre/modules/SystemAppProxy.jsm",
const { SystemAppProxy } = scope;
let frame;
let customEventTarget;
let index = -1;
function next() {
@ -48,10 +47,6 @@ function listener(event) {
} else if (n == 4) {
assert.equal(event.type, "mozChromeEvent");
assert.equal(event.detail.name, "fourth");
} else if (n == 5) {
assert.equal(event.type, "mozChromeEvent");
assert.equal(event.detail.name, "fifth");
assert.equal(event.target, customEventTarget);
next(); // call checkEventListening();
} else {
@ -84,8 +79,6 @@ let steps = [
frame = doc.createElement("iframe");
doc.documentElement.appendChild(frame);
customEventTarget = frame.contentDocument.body;
// Ensure that events are correctly sent to the frame.
// `listener` is going to call next()
frame.contentWindow.addEventListener("mozChromeEvent", listener);
@ -125,8 +118,7 @@ let steps = [
// they should be dispatched right away
SystemAppProxy._sendCustomEvent("custom", { name: "third" });
SystemAppProxy.dispatchEvent({ name: "fourth" });
SystemAppProxy._sendCustomEvent("custom", { name: "fifth" }, false, customEventTarget);
// Once this 5th event is received, we will run checkEventListening
// Once this 4th event is received, we will run checkEventListening
},
function checkEventListening() {

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

@ -967,7 +967,6 @@ public:
void SizeToContent(mozilla::ErrorResult& aError);
nsIDOMCrypto* GetCrypto(mozilla::ErrorResult& aError);
nsIControllers* GetControllers(mozilla::ErrorResult& aError);
mozilla::dom::Element* GetRealFrameElement(mozilla::ErrorResult& aError);
float GetMozInnerScreenX(mozilla::ErrorResult& aError);
float GetMozInnerScreenY(mozilla::ErrorResult& aError);
float GetDevicePixelRatio(mozilla::ErrorResult& aError);
@ -1375,6 +1374,8 @@ protected:
nsGlobalWindow* InnerForSetTimeoutOrInterval(mozilla::ErrorResult& aError);
mozilla::dom::Element* GetRealFrameElement(mozilla::ErrorResult& aError);
void PostMessageMoz(JSContext* aCx, JS::Handle<JS::Value> aMessage,
const nsAString& aTargetOrigin,
JS::Handle<JS::Value> aTransfer,

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

@ -285,8 +285,6 @@ partial interface Window {
// XXX Shouldn't this be in nsIDOMChromeWindow?
[ChromeOnly, Replaceable, Throws] readonly attribute MozControllers controllers;
[ChromeOnly, Throws] readonly attribute Element? realFrameElement;
[Throws] readonly attribute float mozInnerScreenX;
[Throws] readonly attribute float mozInnerScreenY;
[Throws] readonly attribute float devicePixelRatio;

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

@ -6,17 +6,31 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/MemoryReporting.h"
#if (MOZ_WIDGET_GTK == 2)
#include "gfxPlatformGtk.h"
#define gfxToolkitPlatform gfxPlatformGtk
#elif defined(MOZ_WIDGET_QT)
#include <qfontinfo.h>
#include "gfxQtPlatform.h"
#define gfxToolkitPlatform gfxQtPlatform
#elif defined(XP_WIN)
#include "gfxWindowsPlatform.h"
#define gfxToolkitPlatform gfxWindowsPlatform
#elif defined(ANDROID)
#include "mozilla/dom/ContentChild.h"
#include "gfxAndroidPlatform.h"
#include "mozilla/Omnijar.h"
#include "nsIInputStream.h"
#include "nsNetUtil.h"
#define gfxToolkitPlatform gfxAndroidPlatform
#endif
#ifdef ANDROID
#include "nsXULAppAPI.h"
#include <dirent.h>
#include <android/log.h>
#define ALOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gecko" , ## args)
#endif
#include "ft2build.h"
#include FT_FREETYPE_H
@ -44,6 +58,11 @@
#include "mozilla/scache/StartupCache.h"
#include <sys/stat.h>
#ifdef XP_WIN
#include "nsIWindowsRegKey.h"
#include <windows.h>
#endif
using namespace mozilla;
#ifdef PR_LOGGING
@ -66,6 +85,10 @@ static cairo_user_data_key_t sFTUserFontDataKey;
static __inline void
BuildKeyNameFromFontName(nsAString &aName)
{
#ifdef XP_WIN
if (aName.Length() >= LF_FACESIZE)
aName.Truncate(LF_FACESIZE - 1);
#endif
ToLowerCase(aName);
}
@ -940,7 +963,11 @@ gfxFT2FontList::AppendFacesFromFontFile(const nsCString& aFileName,
return;
}
#ifdef XP_WIN
FT_Library ftLibrary = gfxWindowsPlatform::GetPlatform()->GetFTLibrary();
#elif defined(ANDROID)
FT_Library ftLibrary = gfxAndroidPlatform::GetPlatform()->GetFTLibrary();
#endif
FT_Face dummy;
if (FT_Err_Ok == FT_New_Face(ftLibrary, aFileName.get(), -1, &dummy)) {
LOG(("reading font info via FreeType for %s", aFileName.get()));
@ -1143,6 +1170,50 @@ FinalizeFamilyMemberList(nsStringHashKey::KeyType aKey,
void
gfxFT2FontList::FindFonts()
{
#ifdef XP_WIN
nsTArray<nsString> searchPaths(3);
nsTArray<nsString> fontPatterns(3);
fontPatterns.AppendElement(NS_LITERAL_STRING("\\*.ttf"));
fontPatterns.AppendElement(NS_LITERAL_STRING("\\*.ttc"));
fontPatterns.AppendElement(NS_LITERAL_STRING("\\*.otf"));
wchar_t pathBuf[256];
SHGetSpecialFolderPathW(0, pathBuf, CSIDL_WINDOWS, 0);
searchPaths.AppendElement(pathBuf);
SHGetSpecialFolderPathW(0, pathBuf, CSIDL_FONTS, 0);
searchPaths.AppendElement(pathBuf);
nsCOMPtr<nsIFile> resDir;
NS_GetSpecialDirectory(NS_APP_RES_DIR, getter_AddRefs(resDir));
if (resDir) {
resDir->Append(NS_LITERAL_STRING("fonts"));
nsAutoString resPath;
resDir->GetPath(resPath);
searchPaths.AppendElement(resPath);
}
WIN32_FIND_DATAW results;
for (uint32_t i = 0; i < searchPaths.Length(); i++) {
const nsString& path(searchPaths[i]);
for (uint32_t j = 0; j < fontPatterns.Length(); j++) {
nsAutoString pattern(path);
pattern.Append(fontPatterns[j]);
HANDLE handle = FindFirstFileExW(pattern.get(),
FindExInfoStandard,
&results,
FindExSearchNameMatch,
nullptr,
0);
bool moreFiles = handle != INVALID_HANDLE_VALUE;
while (moreFiles) {
nsAutoString filePath(path);
filePath.Append('\\');
filePath.Append(results.cFileName);
AppendFacesFromFontFile(NS_ConvertUTF16toUTF8(filePath));
moreFiles = FindNextFile(handle, &results);
}
if (handle != INVALID_HANDLE_VALUE)
FindClose(handle);
}
}
#elif defined(ANDROID)
gfxFontCache *fc = gfxFontCache::GetCache();
if (fc)
fc->AgeAllGenerations();
@ -1188,6 +1259,7 @@ gfxFT2FontList::FindFonts()
// if we can't find/read the font directory, we are doomed!
NS_RUNTIMEABORT("Could not read the system fonts directory");
}
#endif // XP_WIN && ANDROID
// Look for fonts stored in omnijar, unless we're on a low-memory
// device where we don't want to spend the RAM to decompress them.
@ -1219,6 +1291,7 @@ gfxFT2FontList::FindFonts()
mFontFamilies.Enumerate(FinalizeFamilyMemberList, this);
}
#ifdef ANDROID
void
gfxFT2FontList::FindFontsInDir(const nsCString& aDir, FontNameCache *aFNC)
{
@ -1275,6 +1348,7 @@ gfxFT2FontList::FindFontsInDir(const nsCString& aDir, FontNameCache *aFNC)
closedir(d);
}
#endif
void
gfxFT2FontList::AppendFaceFromFontListEntry(const FontListEntry& aFLE,
@ -1432,7 +1506,16 @@ gfxFT2FontList::LookupLocalFont(const gfxProxyFontEntry *aProxyEntry,
gfxFontFamily*
gfxFT2FontList::GetDefaultFont(const gfxFontStyle* aStyle)
{
#ifdef MOZ_WIDGET_GONK
#ifdef XP_WIN
HGDIOBJ hGDI = ::GetStockObject(SYSTEM_FONT);
LOGFONTW logFont;
if (hGDI && ::GetObjectW(hGDI, sizeof(logFont), &logFont)) {
nsAutoString resolvedName;
if (ResolveFontName(nsDependentString(logFont.lfFaceName), resolvedName)) {
return FindFamily(resolvedName);
}
}
#elif defined(MOZ_WIDGET_GONK)
nsAutoString resolvedName;
if (ResolveFontName(NS_LITERAL_STRING("Fira Sans OT"), resolvedName)) {
return FindFamily(resolvedName);

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

@ -7,6 +7,11 @@
#define GFX_FT2FONTLIST_H
#include "mozilla/MemoryReporting.h"
#ifdef XP_WIN
#include "gfxWindowsPlatform.h"
#include <windows.h>
#endif
#include "gfxPlatformFontList.h"
namespace mozilla {
@ -148,7 +153,9 @@ protected:
void FindFontsInOmnijar(FontNameCache *aCache);
#ifdef ANDROID
void FindFontsInDir(const nsCString& aDir, FontNameCache* aFNC);
#endif
nsTHashtable<nsStringHashKey> mSkipSpaceLookupCheckFamilies;
};

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

@ -81,7 +81,6 @@ const char* const XPCJSRuntime::mStrings[] = {
"__exposedProps__", // IDX_EXPOSEDPROPS
"eval", // IDX_EVAL
"controllers", // IDX_CONTROLLERS
"realFrameElement", // IDX_REALFRAMEELEMENT
};
/***************************************************************************/

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

@ -479,7 +479,6 @@ public:
IDX_EXPOSEDPROPS ,
IDX_EVAL ,
IDX_CONTROLLERS ,
IDX_REALFRAMEELEMENT ,
IDX_TOTAL_COUNT // just a count of the above
};

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

@ -10,7 +10,6 @@
#include "nsIContent.h"
#include "nsIControllers.h"
#include "mozilla/dom/Element.h"
#include "nsContentUtils.h"
#include "XPCWrapper.h"
@ -1091,28 +1090,6 @@ XPCWrappedNativeXrayTraits::resolveNativeProperty(JSContext *cx, HandleObject wr
return true;
}
// The |realFrameElement| property is accessible as a [ChromeOnly] property
// on Window.WebIDL, and [noscript] in XPIDL. Chrome needs to see this over
// Xray, so we need to special-case it until we move |Window| to WebIDL.
if (id == GetRTIdByIndex(cx, XPCJSRuntime::IDX_REALFRAMEELEMENT) &&
AccessCheck::isChrome(wrapper) &&
(win = AsWindow(cx, wrapper)))
{
ErrorResult rv;
Element* f = win->GetRealFrameElement(rv);
if (!f) {
desc.object().set(nullptr);
return true;
}
if (!WrapNewBindingObject(cx, f, desc.value())) {
return false;
}
desc.object().set(wrapper);
return true;
}
XPCNativeInterface *iface;
XPCNativeMember *member;
XPCWrappedNative *wn = getWN(wrapper);

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

@ -260,7 +260,7 @@ struct ParamTraits<mozilla::WidgetTouchEvent>
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
{
size_t numTouches;
uint32_t numTouches;
if (!ReadParam(aMsg, aIter,
static_cast<mozilla::WidgetInputEvent*>(aResult)) ||
!ReadParam(aMsg, aIter, &numTouches)) {