settting the background color of an iframe

RESOLVED INVALID

Status

()

Core
Layout: HTML Frames
RESOLVED INVALID
16 years ago
16 years ago

People

(Reporter: rvj, Assigned: Eric Vaughan)

Tracking

Trunk
Other
Other
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: INVALID?)

Attachments

(3 attachments)

(Reporter)

Description

16 years ago
Seem unable to set the background color of a XUL iframe. Should this currently 
work ?

<iframe id='window'  src="url" style="background-color:red;" />

If I load a short document (xml or gif) an implicit white background of a 200px 
is created.

Ihave tried using the computed style height to return the actual height of the 
document but it is not sufficiently accurate to dynamically adjust the iframe  
height e.g. it cuts off the last table row to a greater or lesser extent.
What would you expect setting the background color of an iframe to do?  The
entire contents of the iframe are another document, which has its own background.
(Reporter)

Comment 2

16 years ago
First of all let me state that this is a xul question.

I am trying to get rid of the current white space (iframe canvas?) which occurs 
when the content of a document is smaller than the default iframe height.

I would expect it to set the underlying background color of the iframe,  not 
the document, which as you say has its own color background.

This white space problem goes way if I can set the height of the iframe exactly 
to the height of the document. 

But as I said earlier getcomputedstyleheight for the document is currently not 
accurate enough so I lose the bottom edge.


So back to your question - I would expect it to set the background color of the 
iframe (canvas)in an identical manner to setting the background color of the 
window (canvas). 



<window style="">

<script>

function setbackground()
{
     // get document background color
     // set iframe background color  }


</script>

<iframe style="" />

</window>


(Reporter)

Comment 3

16 years ago
Created attachment 54391 [details]
iframe background color testcase
(Reporter)

Comment 4

16 years ago
Created attachment 54392 [details]
iframe background color testcase
(Reporter)

Comment 5

16 years ago
Created attachment 54393 [details]
icon for test case
(Reporter)

Comment 6

16 years ago
apologies for duplicate testcase attachment

testcase to show example of document content/height less than iframe height but 
no ability to change iframe canvas color

the same problem occurs with other iframe src's for example xml+css documents 
which do not fill the iframe
->HTMLFrames, although it's not clear whether this should actually work
Assignee: dbaron → pollmann
Component: Style System → HTMLFrames
QA Contact: ian → amar

Updated

16 years ago
Attachment #54391 - Attachment mime type: text/plain → application/xml

Updated

16 years ago
Attachment #54392 - Attachment mime type: text/plain → application/xml

Updated

16 years ago
Attachment #54391 - Attachment mime type: application/xml → text/plain
->evaughan
Assignee: pollmann → evaughan
Whiteboard: INVALID?
(Reporter)

Comment 9

16 years ago
PS

While in the past it may have been an unsupported property for html pages, I 
would suggest that as an XUL widget it should be provided to be consistant with 
all other XUL widgets.

Otherwise there is no means of removing the white space.
(Reporter)

Comment 10

16 years ago
PPS 

I assume that when bug 105821 is resolved that the CSS background-color 
property will be used to set transparency. So for example if a short xml 
document does not fill the xul iframe flex area, the XUL window color will be 
displayed

<WINDOW  style="background-color:red">
<IFRAME  flex="1"  src="http://../small.xml" style="background-
color:transparent"/>
</WINDOW>

I assume that the same approach will apply for other background colors

<IFRAME   src="http://../small.xml" style="background-color:red"/>

Any chance of this being implimented as a partial interim solution? 

i.e. it appears that fixing iframe transparency is substantially  more complex 
and is not expected before 1.0 at earliest

I'm marking this INVALID because a real solution has landed. See bug 50623 for
more information.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → INVALID
(Reporter)

Comment 12

16 years ago
OK but this makes it impossible to set the background of an iframe 
independently of the canvas?

For example, if an iframe is used to display to overlay a gif with transparent 
areas.

<iframe style="background-color:red" src="overlay.gif" />

It seems that only the <iframe> element which will have this limitation?


The remaining fix for bug 50623, which I will check in today or tomorrow, will
fix "background-color" on IFRAMEs so that everything you want to do will work :-).
You need to log in before you can comment on or make changes to this bug.