Opened 13 years ago

Closed 12 years ago

#7193 closed Bug (duplicate)

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

Reported by: Krzysztof Studnik 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 (3)

7193.patch (1.9 KB) - added by Garry Yao 13 years ago.
7193_2.patch (6.6 KB) - added by Garry Yao 13 years ago.
7193_3.patch (2.2 KB) - added by Garry Yao 13 years ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 13 years ago by Garry Yao

Status: newpending

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 13 years ago by Krzysztof Studnik

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 13 years ago by Krzysztof Studnik

Still occurs under IE9Final CKEditor rev 6559

comment:4 Changed 13 years ago by Wiktor Walc

Milestone: CKEditor 3.5.3
Status: pendingconfirmed

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 13 years ago by Wiktor Walc

Priority: LowNormal

Changed 13 years ago by Garry Yao

Attachment: 7193.patch added

comment:6 Changed 13 years ago by Garry Yao

Owner: set to Garry Yao
Status: confirmedreview

Propose a fake to fix it.

comment:7 Changed 13 years ago by Wiktor Walc

Status: reviewreview_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 13 years ago by Garry Yao

Attachment: 7193_2.patch added

comment:8 Changed 13 years ago by Garry Yao

Status: review_failedreview

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 13 years ago by Frederico Caldeira Knabben

Status: reviewreview_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 13 years ago by Garry Yao

Attachment: 7193_3.patch added

comment:10 Changed 13 years ago by Garry Yao

Status: review_failedreview

comment:12 Changed 13 years ago by Sa'ar Zac Elias

Status: reviewreview_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 13 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 13 years ago by Wiktor Walc

Milestone: CKEditor 3.5.3

comment:15 Changed 12 years ago by Jakub Ś

DUP of #8395

comment:16 Changed 12 years ago by Jakub Ś

Resolution: duplicate
Status: review_failedclosed
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy