Fix for bug 237964 (Allow editable areas in browser (contentEditable)). r/sr=sicking.

git-svn-id: svn://10.0.0.236/trunk@228918 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterv%propagandism.org
2007-06-28 02:48:22 +00:00
parent 3a7754aab2
commit 9e04fca5dd
53 changed files with 1324 additions and 266 deletions

View File

@@ -73,7 +73,7 @@ nsDocShellEditorData::~nsDocShellEditorData()
nsCOMPtr<nsIDOMWindow> domWindow = do_GetInterface(mDocShell);
// This will eventually call nsDocShellEditorData::SetEditor(nsnull)
// which will call mEditorPreDestroy() and delete the editor
mEditingSession->TearDownEditorOnWindow(domWindow);
mEditingSession->TearDownEditorOnWindow(domWindow, PR_TRUE);
}
else if (mEditor) // Should never have this w/o nsEditingSession!
{
@@ -104,7 +104,8 @@ nsDocShellEditorData::MakeEditable(PRBool inWaitForUriLoad /*, PRBool inEditable
mEditor = nsnull;
}
mMakeEditable = PR_TRUE;
if (inWaitForUriLoad)
mMakeEditable = PR_TRUE;
return NS_OK;
}
@@ -191,6 +192,8 @@ nsDocShellEditorData::SetEditor(nsIEditor *inEditor)
}
mEditor = inEditor; // owning addref
if (!mEditor)
mMakeEditable = PR_FALSE;
}
return NS_OK;

View File

@@ -772,7 +772,11 @@ nsWebShell::OnLinkClick(nsIContent* aContent,
if (mFiredUnloadEvent) {
return NS_OK;
}
if (aContent->HasFlag(NODE_IS_EDITABLE)) {
return NS_OK;
}
nsCOMPtr<nsIRunnable> ev =
new OnLinkClickEvent(this, aContent, aURI, aTargetSpec,
aPostDataStream, aHeadersDataStream);
@@ -800,6 +804,10 @@ nsWebShell::OnLinkClickSync(nsIContent *aContent,
return NS_OK;
}
if (aContent->HasFlag(NODE_IS_EDITABLE)) {
return NS_OK;
}
{
// defer to an external protocol handler if necessary...
nsCOMPtr<nsIExternalProtocolService> extProtService = do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID);
@@ -895,6 +903,10 @@ nsWebShell::OnOverLink(nsIContent* aContent,
nsIURI* aURI,
const PRUnichar* aTargetSpec)
{
if (aContent->HasFlag(NODE_IS_EDITABLE)) {
return NS_OK;
}
nsCOMPtr<nsIWebBrowserChrome2> browserChrome2 = do_GetInterface(mTreeOwner);
nsresult rv = NS_ERROR_FAILURE;