зеркало из https://github.com/mozilla/gecko-dev.git
Bug 611182 - Part 6: Actually allow the bogus node to be deleted from the document, and check if the parent is modifiable when inserting an element to prevent a bogus node being inserted under a contenteditable="false" element; r=bzbarsky a=blocking-beta8+
This fixes a failure in layout/reftests/bugs/579985-1.html, and is tested by it.
This commit is contained in:
Родитель
8fffaa6706
Коммит
b713ae82bc
|
@ -3794,7 +3794,7 @@ nsHTMLEditor::GetEmbeddedObjects(nsISupportsArray** aNodeList)
|
|||
NS_IMETHODIMP nsHTMLEditor::DeleteNode(nsIDOMNode * aNode)
|
||||
{
|
||||
// do nothing if the node is read-only
|
||||
if (!IsModifiableNode(aNode)) {
|
||||
if (!IsModifiableNode(aNode) && !IsMozEditorBogusNode(aNode)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1136,7 +1136,8 @@ nsTextEditRules::CreateBogusNodeIfNeeded(nsISelection *aSelection)
|
|||
bodyChild->GetNextSibling(getter_AddRefs(temp));
|
||||
bodyChild = do_QueryInterface(temp);
|
||||
}
|
||||
if (needsBogusContent)
|
||||
// Skip adding the bogus node if body is read-only
|
||||
if (needsBogusContent && mEditor->IsModifiableNode(body))
|
||||
{
|
||||
// create a br
|
||||
nsCOMPtr<nsIContent> newContent;
|
||||
|
|
Загрузка…
Ссылка в новой задаче