Page MenuHomePhabricator

Gallery rendered incorrectly after making a change
Open, Needs TriagePublic

Description

  1. Start translation of "San Francisco International Airport" from Simple English to Spanish
  2. Translate Gallery section
  3. Open editing dialog and make some change
  4. Save changes

Result: Gallery images are misplaces and rendered incorrectly

Event Timeline

Petar.petkovic moved this task from Needs Triage to CX2 on the ContentTranslation board.

It looks like the width and height attributes are missing from the ve.dm.MWGalleryImageNode. Given that this doesn't happen in plain VE, I would guess CX has dropped some data from the DOM at some point?

Parsoid DOM:

<li class="gallerybox" style="width: 155px;">
   <div class="thumb" style="width: 150px; height: 150px;">
      <figure-inline typeof="mw:Image"><a href="./File:Boeing_727-193,_Pacific_Air_Lines_JP6858513.jpg">
         <img resource="./File:Boeing_727-193,_Pacific_Air_Lines_JP6858513.jpg" src="//upload.wikimedia.org/..." data-file-width="1024" data-file-height="661" data-file-type="bitmap" height="77" width="120" srcset="..."></a></figure-inline>
   </div>
   <div class="gallerytext">A <a rel="mw:WikiLink" href="./Pacific_Air_Lines" title="Pacific Air Lines" class="new">Pacific Air Lines</a> airplane at the airport in <a rel="mw:WikiLink" href="./1967" title="1967">1967</a>.</div>
</li>

CX DOM

<li class="gallerybox" style="width: 155px;">
   <div>
      <div class="thumb">
         <div><a><img resource="File:Boeing 727-193, Pacific Air Lines JP6858513.jpg" src="//upload.wikimedia.org/..."></a></div>
      </div>
   </div>
   <div class="gallerytext"><span class="cx-segment" data-segmentid="270">A <a class="new cx-link" data-linkid="271" href="./Pacific_Air_Lines" rel="mw:WikiLink" title="Pacific Air Lines">Pacific Air Lines</a> airplane at the airport in <a class="cx-link" data-linkid="272" href="./1967" rel="mw:WikiLink" title="1967">1967</a>.</span></div>
</li>
  • The <img> is missing width/height and data-file-* attributes, which is probably the cause
  • Ideally the extra <div> wrappers would be removed (outside and inside .thumb), and the <figure-inline> restored Currently ve.dm.MWGalleryImageNode.static.toDataElement is loose enough that it doesn't matter, but ideally the DOM structure would be preserved.