gecko-dev/editor
Masayuki Nakano f802692190 Bug 1411687 - part 2: Rewrite the check to insert a <br> element in HTMLEditRules::WillInsertBreak() r=m_kato
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
2017-10-27 01:27:44 +09:00
..
composer Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro. 2017-10-03 09:05:19 +11:00
libeditor Bug 1411687 - part 2: Rewrite the check to insert a <br> element in HTMLEditRules::WillInsertBreak() r=m_kato 2017-10-27 01:27:44 +09:00
reftests Bug 1410074: Load input.css from a chrome uri, so windows reftests can use system metric media queries. r=bz,xidorn 2017-10-06 20:16:43 +02:00
txmgr Bug 1398999 - nsDequeFunctor::operator() doesn't need to return anything - r=froydnj 2017-02-09 14:06:36 +11:00
txtsvc Bug 1394649 - Use nsGkAtoms on nsTextServiceDocument. r=masayuki 2017-10-23 13:09:49 +09:00
AsyncSpellCheckTestHelper.jsm Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout 2017-04-14 23:39:22 +02:00
moz.build Bug 1325281 Get rid of nsIEditorIMESupport r=m_kato 2017-05-09 15:21:22 +09:00
nsEditorCID.h
nsIContentFilter.idl
nsIDocumentStateListener.idl
nsIEditActionListener.idl
nsIEditor.idl Bug 1407854 - Part 1: Remove nsIEditor.createNode(); r=masayuki 2017-10-12 17:13:55 -04:00
nsIEditorMailSupport.idl Bug 1060051 - Make editor related interfaces builtin classes if it's possible r=Ehsan,smaug 2017-08-04 13:57:56 +09:00
nsIEditorObserver.idl
nsIEditorSpellCheck.idl
nsIEditorStyleSheets.idl Bug 1060051 - Make editor related interfaces builtin classes if it's possible r=Ehsan,smaug 2017-08-04 13:57:56 +09:00
nsIEditorUtils.idl Bug 1060051 - Make editor related interfaces builtin classes if it's possible r=Ehsan,smaug 2017-08-04 13:57:56 +09:00
nsIHTMLAbsPosEditor.idl Bug 1060051 - Make editor related interfaces builtin classes if it's possible r=Ehsan,smaug 2017-08-04 13:57:56 +09:00
nsIHTMLEditor.idl Bug 1394583 - Remove default properties from nsIHTMLEditor. r=masayuki. 2017-08-25 16:59:17 +10:00
nsIHTMLInlineTableEditor.idl Bug 1060051 - Make editor related interfaces builtin classes if it's possible r=Ehsan,smaug 2017-08-04 13:57:56 +09:00
nsIHTMLObjectResizer.idl Bug 1060051 - Make editor related interfaces builtin classes if it's possible r=Ehsan,smaug 2017-08-04 13:57:56 +09:00
nsIPlaintextEditor.idl Bug 1060051 - Make editor related interfaces builtin classes if it's possible r=Ehsan,smaug 2017-08-04 13:57:56 +09:00
nsITableEditor.idl Bug 1387317 - part1: Make AutoSelectionSetterAfterTableEdit use HTMLEditor instead of nsITableEditor r=m_kato 2017-08-08 10:57:19 +09:00
nsIURIRefObject.idl
nsPIEditorTransaction.idl