Last modified: 2013-09-04 16:44:16 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 T55664, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53664 - New-style packed gallery shows ragged edges after window resize
New-style packed gallery shows ragged edges after window resize
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://blue-dragon.wmflabs.org/wiki/C...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-01 18:14 UTC by Brion Vibber
Modified: 2013-09-04 16:44 UTC (History)
4 users (show)

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


Attachments

Description Brion Vibber 2013-09-01 18:14:26 UTC
Steps to reproduce:
* go to http://blue-dragon.wmflabs.org/wiki/Campaign:show-off-campaigns
* watch the gallery layout make clean, justified margins
* resize the window horizontally (up or down)
* watch the gallery items reflow, but not resize -- now you have ragged margins

Oh nooooooooo!

Probably needs some JS code to hook window.onresize and adjust packed galleries if horizontal size changes.

[This was seen on Yuvi's new UploadWizard campaign pages, but we think it's a general issue with the packed gallery.]
Comment 1 Brion Vibber 2013-09-01 18:14:53 UTC
CCing bawolff
Comment 2 Bawolff (Brian Wolff) 2013-09-01 19:39:17 UTC
In the original design I was assuming that people wouldn't resize the window very much. I kind of consider resizing on window size change to be a nice feature to have, but not critical.
Comment 3 Bawolff (Brian Wolff) 2013-09-04 15:46:56 UTC
So part of the problem with doing this, is that the current algorithm relies on how the browser places the images initially, in order to figure out the size of the pictures.

If we keep the current algorithm, one would have to first resize the images back to the original html sizes, and then re-run the layout algorithm again, everytime the window changed size.
Comment 4 Brion Vibber 2013-09-04 16:44:16 UTC
I think that can be worked around...

The 'natural size' of the images should be available to JavaScript directly[1], and if there's a portability problem, you can just save the original sizes in data attributes or something.

[1] https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement <- naturalWidth and naturalHeight properties at least in HTML5

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


Navigation
Links