Ticket #7193 (closed Bug: duplicate)

Opened 4 years ago

Last modified 2 years ago

IE9 - JS error in console while adding new paragraphs before <hr/>

Reported by: krst Owned by: garry.yao
Priority: Normal Milestone:
Component: General Version: 3.5.1
Keywords: IE9 Cc:

Description

Environment

IE9

TC

  • clear editor content
  • insert <hr />
  • set cursor at the beginning of paragraph that contains horizontal line - press cursor UP key (little cursor should be blinking at the beginning of line)
  • press enter

Expected result

New paragraph is added before horizontal line

Actual result

New paragraph is added before line, but in console error is thrown:

SCRIPT5007: Unable to get value of the property 'insertBeforeMe': object is null or undefined 
ckeditor.js, line 32 character 214

Attachments

7193.patch (1.9 KB) - added by garry.yao 4 years ago.
7193_2.patch (6.6 KB) - added by garry.yao 4 years ago.
7193_3.patch (2.2 KB) - added by garry.yao 4 years ago.

Change History

comment:1 follow-up: ↓ 2 Changed 4 years ago by garry.yao

  • Status changed from new to pending

set cursor at the beginning of paragraph that contains horizontal line...

Shouldn't the inserted <hr> should appears outside of paragraph, how to reach here?

comment:2 in reply to: ↑ 1 Changed 4 years ago by krst

Replying to garry.yao:

set cursor at the beginning of paragraph that contains horizontal line...

Shouldn't the inserted <hr> should appears outside of paragraph, how to reach here?

using cursor keys on keyboard, when caret is blinking below <HR> press key "left".

comment:3 Changed 4 years ago by krst

Still occurs under IE9Final CKEditor rev 6559

comment:4 Changed 4 years ago by wwalc

  • Status changed from pending to confirmed
  • Milestone set to CKEditor 3.5.3

I have reproduced this error by following the original TC:

SCRIPT5007: Unable to get value of the property 'insertBeforeMe': object is null or undefined 
range.js, line 163 character 5

It looks like this is the only way we have found so far how to trigger this JavaScript bug (quite an edge case), but in any case it would be nice to do something to protect against such errors, just to be safe.

comment:5 Changed 4 years ago by wwalc

  • Priority changed from Low to Normal

Changed 4 years ago by garry.yao

comment:6 Changed 4 years ago by garry.yao

  • Owner set to garry.yao
  • Status changed from confirmed to review

Propose a fake to fix it.

comment:7 Changed 4 years ago by wwalc

  • Status changed from review to review_failed

Is there any other way to fix it? <hr> element may be styled just like any other elements, e.g. with

hr {
  border: 0;
  width: 80%;
  color: #f00;
  background-color: #f00;
  height: 5px;
}

By introducing a fake element we are losing the wysiwyg experience and move one step back.

Can we perhaps simply check the reason of the following error in range.js?

'insertBeforeMe': object is null or undefined 
range.js, line 163 character 5

Changed 4 years ago by garry.yao

comment:8 Changed 4 years ago by garry.yao

  • Status changed from review_failed to review

The error was caused by exactly the IE9 issue described in #7186, and considering it's quite an obvious issue, we'd better providing a solution for it.

New patch allows fake elements to be styled in their real type.

comment:9 Changed 4 years ago by fredck

  • Status changed from review to review_failed

Fake elements is not the way to go for it here as well. It's an ugly workaround.

I'm sure we're able to handle <hr> on wywiwyg view. We're already doing lots of caret position checks. Aren't we able to do the same in this case?

Changed 4 years ago by garry.yao

comment:10 Changed 4 years ago by garry.yao

  • Status changed from review_failed to review

comment:12 follow-up: ↓ 13 Changed 4 years ago by Saare

  • Status changed from review to review_failed

Arrow and ESC keys should still be available for navigation around the <hr>, e.g. go above it.

comment:13 in reply to: ↑ 12 Changed 4 years ago by garry.yao

Replying to Saare:

Arrow and ESC keys should still be available for navigation around the <hr>, e.g. go above it.

I've tried with no access, the buggy hr is cursor sticky.

comment:14 Changed 4 years ago by wwalc

  • Milestone CKEditor 3.5.3 deleted

comment:15 Changed 2 years ago by j.swiderski

DUP of #8395

comment:16 Changed 2 years ago by j.swiderski

  • Status changed from review_failed to closed
  • Resolution set to duplicate
Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy