Disable WebkitTextFillColor in Firefox+OSX

Avoids opaque selection covering text.

Bug: T175223
Change-Id: Iede96501d4a03ccd80488b4661c18647eb9118e1
This commit is contained in:
Ed Sanders 2017-11-30 16:42:55 +00:00
parent 0296e2dcad
commit 80241fb717
2 changed files with 9 additions and 2 deletions

View file

@ -130,6 +130,7 @@
"ext.visualEditor.mwcore",
"ext.CodeMirror.lib",
"ext.CodeMirror.mode.mediawiki",
"jquery.client",
"mediawiki.api",
"mediawiki.api.options",
"user.options"

View file

@ -38,7 +38,8 @@ ve.ui.CodeMirrorAction.static.methods = [ 'toggle' ];
* @return {boolean} Action was executed
*/
ve.ui.CodeMirrorAction.prototype.toggle = function ( enable ) {
var surface = this.surface,
var profile, supportsTransparentText,
surface = this.surface,
surfaceView = surface.getView(),
doc = surface.getModel().getDocument();
@ -63,8 +64,13 @@ ve.ui.CodeMirrorAction.prototype.toggle = function ( enable ) {
// so revert any editfont user preference
surfaceView.$element.removeClass( 'mw-editfont-sans-serif mw-editfont-serif' ).addClass( 'mw-editfont-monospace' );
profile = $.client.profile();
supportsTransparentText = 'WebkitTextFillColor' in document.body.style &&
// Disable on Firefox+OSX (T175223)
!( profile.layout === 'gecko' && profile.platform === 'mac' );
surfaceView.$documentNode.addClass(
'WebkitTextFillColor' in document.body.style ?
supportsTransparentText ?
've-ce-documentNode-codeEditor-webkit-hide' :
've-ce-documentNode-codeEditor-hide'
);