Opened 14 years ago
Closed 13 years ago
#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: | ||
Blocked by: | Blocking: |
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 (1)
Change History (4)
Changed 14 years ago by
Attachment: | jquery-color-test.zip added |
---|
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Thanks a lot! It really works on firefox. Unfortunately IE6-7 don't like this fix (as usual :) ). However I think this was a good step towards fixing it completely.
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
There's no test case, but the internal code uses elem.ownerDocument.defaultView now so it should be fixed.
Note: See
TracTickets for help on using
tickets.
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