Backed out changeset aa7f507ac743 (bug 1558674) for dt failures on browser_console_context_menu_entries.js . CLOSED TREE

This commit is contained in:
Narcis Beleuzu 2019-06-14 05:57:52 +03:00
Родитель 1ad559bb39
Коммит 72a734cf98
10 изменённых файлов: 39 добавлений и 50 удалений

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

@ -46,13 +46,12 @@ add_task(async function checkMenuEntryStates() {
is(cmdUndo.getAttribute("disabled"), "true", "cmdUndo is disabled");
is(cmdDelete.getAttribute("disabled"), "true", "cmdDelete is disabled");
is(cmdSelectAll.getAttribute("disabled"), "true", "cmdSelectAll is disabled");
is(cmdCut.getAttribute("disabled"), "true", "cmdCut is disabled");
is(cmdCopy.getAttribute("disabled"), "true", "cmdCopy is disabled");
if (isWindows()) {
// emptyClipboard only works on Windows (666254), assert paste only for this OS.
is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
}
// Cut/Copy/Paste items are enabled in context menu even if there
// is no selection. See also Bug 1303033, and 1317322
is(cmdCut.getAttribute("disabled"), "", "cmdCut is enabled");
is(cmdCopy.getAttribute("disabled"), "", "cmdCopy is enabled");
is(cmdPaste.getAttribute("disabled"), "", "cmdPaste is enabled");
const onContextMenuHidden = toolbox.once("menu-close");
EventUtils.sendKey("ESCAPE", toolbox.win);

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

@ -44,12 +44,11 @@ add_task(async function() {
is(cmdDelete.getAttribute("disabled"), "true", "cmdDelete is disabled");
is(cmdSelectAll.getAttribute("disabled"), "true", "cmdSelectAll is disabled");
is(cmdCut.getAttribute("disabled"), "true", "cmdCut is disabled");
is(cmdCopy.getAttribute("disabled"), "true", "cmdCopy is disabled");
if (isWindows()) {
// emptyClipboard only works on Windows (666254), assert paste only for this OS.
is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
}
// Cut/Copy/Paste items are enabled in context menu even if there is no
// selection. See also Bug 1303033, and 1317322
is(cmdCut.getAttribute("disabled"), "", "cmdCut is enabled");
is(cmdCopy.getAttribute("disabled"), "", "cmdCopy is enabled");
is(cmdPaste.getAttribute("disabled"), "", "cmdPaste is enabled");
info("Closing context menu");
let onContextMenuClose = toolbox.once("menu-close");

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

@ -42,13 +42,12 @@ add_task(async function() {
is(cmdUndo.getAttribute("disabled"), "true", "cmdUndo is disabled");
is(cmdDelete.getAttribute("disabled"), "true", "cmdDelete is disabled");
is(cmdSelectAll.getAttribute("disabled"), "true", "cmdSelectAll is disabled");
is(cmdCut.getAttribute("disabled"), "true", "cmdCut is disabled");
is(cmdCopy.getAttribute("disabled"), "true", "cmdCopy is disabled");
if (isWindows()) {
// emptyClipboard only works on Windows (666254), assert paste only for this OS.
is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
}
// Cut/Copy/Paste items are enabled in context menu even if there is no
// selection. See also Bug 1303033, and 1317322
is(cmdCut.getAttribute("disabled"), "", "cmdCut is enabled");
is(cmdCopy.getAttribute("disabled"), "", "cmdCopy is enabled");
is(cmdPaste.getAttribute("disabled"), "", "cmdPaste is enabled");
info("Closing context menu");
let onContextMenuClose = toolbox.once("menu-close");

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

@ -39,13 +39,12 @@ add_task(async function() {
is(cmdUndo.getAttribute("disabled"), "true", "cmdUndo is disabled");
is(cmdDelete.getAttribute("disabled"), "true", "cmdDelete is disabled");
is(cmdSelectAll.getAttribute("disabled"), "true", "cmdSelectAll is disabled");
is(cmdCut.getAttribute("disabled"), "true", "cmdCut is disabled");
is(cmdCopy.getAttribute("disabled"), "true", "cmdCopy is disabled");
if (isWindows()) {
// emptyClipboard only works on Windows (666254), assert paste only for this OS.
is(cmdPaste.getAttribute("disabled"), "true", "cmdPaste is disabled");
}
// Cut/Copy items are enabled in context menu even if there
// is no selection. See also Bug 1303033, and 1317322
is(cmdCut.getAttribute("disabled"), "", "cmdCut is enabled");
is(cmdCopy.getAttribute("disabled"), "", "cmdCopy is enabled");
is(cmdPaste.getAttribute("disabled"), "", "cmdPaste is enabled");
info("Closing context menu");
let onContextMenuClose = toolbox.once("menu-close");

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

@ -113,7 +113,7 @@ function runTests() {
};
const firstShow = function() {
ok(cutItem.hasAttribute("disabled"), "cut menuitem is disabled");
ok(!cutItem.hasAttribute("disabled"), "cut menuitem is enabled");
closeMenu(firstHide);
};
@ -143,7 +143,7 @@ function runTests() {
};
const showAfterCut = function() {
ok(cutItem.hasAttribute("disabled"), "cut menuitem is disabled after cut");
ok(!cutItem.hasAttribute("disabled"), "cut menuitem is enabled after cut");
ok(!pasteItem.hasAttribute("disabled"), "paste menuitem is enabled after cut");
closeMenu(hideAfterCut);
};
@ -161,7 +161,7 @@ function runTests() {
};
const showAfterPaste = function() {
ok(cutItem.hasAttribute("disabled"), "cut menuitem is disabled after paste");
ok(!cutItem.hasAttribute("disabled"), "cut menuitem is enabled after paste");
ok(!pasteItem.hasAttribute("disabled"), "paste menuitem is enabled after paste");
closeMenu(hideAfterPaste);
};

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

@ -73,9 +73,9 @@ async function performTests() {
expectedContextMenu = [
"#editmenu-undo (editmenu-undo) [disabled]",
"#editmenu-cut (editmenu-cut) [disabled]",
"#editmenu-copy (editmenu-copy) [disabled]",
"#editmenu-paste (editmenu-paste)" + (isWindows() ? "" : " [disabled]"),
"#editmenu-cut (editmenu-cut)",
"#editmenu-copy (editmenu-copy)",
"#editmenu-paste (editmenu-paste)",
"#editmenu-delete (editmenu-delete) [disabled]",
"#editmenu-selectAll (editmenu-select-all) [disabled]",
];
@ -88,9 +88,9 @@ async function performTests() {
expectedContextMenu = [
"#editmenu-undo (editmenu-undo) [disabled]",
"#editmenu-cut (editmenu-cut) [disabled]",
"#editmenu-copy (editmenu-copy) [disabled]",
"#editmenu-paste (editmenu-paste)" + (isWindows() ? "" : " [disabled]"),
"#editmenu-cut (editmenu-cut)",
"#editmenu-copy (editmenu-copy)",
"#editmenu-paste (editmenu-paste)",
"#editmenu-delete (editmenu-delete) [disabled]",
"#editmenu-selectAll (editmenu-select-all) [disabled]",
];

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

@ -488,9 +488,9 @@ nsresult nsClipboardCommand::IsCommandEnabled(const char* aCommandName,
RefPtr<dom::Document> doc = window->GetExtantDoc();
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
if (doc->IsHTMLOrXHTML() && !nsContentUtils::IsChromeDoc(doc)) {
if (doc->IsHTMLOrXHTML()) {
// In HTML and XHTML documents, we always want the cut, copy and paste
// commands to be enabled, but if the document is chrome, let it control it.
// commands to be enabled.
*outCmdEnabled = true;
} else {
// Cut isn't enabled in xul documents which use nsClipboardCommand

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

@ -1642,11 +1642,9 @@ static const char* textHtmlEditorFlavors[] = {kUnicodeMime, kHTMLMime,
kPNGImageMime, kGIFImageMime};
bool HTMLEditor::CanPaste(int32_t aClipboardType) const {
// Always enable the paste command when inside of a HTML or XHTML document,
// but if the document is chrome, let it control it.
// Always enable the paste command when inside of a HTML or XHTML document.
Document* document = GetDocument();
if (document && document->IsHTMLOrXHTML() &&
!nsContentUtils::IsChromeDoc(document)) {
if (document && document->IsHTMLOrXHTML()) {
return true;
}

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

@ -1794,11 +1794,9 @@ bool TextEditor::CanCut() const {
return false;
}
// Cut is always enabled in HTML documents, but if the document is chrome,
// let it control it.
// Cut is always enabled in HTML documents
Document* document = GetDocument();
if (document && document->IsHTMLOrXHTML() &&
!nsContentUtils::IsChromeDoc(document)) {
if (document && document->IsHTMLOrXHTML()) {
return true;
}
@ -1825,11 +1823,9 @@ bool TextEditor::CanCopy() const {
return false;
}
// Copy is always enabled in HTML documents, but if the document is chrome,
// let it control it.
// Copy is always enabled in HTML documents
Document* document = GetDocument();
if (document && document->IsHTMLOrXHTML() &&
!nsContentUtils::IsChromeDoc(document)) {
if (document && document->IsHTMLOrXHTML()) {
return true;
}

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

@ -443,10 +443,9 @@ nsresult TextEditor::PasteTransferableAsAction(nsITransferable* aTransferable,
}
bool TextEditor::CanPaste(int32_t aClipboardType) const {
// Always enable the paste command when inside of a HTML or XHTML document,
// but if the document is chrome, let it control it.
// Always enable the paste command when inside of a HTML or XHTML document.
RefPtr<Document> doc = GetDocument();
if (doc && doc->IsHTMLOrXHTML() && !nsContentUtils::IsChromeDoc(doc)) {
if (doc && doc->IsHTMLOrXHTML()) {
return true;
}