Last modified: 2013-06-28 02:42: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 T49521, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47521 - VisualEditor: Sanity-check the browser by internally round-tripping HTML to linmod and ensuring it's the same
VisualEditor: Sanity-check the browser by internally round-tripping HTML to l...
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
Technical Debt (Other open bugs)
unspecified
All All
: Normal major
: VE-deploy-2013-07-04
Assigned To: Roan Kattouw
:
Depends on:
Blocks: 50067
  Show dependency treegraph
 
Reported: 2013-04-22 21:55 UTC by James Forrester
Modified: 2013-06-28 02:42 UTC (History)
5 users (show)

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


Attachments

Description James Forrester 2013-04-22 21:55:41 UTC
On VE load, do an "originalHtml == serialise(linmod(originalHtml)" or whatever and fail out of the VE if false; ideally, also allow the user to submit a failure report for debugging purposes (this will need to get checked through with legal).
Comment 1 Gabriel Wicke 2013-04-29 17:25:33 UTC
A common issue currently is changes in attribute order and a change of quoting style for JSON attributes. It would be great if VE could preserve the order of attributes. 

For the quoting, we have some smart quoting code that you could reuse. Alternatively, you can compare the innerHTML of the original DOM with the exported DOM as that implicitly changes JSON attribute quoting to the verbose style.
Comment 2 Roan Kattouw 2013-04-29 19:33:36 UTC
We wouldn't be doing string-based comparisons, we'd be doing DOM-based comparisons. That's what Parsoid should be doing too, IMO.

If comparisons are DOM-based, quoting style and attribute order don't matter. In general, I don't believe there's a way to read or write attribute order in the DOM.
Comment 3 Gabriel Wicke 2013-04-29 19:51:32 UTC
We are diffing on the DOM on the way in, but while debugging a text diff is useful too.

Order preservation is not guaranteed in the DOM4 spec afaik, but is implemented and supported nevertheless using the attributes collection and numerical indexing: https://developer.mozilla.org/en-US/docs/DOM/Node.attributes
Comment 4 James Forrester 2013-05-17 05:03:03 UTC
Roan's offered to do this one on his flight. Marking as such.
Comment 5 James Forrester 2013-06-05 16:31:17 UTC
Pulling.
Comment 6 Gabriel Wicke 2013-06-17 19:14:28 UTC
Any news on this? 

Having some automated general sanity checks on the returned wikitext (for example size, check if it starts with a doctype) would also be good, especially now that users don't see a diff by default any more. If any of the automated sanity checks fail, you should probably ask the user to review changes before saving. This should catch most major article corruption issues before they happen.
Comment 7 Gerrit Notification Bot 2013-06-28 01:11:23 UTC
Change 70106 had a related patch set uploaded by Krinkle:
mw.ViewPageTarget: Add sanity check for DOM roundtrip

https://gerrit.wikimedia.org/r/70106
Comment 8 Gerrit Notification Bot 2013-06-28 02:41:46 UTC
Change 70106 merged by jenkins-bot:
mw.ViewPageTarget: Add sanity check for DOM roundtrip

https://gerrit.wikimedia.org/r/70106
Comment 9 James Forrester 2013-06-28 02:42:26 UTC
Written and about to be deployed.

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


Navigation
Links