Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/154016

Change subject: Fix: Placeholder height wrong for figures in Firefox
......................................................................

Fix: Placeholder height wrong for figures in Firefox

Firefox specific fix for section height calculation for figures
due to an upstream bug.

Bug: 68498
Change-Id: I3d9c57f8fea58bb83028bdf4e013597c328a2cd9
---
M modules/translation/ext.cx.translation.aligner.js
1 file changed, 13 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/16/154016/1

diff --git a/modules/translation/ext.cx.translation.aligner.js 
b/modules/translation/ext.cx.translation.aligner.js
index 072e9b8..17d471f 100644
--- a/modules/translation/ext.cx.translation.aligner.js
+++ b/modules/translation/ext.cx.translation.aligner.js
@@ -35,6 +35,19 @@
                                clear: $sourceSection.css( 'clear' ),
                                position: $sourceSection.css( 'position' )
                        } );
+                       // Firefox fix for figure heights. Uses InstallTrigger 
for browser detection.
+                       // See https://bugzilla.wikimedia.org/68498
+                       if ( $sourceSection.prop( 'tagName' ) === 'FIGURE' &&
+                               typeof InstallTrigger !== 'undefined' ) {
+                               $section.css( {
+                                       // add figcaption height also to the 
placeholder height since Firefox ignore it
+                                       // while calculating height of figure. 
Set it as height instead of min-height since
+                                       // firefox does not allow setting 
min-height for elements with display: table. Figures
+                                       // in wikipages has display style 
property as table.
+                                       // See 
https://bugzilla.mozilla.org/show_bug.cgi?id=1043294
+                                       height: $sourceSection.outerHeight() + 
$sourceSection.find( 'figcaption' ).outerHeight()
+                               } );
+                       }
 
                        return this;
                }

-- 
To view, visit https://gerrit.wikimedia.org/r/154016
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d9c57f8fea58bb83028bdf4e013597c328a2cd9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to