mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge m-c to fx-team
This commit is contained in:
commit
dba3f19a06
16
b2g/components/test/mochitest/SandboxPromptTest.html
Normal file
16
b2g/components/test/mochitest/SandboxPromptTest.html
Normal file
@ -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>
|
7
b2g/components/test/mochitest/mochitest.ini
Normal file
7
b2g/components/test/mochitest/mochitest.ini
Normal file
@ -0,0 +1,7 @@
|
||||
[DEFAULT]
|
||||
run-if = toolkit == "gonk"
|
||||
support-files =
|
||||
permission_handler_chrome.js
|
||||
SandboxPromptTest.html
|
||||
|
||||
[test_sandbox_permission.html]
|
76
b2g/components/test/mochitest/permission_handler_chrome.js
Normal file
76
b2g/components/test/mochitest/permission_handler_chrome.js
Normal file
@ -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);
|
||||
}
|
78
b2g/components/test/mochitest/test_sandbox_permission.html
Normal file
78
b2g/components/test/mochitest/test_sandbox_permission.html
Normal file
@ -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/.
|
||||
|
||||
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.mChannels = mOpusParser->mChannels;
|
||||
mInfo.mAudio.mChannels = mInfo.mAudio.mChannels > 2 ? 2 : mInfo.mAudio.mChannels;
|
||||
mChannels = mInfo.mAudio.mChannels;
|
||||
mSeekPreroll = params.seek_preroll;
|
||||
#endif
|
||||
|
@ -234,7 +234,8 @@ FMRadio::Enabled()
|
||||
bool
|
||||
FMRadio::AntennaAvailable() const
|
||||
{
|
||||
return mHasInternalAntenna ? true : mHeadphoneState != SWITCH_STATE_OFF;
|
||||
return mHasInternalAntenna ? true : (mHeadphoneState != SWITCH_STATE_OFF) &&
|
||||
(mHeadphoneState != SWITCH_STATE_UNKNOWN);
|
||||
}
|
||||
|
||||
Nullable<double>
|
||||
|
@ -289,12 +289,16 @@ void TextureClient::ForceRemove()
|
||||
void
|
||||
TextureClient::Finalize()
|
||||
{
|
||||
if (mActor) {
|
||||
// this will call ForceRemove in the right thread, using a sync proxy if needed
|
||||
mActor->GetForwarder()->RemoveTexture(this);
|
||||
// Always make a temporary strong reference to the actor before we use it,
|
||||
// in case TextureChild::ActorDestroy might null mActor concurrently.
|
||||
RefPtr<TextureChild> actor = mActor;
|
||||
|
||||
// mActor has a raw pointer to us, mActor->mTextureClient. Null it before we die.
|
||||
mActor->mTextureClient = nullptr;
|
||||
if (actor) {
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
out->reset(JS_smprintf("total compilation time %dms%s%s",
|
||||
out->reset(JS_smprintf("total compilation time %dms%s%s; ",
|
||||
msTotal,
|
||||
storedInCache ? "; stored in cache" : "",
|
||||
storedInCache ? "stored in cache" : "not stored in cache",
|
||||
slowFuns ? slowFuns.get() : ""));
|
||||
#endif
|
||||
}
|
||||
|
@ -646,7 +646,7 @@ RegExpCompartment::~RegExpCompartment()
|
||||
JS_ASSERT(inUse_.empty());
|
||||
}
|
||||
|
||||
HeapPtrObject &
|
||||
JSObject *
|
||||
RegExpCompartment::getOrCreateMatchResultTemplateObject(JSContext *cx)
|
||||
{
|
||||
if (matchResultTemplateObject_)
|
||||
@ -712,7 +712,11 @@ RegExpCompartment::sweep(JSRuntime *rt)
|
||||
}
|
||||
}
|
||||
|
||||
matchResultTemplateObject_ = nullptr;
|
||||
if (matchResultTemplateObject_ &&
|
||||
IsObjectAboutToBeFinalized(matchResultTemplateObject_.unsafeGet()))
|
||||
{
|
||||
matchResultTemplateObject_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -323,7 +323,7 @@ class RegExpCompartment
|
||||
* if there is a result. This is used in CreateRegExpMatchResult to set
|
||||
* the input/index properties faster.
|
||||
*/
|
||||
HeapPtrObject matchResultTemplateObject_;
|
||||
ReadBarriered<JSObject> matchResultTemplateObject_;
|
||||
|
||||
public:
|
||||
RegExpCompartment(JSRuntime *rt);
|
||||
@ -339,7 +339,7 @@ class RegExpCompartment
|
||||
bool get(JSContext *cx, HandleAtom source, JSString *maybeOpt, RegExpGuard *g);
|
||||
|
||||
/* 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);
|
||||
};
|
||||
|
@ -330,7 +330,7 @@ nsXPCWrappedJS::GetNewOrUsed(JS::HandleObject jsObj,
|
||||
JSObject2WrappedJSMap* map;
|
||||
nsXPCWrappedJS* root = nullptr;
|
||||
nsXPCWrappedJS* wrapper = nullptr;
|
||||
nsXPCWrappedJSClass* clazz = nullptr;
|
||||
nsRefPtr<nsXPCWrappedJSClass> clasp;
|
||||
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
|
||||
bool release_root = false;
|
||||
|
||||
@ -340,49 +340,43 @@ nsXPCWrappedJS::GetNewOrUsed(JS::HandleObject jsObj,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsXPCWrappedJSClass::GetNewOrUsed(cx, aIID, &clazz);
|
||||
if (!clazz)
|
||||
nsXPCWrappedJSClass::GetNewOrUsed(cx, aIID, getter_AddRefs(clasp));
|
||||
if (!clasp)
|
||||
return NS_ERROR_FAILURE;
|
||||
// from here on we need to return through 'return_wrapper'
|
||||
|
||||
// always find the root JSObject
|
||||
JS::RootedObject rootJSObj(cx, clazz->GetRootJSObject(cx, jsObj));
|
||||
JS::RootedObject rootJSObj(cx, clasp->GetRootJSObject(cx, jsObj));
|
||||
if (!rootJSObj)
|
||||
goto return_wrapper;
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
root = map->Find(rootJSObj);
|
||||
if (root) {
|
||||
if ((nullptr != (wrapper = root->Find(aIID))) ||
|
||||
(nullptr != (wrapper = root->FindInherited(aIID)))) {
|
||||
wrapper = root->FindOrFindInherited(aIID);
|
||||
if (wrapper) {
|
||||
NS_ADDREF(wrapper);
|
||||
goto return_wrapper;
|
||||
*wrapperResult = wrapper;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
if (!root) {
|
||||
} else {
|
||||
// build the root wrapper
|
||||
if (rootJSObj == jsObj) {
|
||||
// the root will do double duty as the interface wrapper
|
||||
wrapper = root = new nsXPCWrappedJS(cx, jsObj, clazz, nullptr);
|
||||
if (!root)
|
||||
goto return_wrapper;
|
||||
wrapper = root = new nsXPCWrappedJS(cx, jsObj, clasp, nullptr);
|
||||
|
||||
map->Add(cx, root);
|
||||
|
||||
goto return_wrapper;
|
||||
*wrapperResult = wrapper;
|
||||
return NS_OK;
|
||||
} else {
|
||||
// just a root wrapper
|
||||
nsXPCWrappedJSClass* rootClazz = nullptr;
|
||||
nsXPCWrappedJSClass* rootClasp = nullptr;
|
||||
nsXPCWrappedJSClass::GetNewOrUsed(cx, NS_GET_IID(nsISupports),
|
||||
&rootClazz);
|
||||
if (!rootClazz)
|
||||
goto return_wrapper;
|
||||
&rootClasp);
|
||||
if (!rootClasp)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
root = new nsXPCWrappedJS(cx, rootJSObj, rootClazz, nullptr);
|
||||
NS_RELEASE(rootClazz);
|
||||
|
||||
if (!root)
|
||||
goto return_wrapper;
|
||||
root = new nsXPCWrappedJS(cx, rootJSObj, rootClasp, nullptr);
|
||||
NS_RELEASE(rootClasp);
|
||||
|
||||
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
|
||||
MOZ_ASSERT(root,"bad root");
|
||||
MOZ_ASSERT(clazz,"bad clazz");
|
||||
MOZ_ASSERT(root, "bad root");
|
||||
MOZ_ASSERT(clasp, "bad clasp");
|
||||
MOZ_ASSERT(!wrapper, "no wrapper found yet");
|
||||
|
||||
if (!wrapper) {
|
||||
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);
|
||||
wrapper = new nsXPCWrappedJS(cx, jsObj, clasp, root);
|
||||
|
||||
if (release_root)
|
||||
NS_RELEASE(root);
|
||||
|
||||
if (!wrapper)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
*wrapperResult = wrapper;
|
||||
return NS_OK;
|
||||
}
|
||||
@ -424,8 +405,7 @@ nsXPCWrappedJS::nsXPCWrappedJS(JSContext* cx,
|
||||
: mJSObj(aJSObj),
|
||||
mClass(aClass),
|
||||
mRoot(root ? root : MOZ_THIS_IN_INITIALIZER_LIST()),
|
||||
mNext(nullptr),
|
||||
mOuter(nullptr)
|
||||
mNext(nullptr)
|
||||
{
|
||||
InitStub(GetClass()->GetIID());
|
||||
|
||||
@ -435,11 +415,11 @@ nsXPCWrappedJS::nsXPCWrappedJS(JSContext* cx,
|
||||
NS_ADDREF_THIS();
|
||||
NS_ADDREF_THIS();
|
||||
|
||||
NS_ADDREF(aClass);
|
||||
|
||||
if (!IsRootWrapper())
|
||||
if (!IsRootWrapper()) {
|
||||
NS_ADDREF(mRoot);
|
||||
|
||||
mNext = mRoot->mNext;
|
||||
mRoot->mNext = this;
|
||||
}
|
||||
}
|
||||
|
||||
nsXPCWrappedJS::~nsXPCWrappedJS()
|
||||
@ -497,14 +477,13 @@ nsXPCWrappedJS::Unlink()
|
||||
NS_RELEASE(mRoot);
|
||||
}
|
||||
|
||||
NS_IF_RELEASE(mClass);
|
||||
mClass = nullptr;
|
||||
if (mOuter) {
|
||||
XPCJSRuntime* rt = nsXPConnect::GetRuntimeInstance();
|
||||
if (rt->GCIsRunning()) {
|
||||
nsContentUtils::DeferredFinalize(mOuter);
|
||||
mOuter = nullptr;
|
||||
nsContentUtils::DeferredFinalize(mOuter.forget().get());
|
||||
} 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"));
|
||||
if (iid)
|
||||
NS_Free(iid);
|
||||
XPC_LOG_ALWAYS(("nsXPCWrappedJSClass @ %x", mClass));
|
||||
XPC_LOG_ALWAYS(("nsXPCWrappedJSClass @ %x", mClass.get()));
|
||||
|
||||
if (!IsRootWrapper())
|
||||
XPC_LOG_OUTDENT();
|
||||
|
@ -614,19 +614,11 @@ nsXPCWrappedJSClass::DelegatedQueryInterface(nsXPCWrappedJS* self,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsXPCWrappedJS* sibling;
|
||||
|
||||
// Checks for any existing wrapper explicitly constructed for this iid.
|
||||
// This includes the current 'self' wrapper. This also deals with the
|
||||
// nsISupports case (for which it returns mRoot).
|
||||
if (nullptr != (sibling = self->Find(aIID))) {
|
||||
NS_ADDREF(sibling);
|
||||
*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))) {
|
||||
// Also check if asking for an interface from which one of our wrappers inherits.
|
||||
if (nsXPCWrappedJS* sibling = self->FindOrFindInherited(aIID)) {
|
||||
NS_ADDREF(sibling);
|
||||
*aInstancePtr = sibling->GetXPTCStub();
|
||||
return NS_OK;
|
||||
|
@ -2495,6 +2495,12 @@ public:
|
||||
|
||||
nsXPCWrappedJS* Find(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 IsValid() const {return mJSObj != nullptr;}
|
||||
@ -2515,7 +2521,7 @@ public:
|
||||
"Only one aggregated native can be set");
|
||||
return;
|
||||
}
|
||||
NS_ADDREF(mRoot->mOuter = aNative);
|
||||
mRoot->mOuter = aNative;
|
||||
}
|
||||
|
||||
void TraceJS(JSTracer* trc);
|
||||
@ -2535,10 +2541,10 @@ protected:
|
||||
|
||||
private:
|
||||
JS::Heap<JSObject*> mJSObj;
|
||||
nsXPCWrappedJSClass* mClass;
|
||||
nsXPCWrappedJS* mRoot;
|
||||
nsRefPtr<nsXPCWrappedJSClass> mClass;
|
||||
nsXPCWrappedJS* mRoot; // If mRoot != this, it is an owning pointer.
|
||||
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.
|
||||
if (type == nsGkAtoms::textFrame &&
|
||||
!(aLastFrame->GetStateBits() & NS_FRAME_IS_DIRTY)) {
|
||||
return aLastFrame->HasTerminalNewline() &&
|
||||
aLastFrame->StyleText()->NewlineIsSignificant();
|
||||
return aLastFrame->HasSignificantTerminalNewline();
|
||||
}
|
||||
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 (aFrame->HasTerminalNewline() &&
|
||||
aFrame->StyleText()->NewlineIsSignificant()) {
|
||||
if (aFrame->HasSignificantTerminalNewline()) {
|
||||
int32_t startOffset, endOffset;
|
||||
aFrame->GetOffsets(startOffset, endOffset);
|
||||
result.mContent = aFrame->GetContent();
|
||||
@ -6145,8 +6144,7 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos)
|
||||
// we're placed before the linefeed character on the previous line.
|
||||
if (offset < 0 && jumpedLine &&
|
||||
aPos->mDirection == eDirPrevious &&
|
||||
current->StyleText()->NewlineIsSignificant() &&
|
||||
current->HasTerminalNewline()) {
|
||||
current->HasSignificantTerminalNewline()) {
|
||||
--aPos->mContentOffset;
|
||||
}
|
||||
|
||||
@ -6218,8 +6216,7 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos)
|
||||
// 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.
|
||||
if (jumpedLine && wordSelectEatSpace &&
|
||||
current->HasTerminalNewline() &&
|
||||
current->StyleText()->NewlineIsSignificant()) {
|
||||
current->HasSignificantTerminalNewline()) {
|
||||
offsetAdjustment = -1;
|
||||
}
|
||||
} else {
|
||||
@ -6395,7 +6392,7 @@ nsIFrame::PeekOffset(nsPeekOffsetStruct* aPos)
|
||||
FrameContentRange range = GetRangeForFrame(targetFrame.frame);
|
||||
aPos->mResultContent = range.content;
|
||||
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
|
||||
// trying to move to the end of line (see bug 596506)
|
||||
--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
|
||||
* should return false if this is not a text frame.
|
||||
* @return true if this text frame ends with a newline character which is
|
||||
* treated as preformatted. It should return false if this is not a text frame.
|
||||
*/
|
||||
bool
|
||||
nsIFrame::HasTerminalNewline() const
|
||||
nsIFrame::HasSignificantTerminalNewline() const
|
||||
{
|
||||
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
|
||||
* 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 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
|
||||
// linefeed, we want to reduce the offset by one to make sure that the
|
||||
// selection is placed before the linefeed character.
|
||||
if (StyleText()->NewlineIsSignificant() &&
|
||||
HasTerminalNewline()) {
|
||||
if (HasSignificantTerminalNewline()) {
|
||||
--selectedOffset;
|
||||
}
|
||||
}
|
||||
@ -7478,8 +7477,7 @@ nsTextFrame::SetLength(int32_t aLength, nsLineLayout* aLineLayout,
|
||||
if (end < f->mContentOffset) {
|
||||
// Our frame is shrinking. Give the text to our next in flow.
|
||||
if (aLineLayout &&
|
||||
StyleText()->WhiteSpaceIsSignificant() &&
|
||||
HasTerminalNewline() &&
|
||||
HasSignificantTerminalNewline() &&
|
||||
GetParent()->GetType() != nsGkAtoms::letterFrame &&
|
||||
(aSetLengthFlags & ALLOW_FRAME_CREATION_AND_DESTRUCTION)) {
|
||||
// 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.
|
||||
*/
|
||||
bool
|
||||
nsTextFrame::HasTerminalNewline() const
|
||||
nsTextFrame::HasSignificantTerminalNewline() const
|
||||
{
|
||||
return ::HasTerminalNewline(this);
|
||||
return ::HasTerminalNewline(this) && StyleText()->NewlineIsSignificant();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -183,11 +183,7 @@ public:
|
||||
virtual bool IsSelfEmpty() MOZ_OVERRIDE { return IsEmpty(); }
|
||||
virtual nscoord GetBaseline() 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;
|
||||
virtual bool HasSignificantTerminalNewline() const MOZ_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Returns true if this text frame is logically adjacent to the end of the
|
||||
|
@ -378,7 +378,7 @@ class Preprocessor:
|
||||
self.out = output
|
||||
|
||||
self.do_include(input, False)
|
||||
self.warnUnused(input)
|
||||
self.warnUnused(input.name)
|
||||
|
||||
if depfile:
|
||||
mk = Makefile()
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"runtests": {
|
||||
"b2g": "",
|
||||
"caps": "",
|
||||
"content": "",
|
||||
"docshell": "",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"runtests": {
|
||||
"b2g": "",
|
||||
"caps": "",
|
||||
"content": "",
|
||||
"docshell": "",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"runtests": {
|
||||
"b2g": "",
|
||||
"caps": "",
|
||||
"content": "",
|
||||
"docshell": "",
|
||||
|
@ -930,12 +930,12 @@ GfxInfo::GetGfxDriverInfo()
|
||||
|
||||
// StrechRect seems to suffer from precision issues which leads to artifacting
|
||||
// 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,
|
||||
const_cast<nsAString&>(GfxDriverInfo::GetDeviceVendor(VendorIntel)),
|
||||
const_cast<GfxDeviceFamily*>(GfxDriverInfo::GetDeviceFamily(IntelGMAX4500HD)),
|
||||
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, IntelGMA900, GfxDriverInfo::allDriverVersions);
|
||||
|
@ -21,6 +21,7 @@ LOCAL_INCLUDES += [
|
||||
'/dom/base',
|
||||
]
|
||||
|
||||
FAIL_ON_WARNINGS = True
|
||||
MSVC_ENABLE_PGO = True
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
@ -69,6 +69,7 @@
|
||||
|
||||
#include "nsIMarkupDocumentViewer.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
@ -90,7 +91,6 @@ nsWebShellWindow::nsWebShellWindow(uint32_t aChromeFlags)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
nsWebShellWindow::~nsWebShellWindow()
|
||||
{
|
||||
MutexAutoLock lock(mSPTimerLock);
|
||||
@ -300,7 +300,7 @@ nsWebShellWindow::RequestWindowClose(nsIWidget* aWidget)
|
||||
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||
|
||||
if (!presShell) {
|
||||
bool dying;
|
||||
mozilla::DebugOnly<bool> dying;
|
||||
MOZ_ASSERT(NS_SUCCEEDED(mDocShell->IsBeingDestroyed(&dying)) && dying,
|
||||
"No presShell, but window is not being destroyed");
|
||||
} else if (eventTarget) {
|
||||
|
Loading…
Reference in New Issue
Block a user