зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1489793) for failures in editor/spellchecker/tests/test_bug1219928.html
Backed out changeset 9d793ccd3fca (bug 1489793) Backed out changeset 30219dab424e (bug 1489793)
This commit is contained in:
Родитель
796d3191af
Коммит
53d4f9c065
|
@ -16,6 +16,7 @@ XPIDL_MODULE = 'composer'
|
|||
|
||||
UNIFIED_SOURCES += [
|
||||
'ComposerCommandsUpdater.cpp',
|
||||
'nsComposerRegistration.cpp',
|
||||
'nsEditingSession.cpp',
|
||||
]
|
||||
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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/. */
|
||||
|
||||
#include "mozilla/EditorSpellCheck.h" // for NS_EDITORSPELLCHECK_CID, etc
|
||||
#include "mozilla/HTMLEditorController.h" // for HTMLEditorController, etc
|
||||
#include "mozilla/Module.h" // for Module, Module::CIDEntry, etc
|
||||
#include "mozilla/ModuleUtils.h"
|
||||
#include "mozilla/mozalloc.h" // for operator new
|
||||
#include "nsCOMPtr.h" // for nsCOMPtr, getter_AddRefs, etc
|
||||
#include "nsBaseCommandController.h" // for nsBaseCommandController
|
||||
#include "nsComponentManagerUtils.h" // for do_CreateInstance
|
||||
#include "nsDebug.h" // for NS_ENSURE_SUCCESS
|
||||
#include "nsError.h" // for NS_ERROR_NO_AGGREGATION, etc
|
||||
#include "nsIController.h" // for nsIController
|
||||
#include "nsIControllerContext.h" // for nsIControllerContext
|
||||
#include "nsID.h" // for NS_DEFINE_NAMED_CID, etc
|
||||
#include "nsISupportsImpl.h"
|
||||
#include "nsISupportsUtils.h" // for NS_ADDREF, NS_RELEASE
|
||||
#include "nsControllerCommandTable.h" // for nsControllerCommandTable, etc
|
||||
#include "nsServiceManagerUtils.h" // for do_GetService
|
||||
#include "nscore.h" // for nsresult
|
||||
|
||||
using mozilla::EditorSpellCheck;
|
||||
|
||||
class nsISupports;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Define the contructor function for the objects
|
||||
//
|
||||
// NOTE: This creates an instance of objects by using the default constructor
|
||||
//
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(EditorSpellCheck)
|
||||
|
||||
NS_DEFINE_NAMED_CID(NS_EDITORSPELLCHECK_CID);
|
||||
|
||||
static const mozilla::Module::CIDEntry kComposerCIDs[] = {
|
||||
{ &kNS_EDITORSPELLCHECK_CID, false, nullptr, EditorSpellCheckConstructor },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
static const mozilla::Module::ContractIDEntry kComposerContracts[] = {
|
||||
{ "@mozilla.org/editor/editorspellchecker;1", &kNS_EDITORSPELLCHECK_CID },
|
||||
{ nullptr }
|
||||
};
|
||||
|
||||
static const mozilla::Module kComposerModule = {
|
||||
mozilla::Module::kVersion,
|
||||
kComposerCIDs,
|
||||
kComposerContracts
|
||||
};
|
||||
|
||||
NSMODULE_DEFN(nsComposerModule) = &kComposerModule;
|
|
@ -21,7 +21,9 @@ SimpleTest.waitForFocus(() => {
|
|||
let textarea = document.getElementById("textarea");
|
||||
let editor = SpecialPowers.wrap(textarea).editor;
|
||||
|
||||
let spellChecker = SpecialPowers.Cu.createSpellChecker();
|
||||
let spellChecker =
|
||||
SpecialPowers.Cc['@mozilla.org/editor/editorspellchecker;1']
|
||||
.createInstance(SpecialPowers.Ci.nsIEditorSpellCheck);
|
||||
spellChecker.InitSpellChecker(editor, false);
|
||||
|
||||
textarea.focus();
|
||||
|
|
|
@ -19,6 +19,12 @@ class mozSpellChecker;
|
|||
class nsIEditor;
|
||||
class nsISpellChecker;
|
||||
|
||||
#define NS_EDITORSPELLCHECK_CID \
|
||||
{ /* {75656ad9-bd13-4c5d-939a-ec6351eea0cc} */ \
|
||||
0x75656ad9, 0xbd13, 0x4c5d, \
|
||||
{ 0x93, 0x9a, 0xec, 0x63, 0x51, 0xee, 0xa0, 0xcc }\
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class DictionaryFetcher;
|
||||
|
|
|
@ -44,7 +44,8 @@ SimpleTest.waitForFocus(function() {
|
|||
|
||||
is(sel.toString(), "missspelled", "one misspelled word expected: missspelled");
|
||||
|
||||
let spellChecker = SpecialPowers.Cu.createSpellChecker();
|
||||
spellchecker = SpecialPowers.Cc['@mozilla.org/editor/editorspellchecker;1']
|
||||
.createInstance(Ci.nsIEditorSpellCheck);
|
||||
spellchecker.setFilterType(spellchecker.FILTERTYPE_NORMAL);
|
||||
spellchecker.InitSpellChecker(editor, false, spellCheckStarted);
|
||||
});
|
||||
|
|
|
@ -21,7 +21,9 @@ SimpleTest.waitForExplicitFinish();
|
|||
SimpleTest.waitForFocus(() => {
|
||||
let textarea = document.getElementById("editor");
|
||||
let editor = SpecialPowers.wrap(textarea).editor;
|
||||
let spellChecker = SpecialPowers.Cu.createSpellChecker();
|
||||
let spellChecker =
|
||||
SpecialPowers.Cc['@mozilla.org/editor/editorspellchecker;1']
|
||||
.createInstance(SpecialPowers.Ci.nsIEditorSpellCheck);
|
||||
|
||||
// Callback parameter isn't set
|
||||
spellChecker.InitSpellChecker(editor, false);
|
||||
|
|
|
@ -667,13 +667,16 @@ nsresult mozInlineSpellChecker::Cleanup(bool aDestroyingFrames)
|
|||
bool // static
|
||||
mozInlineSpellChecker::CanEnableInlineSpellChecking()
|
||||
{
|
||||
nsresult rv;
|
||||
if (gCanEnableSpellChecking == SpellCheck_Uninitialized) {
|
||||
gCanEnableSpellChecking = SpellCheck_NotAvailable;
|
||||
|
||||
nsCOMPtr<nsIEditorSpellCheck> spellchecker = new EditorSpellCheck();
|
||||
nsCOMPtr<nsIEditorSpellCheck> spellchecker =
|
||||
do_CreateInstance("@mozilla.org/editor/editorspellchecker;1", &rv);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
bool canSpellCheck = false;
|
||||
nsresult rv = spellchecker->CanSpellCheck(&canSpellCheck);
|
||||
rv = spellchecker->CanSpellCheck(&canSpellCheck);
|
||||
NS_ENSURE_SUCCESS(rv, false);
|
||||
|
||||
if (canSpellCheck)
|
||||
|
|
|
@ -13,7 +13,6 @@ interface xpcIJSWeakReference;
|
|||
interface nsIClassInfo;
|
||||
interface nsIComponentManager;
|
||||
interface nsICycleCollectorListener;
|
||||
interface nsIEditorSpellCheck;
|
||||
interface nsIFile;
|
||||
interface nsIURI;
|
||||
interface nsIJSCID;
|
||||
|
@ -717,9 +716,6 @@ interface nsIXPCComponents_Utils : nsISupports
|
|||
|
||||
/* Give a directive to the record/replay system. */
|
||||
void recordReplayDirective(in long directive);
|
||||
|
||||
/* Create a spellchecker object. */
|
||||
nsIEditorSpellCheck createSpellChecker();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsGlobalWindow.h"
|
||||
#include "nsScriptError.h"
|
||||
#include "GeckoProfiler.h"
|
||||
#include "mozilla/EditorSpellCheck.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace JS;
|
||||
|
@ -3118,16 +3117,6 @@ nsXPCComponents_Utils::RecordReplayDirective(int aDirective)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXPCComponents_Utils::CreateSpellChecker(nsIEditorSpellCheck** aSpellChecker)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSpellChecker);
|
||||
nsCOMPtr<nsIEditorSpellCheck> spellChecker =
|
||||
new mozilla::EditorSpellCheck();
|
||||
spellChecker.forget(aSpellChecker);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
/***************************************************************************/
|
||||
|
|
Загрузка…
Ссылка в новой задаче