Last modified: 2014-03-24 22:44:08 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 T64805, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62805 - Serialization of modified images sometimes outputs NaNxNaNpx
Serialization of modified images sometimes outputs NaNxNaNpx
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
serializer (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: C. Scott Ananian
:
Depends on:
Blocks: 54844
  Show dependency treegraph
 
Reported: 2014-03-18 23:39 UTC by Roan Kattouw
Modified: 2014-03-24 22:44 UTC (History)
3 users (show)

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


Attachments

Description Roan Kattouw 2014-03-18 23:39:48 UTC
* Parse a page with a right-floating frameless image from
  wikitext to HTML
* Result HTML has class="mw-default-size mw-halign-right";
  change this to class="mw-halign-right"
* Serialize modified HTML back to wikitext
* A wild NaN appeared!


$ echo "[[File:Hol_komm.png|right|frameless]]" | node tests/parse.js

<body data-parsoid='{"dsr":[0,38,0,0]}'><figure class="mw-default-size mw-halign-right" typeof="mw:Image/Frameless" data-parsoid='{"optList":[{"ck":"right","ak":"right"},{"ck":"frameless","ak":"frameless"}],"dsr":[0,37,2,2]}'><a href="./File:Hol_komm.png" data-parsoid='{"a":{"href":"./File:Hol_komm.png"},"dsr":[2,35,null,null]}'><img resource="./File:Hol_komm.png" src="//upload.wikimedia.org/wikipedia/commons/f/f1/Hol_komm.png" height="151" width="125" data-parsoid='{"a":{"resource":"./File:Hol_komm.png","height":"151","width":"125"},"sa":{"resource":"File:Hol_komm.png"}}'/></a></figure>
</body>

$ echo "[[File:Hol_komm.png|right|frameless]]" | node tests/parse.js | tee frameless.html

<body data-parsoid='{"dsr":[0,38,0,0]}'><figure class="mw-default-size mw-halign-right" typeof="mw:Image/Frameless" data-parsoid='{"optList":[{"ck":"right","ak":"right"},{"ck":"frameless","ak":"frameless"}],"dsr":[0,37,2,2]}'><a href="./File:Hol_komm.png" data-parsoid='{"a":{"href":"./File:Hol_komm.png"},"dsr":[2,35,null,null]}'><img resource="./File:Hol_komm.png" src="//upload.wikimedia.org/wikipedia/commons/f/f1/Hol_komm.png" height="151" width="125" data-parsoid='{"a":{"resource":"./File:Hol_komm.png","height":"151","width":"125"},"sa":{"resource":"File:Hol_komm.png"}}'/></a></figure>
</body>

$ sed -i frameless.html -e 's/mw-default-size //'
$ cat frameless.html

<body data-parsoid='{"dsr":[0,38,0,0]}'><figure class="mw-halign-right" typeof="mw:Image/Frameless" data-parsoid='{"optList":[{"ck":"right","ak":"right"},{"ck":"frameless","ak":"frameless"}],"dsr":[0,37,2,2]}'><a href="./File:Hol_komm.png" data-parsoid='{"a":{"href":"./File:Hol_komm.png"},"dsr":[2,35,null,null]}'><img resource="./File:Hol_komm.png" src="//upload.wikimedia.org/wikipedia/commons/f/f1/Hol_komm.png" height="151" width="125" data-parsoid='{"a":{"resource":"./File:Hol_komm.png","height":"151","width":"125"},"sa":{"resource":"File:Hol_komm.png"}}'/></a></figure>
</body>

$ cat frameless.html | node tests/parse.js --html2wt

[[File:Hol_komm.png|right|frameless|NaNxNaNpx]]
Comment 1 Gerrit Notification Bot 2014-03-20 23:09:28 UTC
Change 119894 had a related patch set uploaded by Cscott:
No more NaNxNaN px.

https://gerrit.wikimedia.org/r/119894
Comment 2 Gerrit Notification Bot 2014-03-24 14:25:44 UTC
Change 119894 merged by jenkins-bot:
No more NaNxNaN px.

https://gerrit.wikimedia.org/r/119894
Comment 3 ssastry 2014-03-24 22:44:08 UTC
Now deployed

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


Navigation
Links