Opened 11 years ago
Closed 11 years ago
#11121 closed Bug (fixed)
[FF] HC mode enabled when editor loaded in hidden iframe
Reported by: | RichardD | Owned by: | Piotrek Koszuliński |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.3.2 |
Component: | General | Version: | 4.0 |
Keywords: | Support | Cc: |
Description
As reported in the forums: http://ckeditor.com/forums/CKEditor/Problem-with-icons-showing-up-in-Firefox-using-thickbox
Displaying a CKeditor instance inside an iframe which is initially set to "display:none" incorrectly triggers the HC detection, and none of the toolbar icons show up.
This seems to be related to Firefox bug 548397 - "window.getComputedStyle() returns null inside an iframe with display: none". https://bugzilla.mozilla.org/show_bug.cgi?id=548397
Looking at _bootstrap.js, line 24, the problem is obvious:
CKEDITOR.env.hc = hcDetect.getComputedStyle( 'border-top-color' ) == hcDetect.getComputedStyle( 'border-right-color' );
Since getComputedStyle is returning null, this test is setting env.hc to true.
Attachments (2)
Change History (14)
Changed 11 years ago by
comment:1 Changed 11 years ago by
Status: | new → confirmed |
---|---|
Version: | 4.2.2 → 4.0 |
Changed 11 years ago by
Attachment: | test_workaround.html added |
---|
comment:3 Changed 11 years ago by
Keywords: | Support added |
---|
comment:4 Changed 11 years ago by
Owner: | set to Piotrek Koszuliński |
---|---|
Status: | confirmed → assigned |
comment:7 Changed 11 years ago by
Status: | review → review_failed |
---|
I've pushed minor change to tests code.
One thing still remains - now we have issue in reversed situation:
in FF having High Contrast on, when we will follow this ticket TC, we will end up with CKEDITOR.env.hc
evaluated to false
. (It works fine with IE10 though)
Can we still fix that? Maybe with diffrent approach, focusing on bg images rather than borders, like in SO topic?
comment:8 Changed 11 years ago by
So what's the value returned by getComputedStyle if high contrast is on? I mean the normal case - not a hidden iframe case, which we can ignore.
comment:9 Changed 11 years ago by
in normal case it's correct, the only one invalid situation is when editor is not displayed - even if HC is on it will tell that HC is off
comment:10 Changed 11 years ago by
Status: | review_failed → review |
---|---|
Summary: | Firefox HC Detection problem → [FF] HC mode enabled when editor loaded in hidden iframe |
Then I think that it is a situation which we can accept. When iframe is hidden getComputedStyle will always return useless values, so most of short ways for HC discovery will fail. The goal was to fix the far more important case when env.hc is set to true even though HC is not enabled.
comment:11 Changed 11 years ago by
Status: | review → review_passed |
---|
Then solution is ok, and closes this issue.
comment:12 Changed 11 years ago by
Milestone: | → CKEditor 4.3.2 |
---|---|
Resolution: | → fixed |
Status: | review_passed → closed |
Fixed on master with git:ac648cc on dev and 81b848a on tests.
I was able to reproduce this particular scenario from CKEditor 4.0.
In CKEditor 4.0 beta error was thrown:
this.getWindow(...).$.getComputedStyle(...) is null
It works fine in CKEditor 3.x.
To reproduce just put test.html in samples folder and open it in a browser