Opened 11 years ago
Closed 11 years ago
#11182 closed Bug (fixed)
[IE11] Editor crashes when IE works in Quirks Mode
Reported by: | Mathieu Marcotte | Owned by: | Piotrek Koszuliński |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.3.1 |
Component: | General | Version: | 4.3 |
Keywords: | Cc: |
Description
core/env.js contains the following lines :
// Internet Explorer 6.0+ if ( env.ie ) { // We use env.version for feature detection, so set it properly. if ( env.quirks || !document.documentMode ) version = parseFloat( agent.match( /msie (\d+)/ )[ 1 ] ); else version = document.documentMode;
I am getting a crash on "version = parseFloat( agent.match( /msie (\d+)/ )[ 1 ] );". The reason is that the Internet Explorer 11 user agent string does not contain the word "MSIE".
(The reason why it enters this "if" at all if because 'env.quirks' is true, although I am unusre why it would be the case, I have verified and the web page is running in "Edge" document mode. So maybe the real bug is incorrect detection of quirks mode?)
Attachments (2)
Change History (10)
comment:1 Changed 11 years ago by
Status: | new → pending |
---|
comment:2 Changed 11 years ago by
You are right in your assessment, the document does indeed run in quirks mode. The problem, in my case, is caused by an invalid or missing doctype.
Example :
<html> <head> <script src="http://ckeditor.com/apps/ckeditor/4.3/ckeditor.js?mwgvvh"></script> <script type="text/javascript"> function onLoaded() { CKEDITOR.replace('ck'); } </script> </head> <body onload="onLoaded()"> <textarea id="ck"></textarea> </body> </html>
The problem, however, is that I have very little control over the HTML : my goal is to perform inline edition on arbitrary content entered by customers, which may or may not be compliant HTML. If you decide this is not your problem then I will need to find another solution, but I think perhaps ckeditor should at least try not to crash?
The following works fine :
version = parseFloat((agent.match(/msie (\d+)/) || agent.match(/rv:(\d+)/))[ 1 ] );
comment:3 Changed 11 years ago by
Milestone: | → CKEditor 4.3.1 |
---|---|
Status: | pending → confirmed |
comment:4 Changed 11 years ago by
Owner: | set to Piotrek Koszuliński |
---|---|
Status: | confirmed → assigned |
Changed 11 years ago by
Attachment: | qm-ie5.html added |
---|
Changed 11 years ago by
Attachment: | qm-ie10plus.html added |
---|
comment:5 Changed 11 years ago by
Status: | assigned → review |
---|
I attached two samples:
- qm-ie5.html - using the meta tag it enforces IE5 QM
- qm-ie10plus.html - this is a normal page without doctype, so on IE10+ it falls into the "standard quirks mode", and on IE<9 in the old IE5 QM.
Based on manual tests I found out that CKEditor works perfectly fine on the standard QM when env.quirks is set to false. This QM is based on other modern browsers' QMs, so we can handle it as a standard mode.
I pushed t/11182 with a patch which disables env.quirks on IE10+ when site works in the standard QM. This makes editor works on IE11 and it fixes some issues on IE10 which were caused by QM patches which should not be applied.
comment:6 Changed 11 years ago by
Summary: | Internet Explorer 11 Crash → [IE11] Editor crashes when IE works in Quirks Mode |
---|
comment:7 Changed 11 years ago by
Status: | review → review_passed |
---|
Pushed a single commit that improves docs. Rebased on latest master.
comment:8 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Fixed on master with git:171b90f.
This does not happen on our IEs11. Before releasing CKEditor 4.3 we of course tested it on IE11 and it worked fine (we reported few minor bugs then), so it definitely wasn't in quirks mode. Could you attach a sample on which it happens? Maybe you've got some errors in HTML which turns IE11 into QM.