Bug 414178 - Do not allow to inject a list outside of the active editing host; r=roc

This commit is contained in:
Ehsan Akhgari
2011-09-13 11:39:40 -04:00
parent 754cd327e9
commit b4731d2045
3 changed files with 30 additions and 0 deletions

View File

@@ -7335,6 +7335,13 @@ nsHTMLEditRules::SplitAsNeeded(const nsAString *aTag,
// sniffing up the parent tree until we find
// a legal place for the block
if (!parent) break;
// Don't leave the active editing host
if (!mHTMLEditor->IsNodeInActiveEditor(parent)) {
nsCOMPtr<nsIContent> parentContent = do_QueryInterface(parent);
if (parentContent != mHTMLEditor->GetActiveEditingHost()) {
break;
}
}
if (mHTMLEditor->CanContainTag(parent, *aTag))
{
tagParent = parent;