Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16127 closed defect (fixed)

IE10 EnterKeyHandling failures

Reported by: haysmark Owned by: bill
Priority: undecided Milestone: 1.6.2
Component: Editor Version: 1.7.4rc1
Keywords: dohfail Cc:
Blocked By: Blocking:

Description

Somehow the <BR> got in the wrong place...

     Error: doh._AssertFailure: assertEqual() failed:
 	expected
		testingCopyAndPastetestingCopyAndPastetestingCopyAndPaste<br/>
	but got
		testingCopyAndPaste<br/>testingCopyAndPastetestingCopyAndPaste

 with hint: 
		get('value')

     ERROR IN:
 		 function(){
							var d = new doh.Deferred();

							var br = dijit.byId("br");
							br.set("value", "");
							br.focus();
							
							doh.robot.mouseMoveAt(br.iframe, 500);
							doh.robot.mouseClick({left:true}, 500);
							doh.robot.keyPress(dojo.keys.BACKSPACE, 500, {});
								
							doh.robot.typeKeys("testingCopyAndPaste", 500);
							doh.robot.keyPress("a", 500, metaKey);	// select all
							doh.robot.keyPress("c", 500, metaKey);	// copy
							doh.robot.keyPress("v", 500, metaKey);	// paste
							doh.robot.keyPress("v", 500, metaKey);	// paste
							doh.robot.keyPress("v", 500, metaKey);	// paste
							doh.robot.keyPress(dojo.keys.ENTER, 500, {shift: false});
							doh.robot.sequence(d.getTestCallback(function(){
								// get('value') should call the post-filter which recombines the separate <p> nodes into bigger
								// paragraphs.
								var value = br.get('value');
								value = value.replace(/ /g, "");
								value = value.replace(/\xA0/g, "");
								if(dojo.isWebKit && !dojo.isMac){
									// Work around webkit bug: 
									// http://code.google.com/p/chromium/issues/detail?id=106551
									// Should hopefully be fixed in Chrome 19.
									value = value.replace(/\n/g, "");
									value = value.replace(/\r\f/g, "");
								}
								
								// Safari may end with a trailing/extra br, so we need to remove it.
								if(/<br\/><br\/>$/.test(value)){
									value = value.substring(0, value.length - 5);
								}
								doh.is('testingCopyAndPastetestingCopyAndPastetestingCopyAndPaste<br/>',
										value,
										"get('value')");
							}), 1000);
							return d;
						}
 FAILED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::blockNodeForEnter=BR::copy and paste 7184 ms
 PASSED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::blockNodeForEnter=BR::copy and paste split 9182 ms
 ------------------------------------------------------------
 GROUP "Split tests" has 9 tests to run
     Error: doh._AssertFailure: assertTrue('false') failed with hint: 
 		start

     ERROR IN:
 		 function(){
							var d = new doh.Deferred();
							// The initial input was a div with a line of text with a bold tag in the middle.
							// we want to focus on the bold and enter there, splitting it.
							var editor = dijit.byId("div2");
							dojo.window.scrollIntoView(editor.iframe);
							var node = dojo.byId("boldLine0", editor.document);

							doh.robot.mouseMoveAt(editor.iframe, 500);
							doh.robot.mouseClick({left:true}, 500);

							doh.robot.sequence(function(){
								editor._sCall("selectElementChildren", [node]);
							}, 500);
							
							//Keyboard kill the selection and shift position between i and s.
							if(!dojo.isMoz || dojo.isMac){doh.robot.keyPress(dojo.keys.RIGHT_ARROW, 100, {}); }
							doh.robot.keyPress(dojo.keys.LEFT_ARROW, 100, {});
							doh.robot.keyPress(dojo.keys.ENTER, 500);

							doh.robot.sequence(d.getTestCallback(function(){
								// Do tests here.
								var val = editor.get("value");
								// Check that it split the is into two and that the bold and div were properly split.
								doh.t(val.indexOf("It <b id=\"boldLine0\">i</b></div>") > 0, "start");
								doh.t(val.indexOf("<div><b>s</b>") > 0, "end");
							}), 500);

							return d;
						}
 FAILED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::Split tests::Test div line split 2915 ms
 PASSED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::Split tests::Test div line split style clone 2908 ms
 PASSED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::Split tests::Test div line split font clone 2875 ms
 PASSED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::Split tests::copy and paste DIV 7187 ms
 PASSED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::Split tests::copy and paste DIV split 9186 ms
     Error: doh._AssertFailure: assertTrue('false') failed with hint: 
 		start

     ERROR IN:
 		 function(){
							var d = new doh.Deferred();
							// The initial input was a div with a line of text with a bold tag in the middle.
							// we want to focus on the bold and enter there, splitting it.
							var editor = dijit.byId("p2");
							dojo.window.scrollIntoView(editor.iframe);
							var node = dojo.byId("boldLine2", editor.document);
							
							doh.robot.mouseMoveAt(editor.iframe, 500);
							doh.robot.mouseClick({left:true}, 500);

							doh.robot.sequence(function(){
								editor._sCall("selectElementChildren", [node]);
							}, 500);
							
							//Keyboard kill the selection and shift position between i and s.
							if(!dojo.isMoz || dojo.isMac){doh.robot.keyPress(dojo.keys.RIGHT_ARROW, 100, {}); }
							doh.robot.keyPress(dojo.keys.LEFT_ARROW, 100, {});
							doh.robot.keyPress(dojo.keys.ENTER, 500);

							doh.robot.sequence(d.getTestCallback(function(){
								// Do tests here.
								var val = editor.get("value");
								// Check that it split the is into two and that the bold and div were properly split.
								doh.t(val.indexOf("It <b id=\"boldLine2\">i</b></p>") > 0, "start");
								doh.t(val.indexOf("<p><b>s</b>") > 0, "end");
							}), 500);

							return d;
						}
 FAILED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::Split tests::Test p line split 2955 ms
 PASSED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::Split tests::shift enter to replace all content in p 1523 ms
 PASSED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::Split tests::copy and paste P 7186 ms
 PASSED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::Split tests::copy and paste P split 9160 ms
 PASSED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html 71402 ms

Change History (9)

comment:1 Changed 7 years ago by haysmark

Keywords: dohfail added

comment:2 Changed 7 years ago by bill

Milestone: tbd1.8.2

Bulk update of IE10 tickets to 1.8.2, as per meeting. Backports to 1.4 will be handled in a separate ticket. If this ticket just requires a test update, it can be rescheduled for milestone 1.9, and checked into trunk only.

comment:3 Changed 7 years ago by haysmark

Version: 1.8.01.7.4rc1

Also in 1.7.

comment:4 Changed 7 years ago by bill

Owner: set to bill
Status: newassigned

comment:5 Changed 7 years ago by bill

Resolution: fixed
Status: assignedclosed

In [30091]:

Editor EnterKeyHandling IE10 fixes:

  • There's some code that was needed for IE9 (refs #14949); turns out it's also needed for IE10
  • There's also a section of IE code that apparently isn't needed on IE10, so made that specific to IE <= 9.
    • IE10 has auto-correction, so splitting the word "is" into "i" an "s" will cause the "I" to capitalize; avoid that browser-specific behavior by capitalizing it to begin with.
  • Miscellaneous fixes to test file.


Fixes #16127 on trunk !strict.

comment:12 Changed 7 years ago by bill

In [30092]:

Editor EnterKeyHandling IE10 fixes:

  • There's some code that was needed for IE9 (refs #14949); turns out it's also needed for IE10
  • There's also a section of IE code that apparently isn't needed on IE10, so made that specific to IE <= 9.
    • IE10 has auto-correction, so splitting the word "is" into "i" an "s" will cause the "I" to capitalize; avoid that browser-specific behavior by capitalizing it to begin with.
  • Miscellaneous fixes to test file.


Fixes #16127 on 1.8 branch !strict.

comment:13 Changed 7 years ago by bill

Milestone: 1.8.21.7.5

In [30247] backport EnterKeyHandling code and test fixes from [30091], fixes #16127 on 1.7 branch !strict

comment:14 Changed 7 years ago by bill

In [30248]:

Backport [28185] EnterKeyHandling IE9 fixes to 1.6 branch, fixes #14949 on 1.6 branch !strict. For some reason though I had to setup the onpaste listener on editor.document.body rather than on editor.document, like 1.7 does.

Backport EnterKeyHandling IE10 code and test fixes from [30091] to 1.6 branch. Fixes #16127 on 1.6 branch !strict

comment:15 Changed 7 years ago by bill

Milestone: 1.7.51.6.2
Note: See TracTickets for help on using tickets.