Bug 911201 - Do not create a bogus br node for editable areas containing non-editable block elements; r=roc

We no longer rely on the bogus br node for positioning the caret.
If an editable region has a non-editable block element, we can
probably rely on the block element to reserve the vertical
height, so in those cases we should be able to get away without
a bogus br node.
This commit is contained in:
Ehsan Akhgari 2014-11-27 21:06:44 -05:00
parent 8171f332a2
commit 91b95e46ea
4 changed files with 6 additions and 1 deletions

View File

@ -1154,7 +1154,7 @@ nsTextEditRules::CreateBogusNodeIfNeeded(Selection* aSelection)
bodyChild = bodyChild->GetNextSibling()) {
if (mEditor->IsMozEditorBogusNode(bodyChild) ||
!mEditor->IsEditable(body) || // XXX hoist out of the loop?
mEditor->IsEditable(bodyChild)) {
mEditor->IsEditable(bodyChild) || mEditor->IsBlockNode(bodyChild)) {
return NS_OK;
}
}

View File

@ -0,0 +1,2 @@
<!DOCTYPE html>
<body contenteditable><div contenteditable=false>foo</div></body>

View File

@ -0,0 +1,2 @@
<!DOCTYPE html>
<body contenteditable onload="document.body.innerHTML='<div contenteditable=false>foo</div>';"></body>

View File

@ -125,6 +125,7 @@ needs-focus == spellcheck-contenteditable-focused-reframe.html spellcheck-conten
== spellcheck-contenteditable-attr-dynamic-override-inherit.html spellcheck-contenteditable-disabled-ref.html
== spellcheck-contenteditable-property-dynamic-override.html spellcheck-contenteditable-disabled-ref.html
== spellcheck-contenteditable-property-dynamic-override-inherit.html spellcheck-contenteditable-disabled-ref.html
== 911201.html 911201-ref.html
needs-focus == 969773.html 969773-ref.html
== 997805.html 997805-ref.html
== 1088158.html 1088158-ref.html