mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 11:45:37 +00:00
f802692190
Currently, HTMLEditRules::WillInsertBreak() checks if the editing host can contain a <p> element as a child or a descendant. However, this is not enough. If an inline element has a block element which can contain a <p> element, current implementation considers to insert a <br>. This is possible when * The editing host is an unknown element including user defined element. * The editing host is an inline element and its children and/or descendants were added by JS. E.g., <span contenteditable> element can have <div> element. I think that we should consider to insert a <br> element when: - There is no block ancestors in the editing host. - The editing host is the only block element and it cannot contain <p> element or the default paragraph separator is <br> element. - The nearest block ancestor isn't a single-line container declared in the execCommand spec and there are no block elements which can contain <p> element. Note that Chromium checks if CSS box of ancestors is block too. However, it must be out of scope of this bug. MozReview-Commit-ID: HdjU9t83Nd1 --HG-- extra : rebase_source : 7030671268a610613359b5d8ae5d126e120f59bd |
||
---|---|---|
.. | ||
composer | ||
libeditor | ||
reftests | ||
txmgr | ||
txtsvc | ||
AsyncSpellCheckTestHelper.jsm | ||
moz.build | ||
nsEditorCID.h | ||
nsIContentFilter.idl | ||
nsIDocumentStateListener.idl | ||
nsIEditActionListener.idl | ||
nsIEditor.idl | ||
nsIEditorMailSupport.idl | ||
nsIEditorObserver.idl | ||
nsIEditorSpellCheck.idl | ||
nsIEditorStyleSheets.idl | ||
nsIEditorUtils.idl | ||
nsIHTMLAbsPosEditor.idl | ||
nsIHTMLEditor.idl | ||
nsIHTMLInlineTableEditor.idl | ||
nsIHTMLObjectResizer.idl | ||
nsIPlaintextEditor.idl | ||
nsITableEditor.idl | ||
nsIURIRefObject.idl | ||
nsPIEditorTransaction.idl |