Opened 13 years ago
Closed 11 years ago
#8578 closed Bug (expired)
this.getWindow().$.getComputedStyle(this.$, \"\") is null
Reported by: | scott schmitz | 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 (5)
Change History (17)
comment:1 Changed 13 years ago by
Status: | new → pending |
---|
comment:2 Changed 13 years ago by
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 13 years ago by
Resolution: | → duplicate |
---|---|
Status: | pending → closed |
comment:4 Changed 12 years ago by
Keywords: | Firefox added |
---|---|
Resolution: | duplicate |
Status: | closed → reopened |
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.
Changed 12 years ago by
Attachment: | getComputedStyle_null.png added |
---|
Changed 12 years ago by
Attachment: | hc_error.png added |
---|
Changed 12 years ago by
Attachment: | hc_error2.png added |
---|
comment:5 Changed 12 years ago by
comment:6 Changed 12 years ago by
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
returnsnull
.- 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.
comment:7 Changed 12 years ago by
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 12 years ago by
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 12 years ago by
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?
comment:10 Changed 12 years ago by
Status: | reopened → 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 12 years ago by
Attachment: | _mytest4.html added |
---|
Changed 12 years ago by
Attachment: | _mytest3.html added |
---|
comment:11 Changed 12 years ago by
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 11 years ago by
Resolution: | → expired |
---|---|
Status: | pending → closed |
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?