#14949 closed defect (fixed)
EnterKeyHandling blockNodeForEnter=BR failure on IE9
Reported by: | bill | Owned by: | Jared Jurkiewicz |
---|---|---|---|
Priority: | undecided | Milestone: | 1.6.2 |
Component: | Editor | Version: | 1.7.2 |
Keywords: | dohfail | Cc: | |
Blocked By: | Blocking: |
Description
GROUP "blockNodeForEnter=BR" has 4 tests to run PASSED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::blockNodeForEnter=BR::wait for editors to load 426 ms PASSED test: ../../dijit/tests/editor/robot/EnterKeyHandling.html::blockNodeForEnter=BR::type in some text 6543 ms _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 6151 ms
Change History (14)
comment:1 Changed 9 years ago by
Keywords: | dohfail added |
---|---|
Owner: | set to Jared Jurkiewicz |
Status: | new → assigned |
comment:2 Changed 9 years ago by
This appears to be a bug in the IE range selection API that rears its ugly head when copy/paste are used. For some reason IE doesn't update its internal range selection on paste. Clicking, moving the key, anything else will. I'm trying to find a workaround that doesn't involve falling back to the old windows selection API
comment:3 Changed 9 years ago by
Figured out a workaround. As this is only an issue with the onpaste event, it can be managed there. The older (proprietary) range code IE has can be used to get IE to update its internal range/selection state so the WC3 range API continues to work properly. It's a bit odd of a workaround, but it does work. It's a matter of 'moving' the range back one characterm then forward one character, on each paste. This gets IE to update the W3C data structures it has so that then the paste action works.
comment:5 Changed 9 years ago by
Milestone: | tbd → 1.7.3 |
---|
comment:7 Changed 9 years ago by
Will this work if pasting into the very beginning of the document, or into an empty document? You presumably can't move one character before the beginning of the selection, although you could shrink the selection by one character. I'm not sure which of those your code is doing.
comment:8 Changed 9 years ago by
Yes, it will work pasting at the beginning of the document. I tried it. That is, in fact a lot of what the test really does. And that's exactly what the code I put in does, it's messing with the end of the pasted content. The old selection api 'works' with regard to cursor position after a paste. It's the W3C one that initially doesn't until you kick IE wiht the old api to get it to update.
comment:9 Changed 9 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
[28186] changed dojo/_base/sniff to dojo/sniff but I don't see that module in the 1.7 branch.
comment:14 Changed 8 years ago by
Milestone: | 1.7.3 → 1.6.2 |
---|
Jared, hopefully you can look at this since you just fixed the chrome test failure.