Ticket #4203 (closed bug: fixed)
firefox: color values on tags inside a frame are #00000 unless css is inline
| Reported by: | jq_johan | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 1.4 |
| Component: | core | Version: | 1.3.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
I have a page with an iframe. I am accessing some tags inside the frame but their color values are 0, on firefox.
$("iframe").contents().find("div"); getting the elements ..... $(val).css("color"); getting their color values .....
Attachments
Change History
comment:1 Changed 4 years ago by Calamari
I cant sleep so I did some research on that issue (and fixed it). It seems that the first line of jQuery.curCSS function that is
var style = elem.style;
returns the style of an element that matches in the document context or no style at all. So far, so good. Now the function enteres the
if ( defaultView.getComputedStyle )
and begins doing its magic, and no there is the clue: defaultView was set to document.defaultView, so that's the crux of the matter.
Because I have no permission for uploading something to svn here is the change, that you have to do, in order to fix this bug:
there is a line
| {}, |
can be deleted and in curCSS you need to add the following line to the var definitions:
defaultView = elem.ownerDocument.defaultView;
Should work now. Hopefully I could help then my sleeplessness wasn't in vain.
Cheers, Georg Tavonius
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

