mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
2bd53975b3
commit
9cd1d8318f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user