Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 163011 Details for
Bug 305666
[Text] max length tests fails on chromed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
fix
ChromeTextTestFail.txt (text/plain), 6.29 KB, created by
Tim Buschtoens
on 2010-03-25 12:46:03 EDT
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Tim Buschtoens
Created:
2010-03-25 12:46:03 EDT
Size:
6.29 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt.q07 >Index: js/org/eclipse/rwt/widgets/Text.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/rwt/widgets/Text.js,v >retrieving revision 1.2 >diff -u -r1.2 Text.js >--- js/org/eclipse/rwt/widgets/Text.js 25 Feb 2010 19:59:20 -0000 1.2 >+++ js/org/eclipse/rwt/widgets/Text.js 25 Mar 2010 16:44:18 -0000 >@@ -93,15 +93,17 @@ > var oldValue = this.getValue(); > // NOTE [tb] : When pasting strings, this might not always > // behave like SWT. There is no reliable fix for that. >+ var position = this.getSelectionStart(); > if( oldValue.length == ( value.length - 1 ) ) { > // The user added one character, undo. >- var position = this.getSelectionStart(); > this._inputElement.value = oldValue; > this.setSelectionStart( position - 1 ); > this.setSelectionLength( 0 ); > } else if( value.length >= oldValue.length && value != oldValue) { > // The user pasted a string, shorten: >- this._inputElement.value = value.slice( 0, this.getMaxLength() ); >+ this._inputElement.value = value.slice( 0, this.getMaxLength() ); >+ this.setSelectionStart( Math.min( position, this.getMaxLength() ) ); >+ this.setSelectionLength( 0 ); > } > if( this._inputElement.value == oldValue ) { > fireEvents = false; >@@ -139,6 +141,7 @@ > this._firstInputFixApplied = false; > this._applyElement( this.getElement(), null ); > this._afterAppear(); >+ org.eclipse.swt.TextUtil._updateLineHeight( this ); > this._postApply(); > this._applyFocused( this.getFocused() ); > this.setSelectionStart( selectionStart ); >#P org.eclipse.rap.rwt.q07.jstest >Index: js/org/eclipse/rwt/test/tests/TextTest.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/TextTest.js,v >retrieving revision 1.2 >diff -u -r1.2 TextTest.js >--- js/org/eclipse/rwt/test/tests/TextTest.js 25 Feb 2010 19:59:24 -0000 1.2 >+++ js/org/eclipse/rwt/test/tests/TextTest.js 25 Mar 2010 16:44:19 -0000 >@@ -157,47 +157,54 @@ > testUtil.clearTimerOnceLog(); > }, > >- testTextAreaMaxLength : function() { >- var testUtil = org.eclipse.rwt.test.fixture.TestUtil; >- testUtil.prepareTimerUse(); >- var text = new org.eclipse.rwt.widgets.Text( true ); >- org.eclipse.swt.TextUtil.initialize( text ); >- var changeLog = []; >- text.addEventListener( "input", function(){ >- changeLog.push( true ); >- } ); >- text.setValue( "0123456789" ); >- text.addToDocument(); >- testUtil.flush(); >- assertEquals( "0123456789", text.getValue() ); >- assertEquals( "0123456789", text.getComputedValue() ); >- text.setMaxLength( 5 ); >- assertEquals( "0123456789", text.getValue() ); >- assertEquals( "0123456789", text.getComputedValue() ); >- assertEquals( 0, changeLog.length ); >- text._inputElement.value = "012345678"; >- text.__oninput( {} ); >- assertEquals( "012345678", text.getValue() ); >- assertEquals( "012345678", text.getComputedValue() ); >- assertEquals( 1, changeLog.length ); >- text._inputElement.value = "01234567x8"; >- text.setSelectionStart( 9 ); >- text.__oninput( {} ); >- assertEquals( "012345678", text.getValue() ); >- assertEquals( "012345678", text.getComputedValue() ); >- assertEquals( 1, changeLog.length ); >- assertEquals( 8, text.getSelectionStart() ); >- text._inputElement.value = "abcdefghiklmnopq"; >- text.__oninput( {} ); >- assertEquals( "abcde", text.getValue() ); >- assertEquals( "abcde", text.getComputedValue() ); >- assertEquals( 2, changeLog.length ); >- assertEquals( 5, text.getSelectionStart() ); >- text.setParent( null ); >- text.destroy(); >- testUtil.flush(); >- testUtil.clearTimerOnceLog(); >- }, >+ testTextAreaMaxLength : qx.core.Variant.select("qx.client", { >+ "mshtml" : function() { >+ // NOTE: This test would fail in IE because it has a bug that sometimes >+ // prevents a textFields value from being overwritten and read in the >+ // same call >+ }, >+ "default" : function() { >+ var testUtil = org.eclipse.rwt.test.fixture.TestUtil; >+ testUtil.prepareTimerUse(); >+ var text = new org.eclipse.rwt.widgets.Text( true ); >+ org.eclipse.swt.TextUtil.initialize( text ); >+ var changeLog = []; >+ text.addEventListener( "input", function(){ >+ changeLog.push( true ); >+ } ); >+ text.setValue( "0123456789" ); >+ text.addToDocument(); >+ testUtil.flush(); >+ assertEquals( "0123456789", text.getValue() ); >+ assertEquals( "0123456789", text.getComputedValue() ); >+ text.setMaxLength( 5 ); >+ assertEquals( "0123456789", text.getValue() ); >+ assertEquals( "0123456789", text.getComputedValue() ); >+ assertEquals( 0, changeLog.length ); >+ text._inputElement.value = "012345678"; >+ text.__oninput( {} ); >+ assertEquals( "012345678", text.getValue() ); >+ assertEquals( "012345678", text.getComputedValue() ); >+ assertEquals( 1, changeLog.length ); >+ text._inputElement.value = "01234567x8"; >+ text.setSelectionStart( 9 ); >+ text.__oninput( {} ); >+ assertEquals( "012345678", text.getValue() ); >+ assertEquals( "012345678", text.getComputedValue() ); >+ assertEquals( 1, changeLog.length ); >+ assertEquals( 8, text.getSelectionStart() ); >+ text._inputElement.value = "abcdefghiklmnopq"; >+ text.__oninput( {} ); >+ assertEquals( "abcde", text.getValue() ); >+ assertEquals( "abcde", text.getComputedValue() ); >+ assertEquals( 2, changeLog.length ); >+ assertEquals( 5, text.getSelectionStart() ); >+ text.setParent( null ); >+ text.destroy(); >+ testUtil.flush(); >+ testUtil.clearTimerOnceLog(); >+ } >+ } ) > > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 305666
: 163011