Page MenuHomePhabricator

MF beta high-DPI/responsive images don't trigger in sections beyond the summary
Closed, ResolvedPublic

Description

High-DPI responsive images aren't being loaded in sections beyond the summary section. The SFMOMA photo in the San Francisco 'Culture' section should show a lot of detail on the diagonal lines on the central circular slanted roof, but shows blurry and pixelated instead.

Probably needs an explicit call to $(...).hidpi() in the appropriate event handler after loading the sections.

This is likely closely related to bug 41287.


Version: unspecified
Severity: normal
URL: http://test.m.wikipedia.org/wiki/San_Francisco

Details

Reference
bz41288

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:08 AM
bzimport set Reference to bz41288.

The event 'mw-mf-section-rendered' is triggered after a section has rendered
$( window ).on('mw-mf-section-rendered', function( ev, container) {
$( container ).find( ... ).hidpi();
} );
should fix this?
Not sure how to use hidpi though - can you point me at the code or look into this yourself?

The hidpi code is in core:
https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=resources/jquery/jquery.hidpi.js;h=70bfc4ea3c664570102bd697140912fedfd98373;hb=HEAD

$(foo).hidpi applies the 'srcset' stuff to any <img> elements found within the given selection, so assuming container is the container for the newly shown section this should work:

$( window ).on('mw-mf-section-rendered', function( ev, container) {

$( container ).hidpi();

} );

It should be idempotent if run over the same DOM subtree twice, so it should be safe to run it multiple times if need be.

  • Bug 41287 has been marked as a duplicate of this bug. ***