mediawiki-extensions-Visual.../modules/ve/test/dm
Catrope 085a6f0985 (bug 42487) Don't crash the converter for "<span>\n<p>Foo</p></span>"
The converter was misbehaving when handling <p>s inside <span>s. This
can't be expressed in the linmod, but it would try to anyway. <span><p>
would result in too many paragraph closing elements, leading to an
exception in ve.dm.Document complaining about unbalanced input.
<span>\n<p> would result in an exception in the converter itself while
trying to perform whitespace preservation on the newline.

This change makes the converter detect these scenarios and alienate the
offending node. So <span><p>Foo</p></span> converts to a wrapper
paragraph containing an alienInline whose HTML is "<p>Foo</p>" and which
is annotated with a TextStyleSpanAnnotation.

ve.dm.Converter.getDomFromData():
* Change the criteria for alienBlock vs alienInline
** Only infer from the node type if we're in wrapping mode AND we're at
   the same level where the wrapping started (wrappingIsOurs). If the
   latter isn't the case, we can't split the wrapper in the block case
   because we're at the wrong level.
** Use alienInline not only if the branch is a content branch, but also
   if there are active annotations. This catches e.g. <li><b><p>
   (and generally <span><p> on the top level).
* Before converting a child element, check that the child isn't "bad".
  Bad children are non-content children in content branches, and
  non-content children encountered within a wrapper that we can't split.
  Only good children are converted, and bad children are alienated (cue
  Santa/Sinterklaas jokes).
* Add childIsContent and rename branchIsContent to branchHasContent

Change-Id: If420ae80ab0777424a9a5517335ef9d0170e87ae
2012-12-05 17:20:07 -08:00
..
nodes Kranitor #1: On-boarding 2012-07-27 14:40:00 -07:00
ve.dm.AnnotationFactory.test.js New annotation API: Annotation and AnnotationFactory classes 2012-10-12 15:07:02 -07:00
ve.dm.BranchNode.test.js Store the data model element in the DM tree 2012-11-27 14:36:29 -08:00
ve.dm.Converter.test.js (bug 42487) Don't crash the converter for "<span>\n<p>Foo</p></span>" 2012-12-05 17:20:07 -08:00
ve.dm.Document.test.js (bug 42401) Cursor movement fixes 2012-11-30 09:50:47 -08:00
ve.dm.DocumentSynchronizer.test.js Introduce meta-linmod 2012-11-02 19:06:49 -07:00
ve.dm.example.js (bug 42487) Don't crash the converter for "<span>\n<p>Foo</p></span>" 2012-12-05 17:20:07 -08:00
ve.dm.LeafNode.test.js Store the data model element in the DM tree 2012-11-27 14:36:29 -08:00
ve.dm.Node.test.js Store the data model element in the DM tree 2012-11-27 14:36:29 -08:00
ve.dm.NodeFactory.test.js Rename ve_foo_bar back to VeFooBar per discussion 2012-09-06 16:15:55 -07:00
ve.dm.Surface.test.js Fixing Pre-Annotations 2012-11-19 17:09:08 -08:00
ve.dm.SurfaceFragment.test.js Add change marking for Parsoid's benefit 2012-11-06 10:11:11 -08:00
ve.dm.Transaction.test.js Test: Enforce # of expected assertions. 2012-10-25 22:06:07 +02:00
ve.dm.TransactionProcessor.test.js Make annotating inline elements actually work 2012-11-27 14:41:40 -08:00