Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 427828
Collapse All | Expand All

(-)a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Text.js (-14 / +22 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2010, 2013 EclipseSource and others.
2
 * Copyright (c) 2010, 2014 EclipseSource and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 9-15 Link Here
9
 *    EclipseSource - initial API and implementation
9
 *    EclipseSource - initial API and implementation
10
 ******************************************************************************/
10
 ******************************************************************************/
11
11
12
(function(){
12
(function() {
13
13
14
rwt.qx.Class.define( "rwt.widgets.Text", {
14
rwt.qx.Class.define( "rwt.widgets.Text", {
15
15
Lines 67-73 Link Here
67
67
68
    setPasswordMode : function( value ) {
68
    setPasswordMode : function( value ) {
69
      var type = value ? "password" : "text";
69
      var type = value ? "password" : "text";
70
      if( this._inputTag != "textarea" && this._inputType != type ) {
70
      if( !this._isTextArea() && this._inputType != type ) {
71
        this._inputType = type;
71
        this._inputType = type;
72
        if( this._isCreated ) {
72
        if( this._isCreated ) {
73
          if( rwt.client.Client.getEngine() === "mshtml" ) {
73
          if( rwt.client.Client.getEngine() === "mshtml" ) {
Lines 186-197 Link Here
186
186
187
    _applyElement : function( value, oldValue ) {
187
    _applyElement : function( value, oldValue ) {
188
      this.base( arguments, value, oldValue );
188
      this.base( arguments, value, oldValue );
189
      if( this._inputTag == "textarea" ) {
189
      if( this._isTextArea() ) {
190
        this._styleWrap();
190
        this._styleWrap();
191
        if( rwt.client.Client.isNewMshtml() && rwt.client.Client.getVersion() === 9 ) {
191
      }
192
          // Bug 422974 - [Text] Multi-Line Text with border-radius not focusable by mouse in IE9
192
      var client = rwt.client.Client;
193
          rwt.html.Style.setBackgroundImage( this._inputElement, "static/image/blank.gif" );
193
      if(    client.isMshtml()
194
        }
194
          || client.isNewMshtml() && client.getVersion() === 9 && this._isTextArea() )
195
      {
196
        // Bug 427828 - [Text] Loses focus on click in IE8
197
        // Bug 422974 - [Text] Multi-Line Text with border-radius not focusable by mouse in IE9
198
        rwt.html.Style.setBackgroundImage( this._inputElement, "static/image/blank.gif" );
195
      }
199
      }
196
      // Fix for bug 306354
200
      // Fix for bug 306354
197
      this._inputElement.style.paddingRight = "1px";
201
      this._inputElement.style.paddingRight = "1px";
Lines 200-212 Link Here
200
    },
204
    },
201
205
202
    _webkitMultilineFix : function() {
206
    _webkitMultilineFix : function() {
203
      if( this._inputTag !== "textarea" ) {
207
      if( !this._isTextArea() ) {
204
        this.base( arguments );
208
        this.base( arguments );
205
      }
209
      }
206
    },
210
    },
207
211
208
    _applyWrap : function( value, oldValue ) {
212
    _applyWrap : function( value, oldValue ) {
209
      if( this._inputTag == "textarea" ) {
213
      if( this._isTextArea() ) {
210
        this._styleWrap();
214
        this._styleWrap();
211
      }
215
      }
212
    },
216
    },
Lines 234-240 Link Here
234
    } ),
238
    } ),
235
239
236
    _applyMaxLength : function( value, oldValue ) {
240
    _applyMaxLength : function( value, oldValue ) {
237
      if( this._inputTag != "textarea" ) {
241
      if( !this._isTextArea() ) {
238
        this.base( arguments, value, oldValue );
242
        this.base( arguments, value, oldValue );
239
      }
243
      }
240
    },
244
    },
Lines 268-273 Link Here
268
      if( fireEvents ) {
272
      if( fireEvents ) {
269
        this._oninputDom( event );
273
        this._oninputDom( event );
270
      }
274
      }
275
    },
276
277
    _isTextArea : function() {
278
      return this._inputTag === "textarea";
271
    },
279
    },
272
280
273
    ////////////////
281
    ////////////////
Lines 463-469 Link Here
463
471
464
    // Overwritten
472
    // Overwritten
465
    _preventEnter : function( event ) {
473
    _preventEnter : function( event ) {
466
      if( this._inputTag !== "textarea" ) {
474
      if( !this._isTextArea() ) {
467
        this.base( arguments, event );
475
        this.base( arguments, event );
468
      }
476
      }
469
    },
477
    },
Lines 504-510 Link Here
504
                    - this._getIconOuterWidth( "cancel" );
512
                    - this._getIconOuterWidth( "cancel" );
505
        style.width = Math.max( 0, width ) + "px";
513
        style.width = Math.max( 0, width ) + "px";
506
        var messageHeight = parseInt( style.height, 10 );
514
        var messageHeight = parseInt( style.height, 10 );
507
        if( this._inputTag == "textarea" ) {
515
        if( this._isTextArea() ) {
508
          // The text-area padding is hard codded in the appearances
516
          // The text-area padding is hard codded in the appearances
509
          style.top = "0px";
517
          style.top = "0px";
510
          style.left = "3px";
518
          style.left = "3px";
Lines 550-554 Link Here
550
558
551
} );
559
} );
552
560
553
}());
561
}() );
554
562
(-)a/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/TextTest.js (-8 / +13 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2010, 2013 EclipseSource and others.
2
 * Copyright (c) 2010, 2014 EclipseSource and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 9-15 Link Here
9
 *    EclipseSource - initial API and implementation
9
 *    EclipseSource - initial API and implementation
10
 ******************************************************************************/
10
 ******************************************************************************/
11
11
12
(function(){
12
(function() {
13
13
14
var TestUtil = org.eclipse.rwt.test.fixture.TestUtil;
14
var TestUtil = org.eclipse.rwt.test.fixture.TestUtil;
15
var Processor = rwt.remote.MessageProcessor;
15
var Processor = rwt.remote.MessageProcessor;
Lines 388-394 Link Here
388
    },
388
    },
389
389
390
    testRenderPaddingWithRoundedBorder : function() {
390
    testRenderPaddingWithRoundedBorder : function() {
391
      if( !rwt.client.Client.supportsCss3() ) {
391
      if( !Client.supportsCss3() ) {
392
        createText();
392
        createText();
393
        text.setPadding( 3 );
393
        text.setPadding( 3 );
394
        text.setBorder( new Border( 1, "rounded", "black", 0 ) );
394
        text.setBorder( new Border( 1, "rounded", "black", 0 ) );
Lines 1399-1410 Link Here
1399
      TestUtil.flush();
1399
      TestUtil.flush();
1400
1400
1401
      var textHeight= text.getInputElement().offsetHeight;
1401
      var textHeight= text.getInputElement().offsetHeight;
1402
      if( rwt.client.Client.isMshtml() ) {
1402
      if( Client.isMshtml() ) {
1403
        textHeight -= 2;
1403
        textHeight -= 2;
1404
      }
1404
      }
1405
      var expected = Math.floor( 100 / 2 - textHeight / 2 - 1 );
1405
      var expected = Math.floor( 100 / 2 - textHeight / 2 - 1 );
1406
      assertEquals( expected, parseInt( text.getElement().style.paddingTop, 10 ) );
1406
      assertEquals( expected, parseInt( text.getElement().style.paddingTop, 10 ) );
1407
      if( rwt.client.Client.isNewMshtml() ) {
1407
      if( Client.isNewMshtml() ) {
1408
        assertEquals( "top", text._inputElement.style.verticalAlign );
1408
        assertEquals( "top", text._inputElement.style.verticalAlign );
1409
      } else {
1409
      } else {
1410
        assertEquals( "", text._inputElement.style.verticalAlign );
1410
        assertEquals( "", text._inputElement.style.verticalAlign );
Lines 1432-1439 Link Here
1432
1432
1433
      var element = text._getTargetNode().firstChild;
1433
      var element = text._getTargetNode().firstChild;
1434
      var image = TestUtil.getCssBackgroundImage( element );
1434
      var image = TestUtil.getCssBackgroundImage( element );
1435
1436
      // Bug 427828 - [Text] Loses focus on click in IE8
1435
      // Bug 422974 - [Text] Multi-Line Text with border-radius not focusable by mouse in IE9
1437
      // Bug 422974 - [Text] Multi-Line Text with border-radius not focusable by mouse in IE9
1436
      var expected = rwt.client.Client.isNewMshtml() && rwt.client.Client.getVersion() === 9;
1438
      var expected = Client.isMshtml() || Client.isNewMshtml() && Client.getVersion() === 9;
1437
      assertEquals( expected, image.indexOf( "blank.gif" ) !== -1 );
1439
      assertEquals( expected, image.indexOf( "blank.gif" ) !== -1 );
1438
    },
1440
    },
1439
1441
Lines 1442-1448 Link Here
1442
1444
1443
      var element = text._getTargetNode().firstChild;
1445
      var element = text._getTargetNode().firstChild;
1444
      var image = TestUtil.getCssBackgroundImage( element );
1446
      var image = TestUtil.getCssBackgroundImage( element );
1445
      assertTrue( image.indexOf( "blank.gif" ) === -1 );
1447
1448
      // Bug 427828 - [Text] Loses focus on click in IE8
1449
      var expected = Client.isMshtml();
1450
      assertEquals( expected, image.indexOf( "blank.gif" ) !== -1 );
1446
    },
1451
    },
1447
1452
1448
    /////////
1453
    /////////
Lines 1511-1514 Link Here
1511
  text._setSelectionLength( selection[ 1 ] - selection[ 0 ] );
1516
  text._setSelectionLength( selection[ 1 ] - selection[ 0 ] );
1512
};
1517
};
1513
1518
1514
}());
1519
}() );

Return to bug 427828