Page MenuHomePhabricator

VisualEditor: Pasting a table with a caption breaks fixUpInsertion
Closed, ResolvedPublic

Description

Safari 7

Copy on https://www.mediawiki.org/wiki/VisualEditor?veaction=edit

From and including the header Timeline, up to the paragraph before "Notes" headline (including the table).

Past in an empty surface:

[Error] TypeError: 'undefined' is not an object (evaluating 'source.clone')
copy (undefined, line 3)
getClonedElement
fixupInsertion
fixupInsertion
newFromDocumentInsertion
afterPaste
proxy (load.php, line 10)


Version: unspecified
Severity: normal

Details

Reference
bz58318

Event Timeline

The problem here is that fixUpInsertion is deciding you can't put a table in a paragraph but not resolving properly.

More detail: the problem is caused by ContentEditable (surprise). When you paste a table into an empty paragraph, the paragraph is *completely* deleted, which the paste context comparer can't currently deal with.

Part of this appears to be caused by table captions. Investigating.

Change 100792 had a related patch set uploaded by Esanders:
Allow tables to contain captions!

https://gerrit.wikimedia.org/r/100792

Change 100792 merged by jenkins-bot:
Allow tables to contain captions!

https://gerrit.wikimedia.org/r/100792

Change 100916 had a related patch set uploaded by Jforrester:
Allow tables to contain captions!

https://gerrit.wikimedia.org/r/100916

Change 100916 merged by jenkins-bot:
Allow tables to contain captions!

https://gerrit.wikimedia.org/r/100916