Esanders has uploaded a new change for review.

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

Change subject: Make table editing less critically broken in Firefox 39
......................................................................

Make table editing less critically broken in Firefox 39

Regression in FF39 means we can't use ce=false for tables. Making
the table ce=true while editing makes cells editable again, but does
allow the user to select across cell boundaries if done with the mouse.

Bug: T103035
Change-Id: I372f9ab406b2ff2881dbb9fe864664327b42ecdb
---
M src/ce/nodes/ve.ce.TableNode.js
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/54/224054/1

diff --git a/src/ce/nodes/ve.ce.TableNode.js b/src/ce/nodes/ve.ce.TableNode.js
index 517b9de..913ccad 100644
--- a/src/ce/nodes/ve.ce.TableNode.js
+++ b/src/ce/nodes/ve.ce.TableNode.js
@@ -241,7 +241,7 @@
  * @param {boolean} noSelect Don't change the selection
  */
 ve.ce.TableNode.prototype.setEditing = function ( isEditing, noSelect ) {
-       var cell, offset, cellRange,
+       var cell, offset, cellRange, profile,
                surfaceModel = this.surface.getModel(),
                selection = surfaceModel.getSelection();
        if ( isEditing ) {
@@ -267,6 +267,15 @@
                this.editingFragment = null;
        }
        this.$element.toggleClass( 've-ce-tableNode-editing', isEditing );
+       // HACK T103035: Firefox 39 has a regression which clicking on a 
ce=false table
+       // always selects the entire table, even if you click in a ce=true 
child.
+       // Making the table ce=true does allow the user to make selections 
across cells
+       // and corrupt the table in some circumstance, so restrict this hack as 
much
+       // as possible.
+       profile = $.client.profile();
+       if ( profile.layout === 'gecko' && profile.versionBase === '39' ) {
+               this.$element.prop( 'contentEditable', isEditing.toString() );
+       }
        this.$overlay.toggleClass( 've-ce-tableNodeOverlay-editing', isEditing 
);
 };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I372f9ab406b2ff2881dbb9fe864664327b42ecdb
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>

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

Reply via email to