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)

test.html (663 bytes) - added by Jakub Ś 11 years ago.
test_workaround.html (680 bytes) - added by Jakub Ś 11 years ago.

Download all attachments as: .zip

Change History (14)

Changed 11 years ago by Jakub Ś

Attachment: test.html added

comment:1 Changed 11 years ago by Jakub Ś

Status: newconfirmed
Version: 4.2.24.0

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

Changed 11 years ago by Jakub Ś

Attachment: test_workaround.html added

comment:2 Changed 11 years ago by Jakub Ś

To workaround you can use position:relative and left:-3000px;

comment:3 Changed 11 years ago by Jakub Ś

Keywords: Support added

comment:4 Changed 11 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:5 Changed 11 years ago by Piotrek Koszuliński

Status: assignedreview

Pushed t/11121 on dev and tests.

comment:6 Changed 11 years ago by Piotrek Koszuliński

Closed older duplicate in #9802.

comment:7 Changed 11 years ago by Marek Lewandowski

Status: reviewreview_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 Piotrek Koszuliński

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 Marek Lewandowski

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 Piotrek Koszuliński

Status: review_failedreview
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 Marek Lewandowski

Status: reviewreview_passed

Then solution is ok, and closes this issue.

comment:12 Changed 11 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.3.2
Resolution: fixed
Status: review_passedclosed

Fixed on master with git:ac648cc on dev and 81b848a on tests.

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