Last modified: 2014-06-12 06:25:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53501, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51501 - VisualEditor: Rewrite converter to be bottom-up
VisualEditor: Rewrite converter to be bottom-up
Status: ASSIGNED
Product: VisualEditor
Classification: Unclassified
Technical Debt (Other open bugs)
unspecified
All All
: High enhancement
: ---
Assigned To: Ed Sanders
:
Depends on:
Blocks: 48933
  Show dependency treegraph
 
Reported: 2013-07-17 02:44 UTC by Roan Kattouw
Modified: 2014-06-12 06:25 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Roan Kattouw 2013-07-17 02:44:51 UTC
The data->DOM converter should construct its DOM bottom-up, the way https://gerrit.wikimedia.org/r/74058 already does for annotations. This would enable us to do some cool things like:

* Pass childDomElements to nodes and meta items (already done for annotations)
* Pass data content in addition to DOM content?
* Allow nodes and meta items to unwrap themselves by returning an empty array (already done for annotations)
** We could implement unwrapping of generated wrapper paragraphs using this feature
* Possibly change the API so that instead of returning an array of DOM elements, the toDomElements function is responsible for appending its children.
** This could replace handlesOwnChildren, and enable model types with complex output

For DOM->data it's not as straightforward. We could experiment with bottom-up (outside-in, really) building there too, but it would be a bit less clear how things would work, and whether the copying involved would affect performance (although I believe we may already do a fair bit of copying around as it is).


This may be my pet project for my flight to Wikimania, or I may end up doing this sooner if there's time.
Comment 1 Roan Kattouw 2013-07-17 02:48:29 UTC
(In reply to comment #0)
> * Possibly change the API so that instead of returning an array of DOM
> elements, the toDomElements function is responsible for appending its
> children.
> ** This could replace handlesOwnChildren, and enable model types with complex
> output
> 
This would also enable partial unwrapping of annotations, e.g. <p><a> Foo </a></p> -> <p> <a>Foo</a> </p>
Comment 2 James Forrester 2014-06-12 06:25:26 UTC
Ping on this bug.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links