Last modified: 2013-07-04 10:34:48 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 T46970, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44970 - Parsoid: Editing a page that starts with a comment causes Parsoid to crash
Parsoid: Editing a page that starts with a comment causes Parsoid to crash
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized critical
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-13 20:00 UTC by Roan Kattouw
Modified: 2013-07-04 10:34 UTC (History)
3 users (show)

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


Attachments

Description Roan Kattouw 2013-02-13 20:00:42 UTC
Contents of [[Parsoidcrash]]:
<!-- Foo -->
Bar

Load page into the editor, change Bar to Baar, and save. You'll get an error. Wireshark reveals that the following happened:

POST /localhost/Parsoidcrash HTTP/1.0
Host: localhost:8000
Accept: */*
Accept-Encoding: deflate, gzip
Referer: http://localhost/wiki/API
User-Agent: MediaWiki/1.21alpha
Content-Length: 254
Content-Type: multipart/form-data; boundary=----------------------------5e7e7b667ce1

------------------------------5e7e7b667ce1
Content-Disposition: form-data; name="content"

<!-- Foo -->

<p data-ve-changed="{&quot;content&quot;:1}" data-parsoid="{&quot;dsr&quot;:[14,17,0,0]}">Baar</p>
------------------------------5e7e7b667ce1--
HTTP/1.1 500 Internal Server Error
X-Powered-By: Express
Content-Type: text/x-mediawiki; charset=UTF-8
Content-Length: 602
Connection: close

TypeError: Cannot call method 'cloneNode' of undefined
    at [object Object].serializeDOM (/var/lib/parsoid/Parsoid/js/lib/mediawiki.WikitextSerializer.js:2330:16)
    at /var/lib/parsoid/Parsoid/js/api/ParserService.js:593:55
    at /var/lib/parsoid/Parsoid/js/api/ParserService.js:284:4
    at /var/lib/parsoid/Parsoid/js/lib/mediawiki.parser.environment.js:185:3
    at [object Object].<anonymous> (/var/lib/parsoid/Parsoid/js/lib/mediawiki.parser.environment.js:209:4)
    at Array.1 (/var/lib/parsoid/Parsoid/js/lib/mediawiki.ApiRequest.js:60:4)
    at EventEmitter._tickCallback (node.js:192:40)
Comment 1 Gabriel Wicke 2013-02-14 22:28:24 UTC
This is the same fragment parsing issue you ran into earlier while implementing the iframe trick. The comment ends up outside of the implicit HTML element in the DOM, which breaks our path to the body. We shall make sure that we always wrap things at least in a body tag when parsing a fragment.
Comment 2 Gabriel Wicke 2013-02-15 00:06:28 UTC
Patch submitted in https://gerrit.wikimedia.org/r/49185.
Comment 3 Alex Monk 2013-02-17 21:41:35 UTC
Merged on the 15th.
Comment 4 Andre Klapper 2013-07-04 10:34:48 UTC
[Parsoid component reorg by merging JS/General and General. See bug 50685 for more information. Filter bugmail on this comment. parsoidreorg20130704]

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


Navigation
Links