зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to fx-team
This commit is contained in:
Коммит
127c034238
|
@ -0,0 +1,16 @@
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
// invoke audio-capture permission prompt
|
||||||
|
navigator.mozGetUserMedia({audio: true}, function () {}, function () {});
|
||||||
|
|
||||||
|
// invoke geolocation permission prompt
|
||||||
|
navigator.geolocation.getCurrentPosition(function (pos) {});
|
||||||
|
|
||||||
|
// invoke desktop-notification prompt
|
||||||
|
Notification.requestPermission(function (perm) {});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,7 @@
|
||||||
|
[DEFAULT]
|
||||||
|
run-if = toolkit == "gonk"
|
||||||
|
support-files =
|
||||||
|
permission_handler_chrome.js
|
||||||
|
SandboxPromptTest.html
|
||||||
|
|
||||||
|
[test_sandbox_permission.html]
|
|
@ -0,0 +1,76 @@
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
function debug(str) {
|
||||||
|
dump("CHROME PERMISSON HANDLER -- " + str + "\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
const Cc = Components.classes;
|
||||||
|
const Ci = Components.interfaces;
|
||||||
|
const Cu = Components.utils;
|
||||||
|
|
||||||
|
const { Services } = Cu.import("resource://gre/modules/Services.jsm");
|
||||||
|
|
||||||
|
let browser = Services.wm.getMostRecentWindow("navigator:browser");
|
||||||
|
let shell;
|
||||||
|
let test_counts = 0;
|
||||||
|
|
||||||
|
function loadShell() {
|
||||||
|
if (!browser) {
|
||||||
|
debug("no browser");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
shell = browser.shell;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getContentWindow() {
|
||||||
|
return shell.contentBrowser.contentWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
function addChromeEventListener(type, listener) {
|
||||||
|
let content = getContentWindow();
|
||||||
|
content.addEventListener("mozChromeEvent", function chromeListener(evt) {
|
||||||
|
if (!evt.detail || evt.detail.type !== type) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let remove = listener(evt);
|
||||||
|
if (remove) {
|
||||||
|
content.removeEventListener("mozChromeEvent", chromeListener);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkPromptEvent(prompt_evt) {
|
||||||
|
let detail = prompt_evt.detail;
|
||||||
|
|
||||||
|
if (detail.permission == "audio-capture") {
|
||||||
|
sendAsyncMessage("permission.granted", "audio-capture");
|
||||||
|
test_counts--;
|
||||||
|
} else if (detail.permission == "desktop-notification") {
|
||||||
|
sendAsyncMessage("permission.granted", "desktop-notification");
|
||||||
|
test_counts--;
|
||||||
|
} else if (detail.permission == "geolocation") {
|
||||||
|
sendAsyncMessage("permission.granted", "geolocation");
|
||||||
|
test_counts--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!test_counts) {
|
||||||
|
debug("remove prompt event listener.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loadShell()) {
|
||||||
|
addMessageListener("test.counts", function (counts) {
|
||||||
|
test_counts = counts;
|
||||||
|
});
|
||||||
|
|
||||||
|
addChromeEventListener("permission-prompt", checkPromptEvent);
|
||||||
|
}
|
|
@ -0,0 +1,78 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<!--
|
||||||
|
https://bugzilla.mozilla.org/show_bug.cgi?id=951997
|
||||||
|
-->
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Permission Prompt Test</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||||
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=951997">Permission prompt web content test</a>
|
||||||
|
<script type="application/javascript">
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
const APP_URL = "SandboxPromptTest.html";
|
||||||
|
|
||||||
|
var gUrl = SimpleTest.getTestFileURL("permission_handler_chrome.js");
|
||||||
|
var gScript = SpecialPowers.loadChromeScript(gUrl);
|
||||||
|
var gResult = [
|
||||||
|
{
|
||||||
|
type: "audio-capture",
|
||||||
|
prompt: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "geolocation",
|
||||||
|
prompt: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "desktop-notification",
|
||||||
|
prompt: false
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// Create a sanbox iframe.
|
||||||
|
function loadBrowser() {
|
||||||
|
var iframe = document.createElement("iframe");
|
||||||
|
SpecialPowers.wrap(iframe).mozbrowser = true;
|
||||||
|
iframe.src = APP_URL;
|
||||||
|
document.body.appendChild(iframe);
|
||||||
|
}
|
||||||
|
|
||||||
|
// send test counts to chrome script.
|
||||||
|
gScript.sendAsyncMessage("test.counts", gResult.length);
|
||||||
|
|
||||||
|
gScript.addMessageListener("permission.granted", function (aName) {
|
||||||
|
gResult.forEach(function(aType, aIndex) {
|
||||||
|
if (aType.type == aName) {
|
||||||
|
aType.prompt = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(gResult.every(function(aType) { return aType.prompt; })) {
|
||||||
|
ok(true, "Get all permission prompts");
|
||||||
|
gScript.destroy();
|
||||||
|
SimpleTest.finish();
|
||||||
|
}});
|
||||||
|
|
||||||
|
// Add permissions to this app. We use ALLOW_ACTION here. The ContentPermissionPrompt
|
||||||
|
// should prompt for permission, not allow it without prompt.
|
||||||
|
SpecialPowers.pushPrefEnv({"set": [["media.navigator.permission.disabled", false]]},
|
||||||
|
function() {
|
||||||
|
SpecialPowers.addPermission('audio-capture',
|
||||||
|
SpecialPowers.Ci.nsIPermissionManager.ALLOW_ACTION, document);
|
||||||
|
SpecialPowers.addPermission('geolocation',
|
||||||
|
SpecialPowers.Ci.nsIPermissionManager.ALLOW_ACTION, document);
|
||||||
|
SpecialPowers.addPermission('desktop-notification',
|
||||||
|
SpecialPowers.Ci.nsIPermissionManager.ALLOW_ACTION, document);
|
||||||
|
loadBrowser();
|
||||||
|
});
|
||||||
|
|
||||||
|
SimpleTest.waitForExplicitFinish();
|
||||||
|
</script>
|
||||||
|
</pre>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -5,3 +5,4 @@
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
|
XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
|
||||||
|
MOCHITEST_MANIFESTS += ['mochitest/mochitest.ini']
|
||||||
|
|
|
@ -442,7 +442,6 @@ nsresult WebMReader::ReadMetadata(MediaInfo* aInfo,
|
||||||
mInfo.mAudio.mRate = mOpusParser->mRate;
|
mInfo.mAudio.mRate = mOpusParser->mRate;
|
||||||
|
|
||||||
mInfo.mAudio.mChannels = mOpusParser->mChannels;
|
mInfo.mAudio.mChannels = mOpusParser->mChannels;
|
||||||
mInfo.mAudio.mChannels = mInfo.mAudio.mChannels > 2 ? 2 : mInfo.mAudio.mChannels;
|
|
||||||
mChannels = mInfo.mAudio.mChannels;
|
mChannels = mInfo.mAudio.mChannels;
|
||||||
mSeekPreroll = params.seek_preroll;
|
mSeekPreroll = params.seek_preroll;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -234,7 +234,8 @@ FMRadio::Enabled()
|
||||||
bool
|
bool
|
||||||
FMRadio::AntennaAvailable() const
|
FMRadio::AntennaAvailable() const
|
||||||
{
|
{
|
||||||
return mHasInternalAntenna ? true : mHeadphoneState != SWITCH_STATE_OFF;
|
return mHasInternalAntenna ? true : (mHeadphoneState != SWITCH_STATE_OFF) &&
|
||||||
|
(mHeadphoneState != SWITCH_STATE_UNKNOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
Nullable<double>
|
Nullable<double>
|
||||||
|
|
|
@ -289,12 +289,16 @@ void TextureClient::ForceRemove()
|
||||||
void
|
void
|
||||||
TextureClient::Finalize()
|
TextureClient::Finalize()
|
||||||
{
|
{
|
||||||
if (mActor) {
|
// Always make a temporary strong reference to the actor before we use it,
|
||||||
// this will call ForceRemove in the right thread, using a sync proxy if needed
|
// in case TextureChild::ActorDestroy might null mActor concurrently.
|
||||||
mActor->GetForwarder()->RemoveTexture(this);
|
RefPtr<TextureChild> actor = mActor;
|
||||||
|
|
||||||
// mActor has a raw pointer to us, mActor->mTextureClient. Null it before we die.
|
if (actor) {
|
||||||
mActor->mTextureClient = nullptr;
|
// this will call ForceRemove in the right thread, using a sync proxy if needed
|
||||||
|
actor->GetForwarder()->RemoveTexture(this);
|
||||||
|
|
||||||
|
// The actor has a raw pointer to us, actor->mTextureClient. Null it before we die.
|
||||||
|
actor->mTextureClient = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1708,9 +1708,9 @@ class MOZ_STACK_CLASS ModuleCompiler
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out->reset(JS_smprintf("total compilation time %dms%s%s",
|
out->reset(JS_smprintf("total compilation time %dms%s%s; ",
|
||||||
msTotal,
|
msTotal,
|
||||||
storedInCache ? "; stored in cache" : "",
|
storedInCache ? "stored in cache" : "not stored in cache",
|
||||||
slowFuns ? slowFuns.get() : ""));
|
slowFuns ? slowFuns.get() : ""));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -646,7 +646,7 @@ RegExpCompartment::~RegExpCompartment()
|
||||||
JS_ASSERT(inUse_.empty());
|
JS_ASSERT(inUse_.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
HeapPtrObject &
|
JSObject *
|
||||||
RegExpCompartment::getOrCreateMatchResultTemplateObject(JSContext *cx)
|
RegExpCompartment::getOrCreateMatchResultTemplateObject(JSContext *cx)
|
||||||
{
|
{
|
||||||
if (matchResultTemplateObject_)
|
if (matchResultTemplateObject_)
|
||||||
|
@ -712,7 +712,11 @@ RegExpCompartment::sweep(JSRuntime *rt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
matchResultTemplateObject_ = nullptr;
|
if (matchResultTemplateObject_ &&
|
||||||
|
IsObjectAboutToBeFinalized(matchResultTemplateObject_.unsafeGet()))
|
||||||
|
{
|
||||||
|
matchResultTemplateObject_ = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -323,7 +323,7 @@ class RegExpCompartment
|
||||||
* if there is a result. This is used in CreateRegExpMatchResult to set
|
* if there is a result. This is used in CreateRegExpMatchResult to set
|
||||||
* the input/index properties faster.
|
* the input/index properties faster.
|
||||||
*/
|
*/
|
||||||
HeapPtrObject matchResultTemplateObject_;
|
ReadBarriered<JSObject> matchResultTemplateObject_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RegExpCompartment(JSRuntime *rt);
|
RegExpCompartment(JSRuntime *rt);
|
||||||
|
@ -339,7 +339,7 @@ class RegExpCompartment
|
||||||
bool get(JSContext *cx, HandleAtom source, JSString *maybeOpt, RegExpGuard *g);
|
bool get(JSContext *cx, HandleAtom source, JSString *maybeOpt, RegExpGuard *g);
|
||||||
|
|
||||||
/* Get or create template object used to base the result of .exec() on. */
|
/* Get or create template object used to base the result of .exec() on. */
|
||||||
HeapPtrObject &getOrCreateMatchResultTemplateObject(JSContext *cx);
|
JSObject *getOrCreateMatchResultTemplateObject(JSContext *cx);
|
||||||
|
|
||||||
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf);
|
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf);
|
||||||
};
|
};
|
||||||
|
|
|
@ -330,7 +330,7 @@ nsXPCWrappedJS::GetNewOrUsed(JS::HandleObject jsObj,
|
||||||
JSObject2WrappedJSMap* map;
|
JSObject2WrappedJSMap* map;
|
||||||
nsXPCWrappedJS* root = nullptr;
|
nsXPCWrappedJS* root = nullptr;
|
||||||
nsXPCWrappedJS* wrapper = nullptr;
|
nsXPCWrappedJS* wrapper = nullptr;
|
||||||
nsXPCWrappedJSClass* clazz = nullptr;
|
nsRefPtr<nsXPCWrappedJSClass> clasp;
|
||||||
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
|
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
|
||||||
bool release_root = false;
|
bool release_root = false;
|
||||||
|
|
||||||
|
@ -340,49 +340,43 @@ nsXPCWrappedJS::GetNewOrUsed(JS::HandleObject jsObj,
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsXPCWrappedJSClass::GetNewOrUsed(cx, aIID, &clazz);
|
nsXPCWrappedJSClass::GetNewOrUsed(cx, aIID, getter_AddRefs(clasp));
|
||||||
if (!clazz)
|
if (!clasp)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
// from here on we need to return through 'return_wrapper'
|
|
||||||
|
|
||||||
// always find the root JSObject
|
// always find the root JSObject
|
||||||
JS::RootedObject rootJSObj(cx, clazz->GetRootJSObject(cx, jsObj));
|
JS::RootedObject rootJSObj(cx, clasp->GetRootJSObject(cx, jsObj));
|
||||||
if (!rootJSObj)
|
if (!rootJSObj)
|
||||||
goto return_wrapper;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
root = map->Find(rootJSObj);
|
root = map->Find(rootJSObj);
|
||||||
if (root) {
|
if (root) {
|
||||||
if ((nullptr != (wrapper = root->Find(aIID))) ||
|
wrapper = root->FindOrFindInherited(aIID);
|
||||||
(nullptr != (wrapper = root->FindInherited(aIID)))) {
|
if (wrapper) {
|
||||||
NS_ADDREF(wrapper);
|
NS_ADDREF(wrapper);
|
||||||
goto return_wrapper;
|
*wrapperResult = wrapper;
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if (!root) {
|
|
||||||
// build the root wrapper
|
// build the root wrapper
|
||||||
if (rootJSObj == jsObj) {
|
if (rootJSObj == jsObj) {
|
||||||
// the root will do double duty as the interface wrapper
|
// the root will do double duty as the interface wrapper
|
||||||
wrapper = root = new nsXPCWrappedJS(cx, jsObj, clazz, nullptr);
|
wrapper = root = new nsXPCWrappedJS(cx, jsObj, clasp, nullptr);
|
||||||
if (!root)
|
|
||||||
goto return_wrapper;
|
|
||||||
|
|
||||||
map->Add(cx, root);
|
map->Add(cx, root);
|
||||||
|
|
||||||
goto return_wrapper;
|
*wrapperResult = wrapper;
|
||||||
|
return NS_OK;
|
||||||
} else {
|
} else {
|
||||||
// just a root wrapper
|
// just a root wrapper
|
||||||
nsXPCWrappedJSClass* rootClazz = nullptr;
|
nsXPCWrappedJSClass* rootClasp = nullptr;
|
||||||
nsXPCWrappedJSClass::GetNewOrUsed(cx, NS_GET_IID(nsISupports),
|
nsXPCWrappedJSClass::GetNewOrUsed(cx, NS_GET_IID(nsISupports),
|
||||||
&rootClazz);
|
&rootClasp);
|
||||||
if (!rootClazz)
|
if (!rootClasp)
|
||||||
goto return_wrapper;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
root = new nsXPCWrappedJS(cx, rootJSObj, rootClazz, nullptr);
|
root = new nsXPCWrappedJS(cx, rootJSObj, rootClasp, nullptr);
|
||||||
NS_RELEASE(rootClazz);
|
NS_RELEASE(rootClasp);
|
||||||
|
|
||||||
if (!root)
|
|
||||||
goto return_wrapper;
|
|
||||||
|
|
||||||
release_root = true;
|
release_root = true;
|
||||||
|
|
||||||
|
@ -391,28 +385,15 @@ nsXPCWrappedJS::GetNewOrUsed(JS::HandleObject jsObj,
|
||||||
}
|
}
|
||||||
|
|
||||||
// at this point we have a root and may need to build the specific wrapper
|
// at this point we have a root and may need to build the specific wrapper
|
||||||
MOZ_ASSERT(root,"bad root");
|
MOZ_ASSERT(root, "bad root");
|
||||||
MOZ_ASSERT(clazz,"bad clazz");
|
MOZ_ASSERT(clasp, "bad clasp");
|
||||||
|
MOZ_ASSERT(!wrapper, "no wrapper found yet");
|
||||||
|
|
||||||
if (!wrapper) {
|
wrapper = new nsXPCWrappedJS(cx, jsObj, clasp, root);
|
||||||
wrapper = new nsXPCWrappedJS(cx, jsObj, clazz, root);
|
|
||||||
if (!wrapper)
|
|
||||||
goto return_wrapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
wrapper->mNext = root->mNext;
|
|
||||||
root->mNext = wrapper;
|
|
||||||
|
|
||||||
return_wrapper:
|
|
||||||
if (clazz)
|
|
||||||
NS_RELEASE(clazz);
|
|
||||||
|
|
||||||
if (release_root)
|
if (release_root)
|
||||||
NS_RELEASE(root);
|
NS_RELEASE(root);
|
||||||
|
|
||||||
if (!wrapper)
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
*wrapperResult = wrapper;
|
*wrapperResult = wrapper;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -424,8 +405,7 @@ nsXPCWrappedJS::nsXPCWrappedJS(JSContext* cx,
|
||||||
: mJSObj(aJSObj),
|
: mJSObj(aJSObj),
|
||||||
mClass(aClass),
|
mClass(aClass),
|
||||||
mRoot(root ? root : MOZ_THIS_IN_INITIALIZER_LIST()),
|
mRoot(root ? root : MOZ_THIS_IN_INITIALIZER_LIST()),
|
||||||
mNext(nullptr),
|
mNext(nullptr)
|
||||||
mOuter(nullptr)
|
|
||||||
{
|
{
|
||||||
InitStub(GetClass()->GetIID());
|
InitStub(GetClass()->GetIID());
|
||||||
|
|
||||||
|
@ -435,11 +415,11 @@ nsXPCWrappedJS::nsXPCWrappedJS(JSContext* cx,
|
||||||
NS_ADDREF_THIS();
|
NS_ADDREF_THIS();
|
||||||
NS_ADDREF_THIS();
|
NS_ADDREF_THIS();
|
||||||
|
|
||||||
NS_ADDREF(aClass);
|
if (!IsRootWrapper()) {
|
||||||
|
|
||||||
if (!IsRootWrapper())
|
|
||||||
NS_ADDREF(mRoot);
|
NS_ADDREF(mRoot);
|
||||||
|
mNext = mRoot->mNext;
|
||||||
|
mRoot->mNext = this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsXPCWrappedJS::~nsXPCWrappedJS()
|
nsXPCWrappedJS::~nsXPCWrappedJS()
|
||||||
|
@ -497,14 +477,13 @@ nsXPCWrappedJS::Unlink()
|
||||||
NS_RELEASE(mRoot);
|
NS_RELEASE(mRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IF_RELEASE(mClass);
|
mClass = nullptr;
|
||||||
if (mOuter) {
|
if (mOuter) {
|
||||||
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
|
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
|
||||||
if (rt->GCIsRunning()) {
|
if (rt->GCIsRunning()) {
|
||||||
nsContentUtils::DeferredFinalize(mOuter);
|
nsContentUtils::DeferredFinalize(mOuter.forget().get());
|
||||||
mOuter = nullptr;
|
|
||||||
} else {
|
} else {
|
||||||
NS_RELEASE(mOuter);
|
mOuter = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -649,7 +628,7 @@ nsXPCWrappedJS::DebugDump(int16_t depth)
|
||||||
XPC_LOG_ALWAYS(("IID number is %s", iid ? iid : "invalid"));
|
XPC_LOG_ALWAYS(("IID number is %s", iid ? iid : "invalid"));
|
||||||
if (iid)
|
if (iid)
|
||||||
NS_Free(iid);
|
NS_Free(iid);
|
||||||
XPC_LOG_ALWAYS(("nsXPCWrappedJSClass @ %x", mClass));
|
XPC_LOG_ALWAYS(("nsXPCWrappedJSClass @ %x", mClass.get()));
|
||||||
|
|
||||||
if (!IsRootWrapper())
|
if (!IsRootWrapper())
|
||||||
XPC_LOG_OUTDENT();
|
XPC_LOG_OUTDENT();
|
||||||
|
|
|
@ -614,19 +614,11 @@ nsXPCWrappedJSClass::DelegatedQueryInterface(nsXPCWrappedJS* self,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsXPCWrappedJS* sibling;
|
|
||||||
|
|
||||||
// Checks for any existing wrapper explicitly constructed for this iid.
|
// Checks for any existing wrapper explicitly constructed for this iid.
|
||||||
// This includes the current 'self' wrapper. This also deals with the
|
// This includes the current 'self' wrapper. This also deals with the
|
||||||
// nsISupports case (for which it returns mRoot).
|
// nsISupports case (for which it returns mRoot).
|
||||||
if (nullptr != (sibling = self->Find(aIID))) {
|
// Also check if asking for an interface from which one of our wrappers inherits.
|
||||||
NS_ADDREF(sibling);
|
if (nsXPCWrappedJS* sibling = self->FindOrFindInherited(aIID)) {
|
||||||
*aInstancePtr = sibling->GetXPTCStub();
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if asking for an interface from which one of our wrappers inherits.
|
|
||||||
if (nullptr != (sibling = self->FindInherited(aIID))) {
|
|
||||||
NS_ADDREF(sibling);
|
NS_ADDREF(sibling);
|
||||||
*aInstancePtr = sibling->GetXPTCStub();
|
*aInstancePtr = sibling->GetXPTCStub();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -2495,6 +2495,12 @@ public:
|
||||||
|
|
||||||
nsXPCWrappedJS* Find(REFNSIID aIID);
|
nsXPCWrappedJS* Find(REFNSIID aIID);
|
||||||
nsXPCWrappedJS* FindInherited(REFNSIID aIID);
|
nsXPCWrappedJS* FindInherited(REFNSIID aIID);
|
||||||
|
nsXPCWrappedJS* FindOrFindInherited(REFNSIID aIID) {
|
||||||
|
nsXPCWrappedJS* wrapper = Find(aIID);
|
||||||
|
if (wrapper)
|
||||||
|
return wrapper;
|
||||||
|
return FindInherited(aIID);
|
||||||
|
}
|
||||||
|
|
||||||
bool IsRootWrapper() const {return mRoot == this;}
|
bool IsRootWrapper() const {return mRoot == this;}
|
||||||
bool IsValid() const {return mJSObj != nullptr;}
|
bool IsValid() const {return mJSObj != nullptr;}
|
||||||
|
@ -2515,7 +2521,7 @@ public:
|
||||||
"Only one aggregated native can be set");
|
"Only one aggregated native can be set");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NS_ADDREF(mRoot->mOuter = aNative);
|
mRoot->mOuter = aNative;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TraceJS(JSTracer* trc);
|
void TraceJS(JSTracer* trc);
|
||||||
|
@ -2535,10 +2541,10 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
JS::Heap<JSObject*> mJSObj;
|
JS::Heap<JSObject*> mJSObj;
|
||||||
nsXPCWrappedJSClass* mClass;
|
nsRefPtr<nsXPCWrappedJSClass> mClass;
|
||||||
nsXPCWrappedJS* mRoot;
|
nsXPCWrappedJS* mRoot; // If mRoot != this, it is an owning pointer.
|
||||||
nsXPCWrappedJS* mNext;
|
nsXPCWrappedJS* mNext;
|
||||||
nsISupports* mOuter; // only set in root
|
nsCOMPtr<nsISupports> mOuter; // only set in root
|
||||||
};
|
};
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
|
@ -4779,8 +4779,7 @@ ShouldPutNextSiblingOnNewLine(nsIFrame* aLastFrame)
|
||||||
// XXX the IS_DIRTY check is a wallpaper for bug 822910.
|
// XXX the IS_DIRTY check is a wallpaper for bug 822910.
|
||||||
if (type == nsGkAtoms::textFrame &&
|
if (type == nsGkAtoms::textFrame &&
|
||||||
!(aLastFrame->GetStateBits() & NS_FRAME_IS_DIRTY)) {
|
!(aLastFrame->GetStateBits() & NS_FRAME_IS_DIRTY)) {
|
||||||
return aLastFrame->HasTerminalNewline() &&
|
return aLastFrame->HasSignificantTerminalNewline();
|
||||||
aLastFrame->StyleText()->NewlineIsSignificant();
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5984,8 +5984,7 @@ FindBlockFrameOrBR(nsIFrame* aFrame, nsDirection aDirection)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is a preformatted text frame, see if it ends with a newline
|
// If this is a preformatted text frame, see if it ends with a newline
|
||||||
if (aFrame->HasTerminalNewline() &&
|
if (aFrame->HasSignificantTerminalNewline()) {
|
||||||
aFrame->StyleText()->NewlineIsSignificant()) {
|
|
||||||
int32_t startOffset, endOffset;
|
int32_t startOffset, endOffset;
|
||||||
aFrame->GetOffsets(startOffset, endOffset);
|
aFrame->GetOffsets(startOffset, endOffset);
|
||||||
result.mContent = aFrame->GetContent();
|
result.mContent = aFrame->GetContent();
|
||||||
|
@ -6145,8 +6144,7 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos)
|
||||||
// we're placed before the linefeed character on the previous line.
|
// we're placed before the linefeed character on the previous line.
|
||||||
if (offset < 0 && jumpedLine &&
|
if (offset < 0 && jumpedLine &&
|
||||||
aPos->mDirection == eDirPrevious &&
|
aPos->mDirection == eDirPrevious &&
|
||||||
current->StyleText()->NewlineIsSignificant() &&
|
current->HasSignificantTerminalNewline()) {
|
||||||
current->HasTerminalNewline()) {
|
|
||||||
--aPos->mContentOffset;
|
--aPos->mContentOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6218,8 +6216,7 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos)
|
||||||
// If we've crossed the line boundary, check to make sure that we
|
// If we've crossed the line boundary, check to make sure that we
|
||||||
// have not consumed a trailing newline as whitesapce if it's significant.
|
// have not consumed a trailing newline as whitesapce if it's significant.
|
||||||
if (jumpedLine && wordSelectEatSpace &&
|
if (jumpedLine && wordSelectEatSpace &&
|
||||||
current->HasTerminalNewline() &&
|
current->HasSignificantTerminalNewline()) {
|
||||||
current->StyleText()->NewlineIsSignificant()) {
|
|
||||||
offsetAdjustment = -1;
|
offsetAdjustment = -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -6395,7 +6392,7 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos)
|
||||||
FrameContentRange range = GetRangeForFrame(targetFrame.frame);
|
FrameContentRange range = GetRangeForFrame(targetFrame.frame);
|
||||||
aPos->mResultContent = range.content;
|
aPos->mResultContent = range.content;
|
||||||
aPos->mContentOffset = endOfLine ? range.end : range.start;
|
aPos->mContentOffset = endOfLine ? range.end : range.start;
|
||||||
if (endOfLine && targetFrame.frame->HasTerminalNewline()) {
|
if (endOfLine && targetFrame.frame->HasSignificantTerminalNewline()) {
|
||||||
// Do not position the caret after the terminating newline if we're
|
// Do not position the caret after the terminating newline if we're
|
||||||
// trying to move to the end of line (see bug 596506)
|
// trying to move to the end of line (see bug 596506)
|
||||||
--aPos->mContentOffset;
|
--aPos->mContentOffset;
|
||||||
|
@ -7365,11 +7362,11 @@ nsIFrame::IsFocusable(int32_t *aTabIndex, bool aWithMouse)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if this text frame ends with a newline character. It
|
* @return true if this text frame ends with a newline character which is
|
||||||
* should return false if this is not a text frame.
|
* treated as preformatted. It should return false if this is not a text frame.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
nsIFrame::HasTerminalNewline() const
|
nsIFrame::HasSignificantTerminalNewline() const
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2828,7 +2828,7 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))
|
||||||
* @return true if this text frame ends with a newline character. It
|
* @return true if this text frame ends with a newline character. It
|
||||||
* should return false if this is not a text frame.
|
* should return false if this is not a text frame.
|
||||||
*/
|
*/
|
||||||
virtual bool HasTerminalNewline() const;
|
virtual bool HasSignificantTerminalNewline() const;
|
||||||
|
|
||||||
static bool AddCSSPrefSize(nsIFrame* aBox, nsSize& aSize, bool& aWidth, bool& aHeightSet);
|
static bool AddCSSPrefSize(nsIFrame* aBox, nsSize& aSize, bool& aWidth, bool& aHeightSet);
|
||||||
static bool AddCSSMinSize(nsBoxLayoutState& aState, nsIFrame* aBox,
|
static bool AddCSSMinSize(nsBoxLayoutState& aState, nsIFrame* aBox,
|
||||||
|
|
|
@ -6250,8 +6250,7 @@ nsTextFrame::GetCharacterOffsetAtFramePointInternal(nsPoint aPoint,
|
||||||
// If we're at the end of a preformatted line which has a terminating
|
// If we're at the end of a preformatted line which has a terminating
|
||||||
// linefeed, we want to reduce the offset by one to make sure that the
|
// linefeed, we want to reduce the offset by one to make sure that the
|
||||||
// selection is placed before the linefeed character.
|
// selection is placed before the linefeed character.
|
||||||
if (StyleText()->NewlineIsSignificant() &&
|
if (HasSignificantTerminalNewline()) {
|
||||||
HasTerminalNewline()) {
|
|
||||||
--selectedOffset;
|
--selectedOffset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7478,8 +7477,7 @@ nsTextFrame::SetLength(int32_t aLength, nsLineLayout* aLineLayout,
|
||||||
if (end < f->mContentOffset) {
|
if (end < f->mContentOffset) {
|
||||||
// Our frame is shrinking. Give the text to our next in flow.
|
// Our frame is shrinking. Give the text to our next in flow.
|
||||||
if (aLineLayout &&
|
if (aLineLayout &&
|
||||||
StyleText()->WhiteSpaceIsSignificant() &&
|
HasSignificantTerminalNewline() &&
|
||||||
HasTerminalNewline() &&
|
|
||||||
GetParent()->GetType() != nsGkAtoms::letterFrame &&
|
GetParent()->GetType() != nsGkAtoms::letterFrame &&
|
||||||
(aSetLengthFlags & ALLOW_FRAME_CREATION_AND_DESTRUCTION)) {
|
(aSetLengthFlags & ALLOW_FRAME_CREATION_AND_DESTRUCTION)) {
|
||||||
// Whatever text we hand to our next-in-flow will end up in a frame all of
|
// Whatever text we hand to our next-in-flow will end up in a frame all of
|
||||||
|
@ -8562,9 +8560,9 @@ nsTextFrame::AdjustOffsetsForBidi(int32_t aStart, int32_t aEnd)
|
||||||
* false if it is not a text frame.
|
* false if it is not a text frame.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
nsTextFrame::HasTerminalNewline() const
|
nsTextFrame::HasSignificantTerminalNewline() const
|
||||||
{
|
{
|
||||||
return ::HasTerminalNewline(this);
|
return ::HasTerminalNewline(this) && StyleText()->NewlineIsSignificant();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -183,11 +183,7 @@ public:
|
||||||
virtual bool IsSelfEmpty() MOZ_OVERRIDE { return IsEmpty(); }
|
virtual bool IsSelfEmpty() MOZ_OVERRIDE { return IsEmpty(); }
|
||||||
virtual nscoord GetBaseline() const MOZ_OVERRIDE;
|
virtual nscoord GetBaseline() const MOZ_OVERRIDE;
|
||||||
|
|
||||||
/**
|
virtual bool HasSignificantTerminalNewline() const MOZ_OVERRIDE;
|
||||||
* @return true if this text frame ends with a newline character. It
|
|
||||||
* should return false if this is not a text frame.
|
|
||||||
*/
|
|
||||||
virtual bool HasTerminalNewline() const MOZ_OVERRIDE;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this text frame is logically adjacent to the end of the
|
* Returns true if this text frame is logically adjacent to the end of the
|
||||||
|
|
|
@ -378,7 +378,7 @@ class Preprocessor:
|
||||||
self.out = output
|
self.out = output
|
||||||
|
|
||||||
self.do_include(input, False)
|
self.do_include(input, False)
|
||||||
self.warnUnused(input)
|
self.warnUnused(input.name)
|
||||||
|
|
||||||
if depfile:
|
if depfile:
|
||||||
mk = Makefile()
|
mk = Makefile()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"runtests": {
|
"runtests": {
|
||||||
|
"b2g": "",
|
||||||
"caps": "",
|
"caps": "",
|
||||||
"content": "",
|
"content": "",
|
||||||
"docshell": "",
|
"docshell": "",
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"runtests": {
|
"runtests": {
|
||||||
|
"b2g": "",
|
||||||
"caps": "",
|
"caps": "",
|
||||||
"content": "",
|
"content": "",
|
||||||
"docshell": "",
|
"docshell": "",
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"runtests": {
|
"runtests": {
|
||||||
|
"b2g": "",
|
||||||
"caps": "",
|
"caps": "",
|
||||||
"content": "",
|
"content": "",
|
||||||
"docshell": "",
|
"docshell": "",
|
||||||
|
|
|
@ -930,12 +930,12 @@ GfxInfo::GetGfxDriverInfo()
|
||||||
|
|
||||||
// StrechRect seems to suffer from precision issues which leads to artifacting
|
// StrechRect seems to suffer from precision issues which leads to artifacting
|
||||||
// during content drawing starting with at least version 6.14.10.5082
|
// during content drawing starting with at least version 6.14.10.5082
|
||||||
// and going until 6.14.10.5160. See bug 919454 for more info.
|
// and going until 6.14.10.5218. See bug 919454 and bug 949275 for more info.
|
||||||
APPEND_TO_DRIVER_BLOCKLIST_RANGE(DRIVER_OS_WINDOWS_XP,
|
APPEND_TO_DRIVER_BLOCKLIST_RANGE(DRIVER_OS_WINDOWS_XP,
|
||||||
const_cast<nsAString&>(GfxDriverInfo::GetDeviceVendor(VendorIntel)),
|
const_cast<nsAString&>(GfxDriverInfo::GetDeviceVendor(VendorIntel)),
|
||||||
const_cast<GfxDeviceFamily*>(GfxDriverInfo::GetDeviceFamily(IntelGMAX4500HD)),
|
const_cast<GfxDeviceFamily*>(GfxDriverInfo::GetDeviceFamily(IntelGMAX4500HD)),
|
||||||
GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
|
GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
|
||||||
DRIVER_BETWEEN_EXCLUSIVE, V(6,14,10,5076), V(6,14,10,5160), "6.14.10.5160");
|
DRIVER_BETWEEN_EXCLUSIVE, V(6,14,10,5076), V(6,14,10,5218), "6.14.10.5218");
|
||||||
|
|
||||||
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(DRIVER_OS_WINDOWS_VISTA, IntelGMA500, V(3,0,20,3200));
|
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(DRIVER_OS_WINDOWS_VISTA, IntelGMA500, V(3,0,20,3200));
|
||||||
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(DRIVER_OS_WINDOWS_VISTA, IntelGMA900, GfxDriverInfo::allDriverVersions);
|
IMPLEMENT_INTEL_DRIVER_BLOCKLIST(DRIVER_OS_WINDOWS_VISTA, IntelGMA900, GfxDriverInfo::allDriverVersions);
|
||||||
|
|
|
@ -21,6 +21,7 @@ LOCAL_INCLUDES += [
|
||||||
'/dom/base',
|
'/dom/base',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
FAIL_ON_WARNINGS = True
|
||||||
MSVC_ENABLE_PGO = True
|
MSVC_ENABLE_PGO = True
|
||||||
|
|
||||||
FINAL_LIBRARY = 'xul'
|
FINAL_LIBRARY = 'xul'
|
||||||
|
|
|
@ -69,6 +69,7 @@
|
||||||
|
|
||||||
#include "nsIMarkupDocumentViewer.h"
|
#include "nsIMarkupDocumentViewer.h"
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
|
#include "mozilla/DebugOnly.h"
|
||||||
#include "mozilla/MouseEvents.h"
|
#include "mozilla/MouseEvents.h"
|
||||||
|
|
||||||
#ifdef XP_MACOSX
|
#ifdef XP_MACOSX
|
||||||
|
@ -90,7 +91,6 @@ nsWebShellWindow::nsWebShellWindow(uint32_t aChromeFlags)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nsWebShellWindow::~nsWebShellWindow()
|
nsWebShellWindow::~nsWebShellWindow()
|
||||||
{
|
{
|
||||||
MutexAutoLock lock(mSPTimerLock);
|
MutexAutoLock lock(mSPTimerLock);
|
||||||
|
@ -300,7 +300,7 @@ nsWebShellWindow::RequestWindowClose(nsIWidget* aWidget)
|
||||||
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||||
|
|
||||||
if (!presShell) {
|
if (!presShell) {
|
||||||
bool dying;
|
mozilla::DebugOnly<bool> dying;
|
||||||
MOZ_ASSERT(NS_SUCCEEDED(mDocShell->IsBeingDestroyed(&dying)) && dying,
|
MOZ_ASSERT(NS_SUCCEEDED(mDocShell->IsBeingDestroyed(&dying)) && dying,
|
||||||
"No presShell, but window is not being destroyed");
|
"No presShell, but window is not being destroyed");
|
||||||
} else if (eventTarget) {
|
} else if (eventTarget) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче