Merge mozilla-central to mozilla-inbound

This commit is contained in:
Ed Morley 2011-12-31 13:10:25 +00:00
commit 54f757ba39
5 changed files with 25 additions and 24 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1324588296000">
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1325216886000">
<emItems>
<emItem blockID="i41" id="{99079a25-328f-4bd4-be04-00955acaa0a7}">
<versionRange minVersion="0.1" maxVersion="4.3.1.00" severity="1">
@ -116,6 +116,8 @@
<versionRange severity="3">
</versionRange>
</emItem>
<emItem blockID="i48" id="admin@youtubespeedup.com">
</emItem>
<emItem blockID="i20" id="{AB2CE124-6272-4b12-94A9-7303C7397BD1}">
<versionRange minVersion="0.1" maxVersion="5.2.0.7164" severity="1">
</versionRange>

View File

@ -121,6 +121,7 @@
#include "mozilla/Preferences.h"
#include "mozilla/dom/Element.h"
#include "nsContentUtils.h"
#include "nsCCUncollectableMarker.h"
#define NS_ERROR_EDITOR_NO_SELECTION NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_EDITOR,1)
#define NS_ERROR_EDITOR_NO_TEXTNODE NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_EDITOR,2)
@ -199,6 +200,12 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsEditor)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsEditor)
nsIDocument* currentDoc =
tmp->mRootElement ? tmp->mRootElement->GetCurrentDoc() : nsnull;
if (currentDoc &&
nsCCUncollectableMarker::InGeneration(cb, currentDoc->GetMarkedCCGeneration())) {
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mRootElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mInlineSpellChecker)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTxnMgr)

View File

@ -320,13 +320,7 @@ nsCopyCommand::IsCommandEnabled(const char * aCommandName,
NS_ENSURE_ARG_POINTER(outCmdEnabled);
nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
if (editor)
{
bool isEditable = false;
nsresult rv = editor->GetIsSelectionEditable(&isEditable);
NS_ENSURE_SUCCESS(rv, rv);
if (isEditable)
return editor->CanCopy(outCmdEnabled);
}
return editor->CanCopy(outCmdEnabled);
*outCmdEnabled = false;
return NS_OK;
@ -663,19 +657,14 @@ nsSelectAllCommand::IsCommandEnabled(const char * aCommandName,
nsresult rv = NS_OK;
*outCmdEnabled = false;
bool docIsEmpty, selectionIsEditable;
bool docIsEmpty;
// you can select all if there is an editor which is non-empty
nsCOMPtr<nsIEditor> editor = do_QueryInterface(aCommandRefCon);
if (editor) {
rv = editor->GetIsSelectionEditable(&selectionIsEditable);
rv = editor->GetDocumentIsEmpty(&docIsEmpty);
NS_ENSURE_SUCCESS(rv, rv);
if (selectionIsEditable) {
rv = editor->GetDocumentIsEmpty(&docIsEmpty);
NS_ENSURE_SUCCESS(rv, rv);
*outCmdEnabled = !docIsEmpty;
}
*outCmdEnabled = !docIsEmpty;
}
return rv;

View File

@ -32,13 +32,13 @@ SimpleTest.waitForFocus(runTests);
var gBlock1, gBlock2;
function IsCommandEnabled(command) {
function IsCommandEnabled(command, alwaysEnabled) {
var enabled;
// non-editable div: should return false
// non-editable div: should return false unless alwaysEnabled
window.getSelection().selectAllChildren(gBlock1);
enabled = document.queryCommandEnabled(command);
is(enabled, false, "'" + command + "' should not be enabled on a non-editable block.");
is(enabled, alwaysEnabled, "'" + command + "' should not be enabled on a non-editable block.");
// editable div: should return true
window.getSelection().selectAllChildren(gBlock2);
@ -67,15 +67,15 @@ function runTests() {
];
document.execCommand("styleWithCSS", false, false);
for (i = 0; i < commands.length; i++)
IsCommandEnabled(commands[i]);
IsCommandEnabled(commands[i], commands[i] == "selectAll");
document.execCommand("styleWithCSS", false, true);
for (i = 0; i < commands.length; i++)
IsCommandEnabled(commands[i]);
IsCommandEnabled(commands[i], commands[i] == "selectAll");
// Mozilla-specific stuff
commands = ["enableInlineTableEditing", "enableObjectResizing", "insertBrOnReturn"];
for (i = 0; i < commands.length; i++)
IsCommandEnabled(commands[i]);
IsCommandEnabled(commands[i], false);
// cut/copy/paste -- SpecialPowers required
SpecialPowers.setCharPref("capability.policy.policynames", "allowclipboard");
@ -84,7 +84,7 @@ function runTests() {
SpecialPowers.setCharPref("capability.policy.allowclipboard.Clipboard.paste", "allAccess");
commands = ["cut", "paste", "copy"];
for (i = 0; i < commands.length; i++) {
IsCommandEnabled(commands[i]);
IsCommandEnabled(commands[i], commands[i] == "copy");
document.execCommand(commands[i], false, false);
}
SpecialPowers.clearUserPref("capability.policy.policynames");
@ -97,7 +97,7 @@ function runTests() {
// * there's nothing to redo if we haven't undone something first
commands = ["delete", "undo", "redo"];
for (i = 0; i < commands.length; i++) {
IsCommandEnabled(commands[i]);
IsCommandEnabled(commands[i], false);
document.execCommand(commands[i], false, false);
}

View File

@ -422,6 +422,9 @@ MAKEFILES_xpcom="
"
MAKEFILES_xpfe="
xpfe/components/autocomplete/Makefile
xpfe/components/autocomplete/public/Makefile
xpfe/components/autocomplete/src/Makefile
xpfe/components/Makefile
xpfe/components/directory/Makefile
xpfe/components/windowds/Makefile