Ticket #8578 (closed Bug: expired)

Opened 3 years ago

Last modified 10 months ago

this.getWindow().$.getComputedStyle(this.$, \"\") is null

Reported by: SSchmitz99 Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Firefox Cc:

Description

I an seeing the following error: this.getWindow().$.getComputedStyle(this.$, \"\") is null

userAgent:Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0

The code in question is located at element.js line 502.

I am recommending that the code change from:

return this.getWindow().$.getComputedStyle( this.$, ).getPropertyValue( propertyName );

to

return this.getWindow().$.getComputedStyle( this.$, ) ? this.getWindow().$.getComputedStyle( this.$, ).getPropertyValue( propertyName ) : null;

that will fix the problem.

thanks,

Scott Schmitz.

Attachments

getComputedStyle_null.png (34.5 KB) - added by wwalc 2 years ago.
hc_error.png (50.5 KB) - added by wwalc 2 years ago.
hc_error2.png (48.4 KB) - added by wwalc 2 years ago.
_mytest4.html (7.5 KB) - added by j.swiderski 21 months ago.
_mytest3.html (7.5 KB) - added by j.swiderski 21 months ago.

Change History

comment:1 Changed 3 years ago by j.swiderski

  • Status changed from new to pending

Could you give us more information here?

First of all what scenario is causing this error? Could you provide a reduced sample HTML file showing the problem?

Second what version of CKEditor are you using?

Does your issue has something to do with bug #7856? Are you getting your bug in similar or the same scenario?

comment:2 Changed 3 years ago by SSchmitz99

I have been unable to reproduce this problem under controlled conditions. However, with logging, I am able to see 2-3 of these errors per day happening to my users. Really wish I could put a try catch and catch these errors before they cause complete failure to our system - but oh well...

We have several thousand users and they are all using CKEditor. I have error logging, so every error that happens on any of those users computers is reported back to me. However, the information that is reported back is somewhat limited. I do know that this is specific to Firefox. Does not happen with IE and does not happen with Chrome.

I have spoken with several of my customers (who are not tech savvy) who have had these errors and the best I can determine is that this error is caused when people are copying / pasting or dragging & dropping Microsoft Word styled text into CKEditor. So, I believe it has something to do with the funky styling that MS Word documents have. Currently, I strip all styling from copy/paste as well as drag/drop in order to minimize the possibility of problems. However, this alone did not resolve the problem.

I am using CKEditor 3.6.2

I made the change that I have recommended several weeks ago and am no longer seeing these errors in my log. So, I believe this has resolved the problem. I was getting 2-3 of these errors a day and now I do not see any of these errors any more.

I am familiar with #7856 and I do not believe that this is the same bug. However, I can not say one way or the other on this. One thing that I can say is that the way I have CKEditor configured is that I do not display the context sensitive menu from CKEditor and instead have the one for Firefox display when people right click. I want to have the default spell checking in Firefox to work.

Scott Schmitz.

comment:3 Changed 3 years ago by j.swiderski

  • Status changed from pending to closed
  • Resolution set to duplicate

This is a DUP of #7856

the one for Firefox display when people right click

@SSchmitz99 I think this is the key to understanding the bug. Thank you.

I have added a ciomment in #7856 about your findings.

comment:4 Changed 2 years ago by wwalc

  • Keywords Firefox added
  • Status changed from closed to reopened
  • Resolution duplicate deleted

I'm reopening the ticket as the bug has nothing to do with the context menu. This error is about improper assumption that getComputedStyle() never returns null.

This isn't true, because there is at least one case in FF where null is returned: https://bugzilla.mozilla.org/show_bug.cgi?id=548397

I just faced this issue when checking CKEditor 4 in Drupal 7. The error is happening when CKEditor loads (while HC detection). I'm attaching some screenshots. Imho the solution for this issue is plain simple as the reporter suggested, do not call getPropertyValue() on a null value.

Last edited 2 years ago by wwalc (previous) (diff)

Changed 2 years ago by wwalc

Changed 2 years ago by wwalc

Changed 2 years ago by wwalc

comment:5 Changed 2 years ago by wwalc

#9288 was marked as duplicate. #9288 Contains some detailed information about the issue as well as a link to a video.

comment:6 Changed 2 years ago by Reinmar

Proposed patch is incorret. It bypasses the problem and may lead to bigger problems.

Current situation:

  • FF returns null.
  • There's an error which stops execution of some code.
  • Everything seems to work (is this right? UPDATE: I see in #9288 that not, but at least it's not so bad ;)).

After we'll apply that patch:

  • FF returns null.
  • element#getComputedStyle returns null.
  • The rest of our code is trying to see a string, but instead there's a null, which is propagated further.
  • We can't be sure what'll be caused by this situation. It's possible that even entire editor will be blown up.

So we should rather avoid having FF returning null from native getComputedStyle than allowing silent errors. We need to know the exact case - which element#getComputedStyle call fails.

Last edited 2 years ago by Reinmar (previous) (diff)

comment:7 Changed 2 years ago by DaveGYNWA

Hi guys - if you are looking for a reproducible scenario where this issue occurs, then you can use jquery UI tabs. Create 2 tabs and place a ckeditor textarea on the 2nd tab - open the page, and the error appears. Put the ckeditor on the 1st tab, refresh the page and no error appears.

I used the patch at the start of this thread on the 3.6 codeline (3.6.2) and it works okay. Am looking into ckeditor 4 now, and issue occurs there too....not trying the patch yet.

comment:8 Changed 2 years ago by Reinmar

Small addition to my last comment. Accidentally I reproduced this issue (on v4 try initializing editor whose parent has display:none), so I tested proposed patch (in fact its corrected version - return '' rather than null). The result was even more scary than I anticipated - complete FF crash because of some inf recursion.

comment:9 Changed 22 months ago by mkamyszek

I'm finding this error in FF 18.0 running in safe mode. Has anyone found a solution for this? Or better yet, has CK been able to reproduce and resolve?

Last edited 22 months ago by mkamyszek (previous) (diff)

comment:10 Changed 21 months ago by j.swiderski

  • Status changed from reopened to pending

Create 2 tabs and place a ckeditor textarea on the 2nd tab

Accidentally I reproduced this issue (on v4 try initializing editor whose parent has display:none)

Both comments talk about same thing CKEditor being dispalyed in display:none element. Please check the attached files - I have tried running them with CKEditor 4, CKEditor 3, in safe mode and in HC mode.

None resulted in error. There has to be something more.

@DaveGYNWA, @Reinmar, @wwalc or anyone else - could you have a look at these samples and tell what have I missed?

NOTE: I have checked this issue in FF 18.0.2. Perhaps this problem has been resolved in that version?

Changed 21 months ago by j.swiderski

Changed 21 months ago by j.swiderski

comment:11 Changed 21 months ago by DaveGYNWA

Hey - sorry for delay in getting back on this. Not had a chance to try this myself but will get to it this weekend. I'll let you know results.

comment:12 Changed 10 months ago by Reinmar

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