Catrope has uploaded a new change for review.

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

Change subject: ve.ce.LinkAnnotation: Only set src on nails in Firefox
......................................................................

ve.ce.LinkAnnotation: Only set src on nails in Firefox

The src is only needed to work around buggy behavior in Firefox,
and setting an src makes nail creation much much slower in Chrome.

Change-Id: Id6c3d4dfeb6fa01c36750930b40551c9c35724f3
---
M src/ce/annotations/ve.ce.LinkAnnotation.js
1 file changed, 7 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/18/311218/1

diff --git a/src/ce/annotations/ve.ce.LinkAnnotation.js 
b/src/ce/annotations/ve.ce.LinkAnnotation.js
index ac0c29b..771afc8 100644
--- a/src/ce/annotations/ve.ce.LinkAnnotation.js
+++ b/src/ce/annotations/ve.ce.LinkAnnotation.js
@@ -57,7 +57,13 @@
  */
 ve.ce.LinkAnnotation.static.makeNail = function ( type ) {
        var nail = document.createElement( 'img' );
-       nail.src = ve.inputDebug ? ve.ce.nailImgDataUri : ve.ce.minImgDataUri;
+       // Support: Firefox
+       // Firefox <=37 misbehaves if we don't set an src: 
https://bugzilla.mozilla.org/show_bug.cgi?id=989012
+       // Firefox misbehaves if we don't set an src and there is no sizing at 
node creation time: https://bugzilla.mozilla.org/show_bug.cgi?id=1267906
+       // Setting an src in Chrome is slow, so only set it in affected 
versions of Firefox
+       if ( $.client.profile().layout === 'gecko' ) {
+               nail.src = ve.inputDebug ? ve.ce.nailImgDataUri : 
ve.ce.minImgDataUri;
+       }
        // The following classes can be used here:
        // ve-ce-nail-pre-open
        // ve-ce-nail-pre-close

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6c3d4dfeb6fa01c36750930b40551c9c35724f3
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <roan.katt...@gmail.com>

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

Reply via email to