windbreakerdoss / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

Dynamic embed in Firefox creates a space underneath the the flash movie. #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Code at: http://www.kroix.com/swfO/space.html Displays correctly in IE6
& 7, Firefox has a break between the two divs
2.
3.

What is the expected output? What do you see instead?
The IE output is correct the divs should be touching each other, no break.

What version of the product are you using? On what operating system?
SWFObject v2.0 rc4
Windows XP sp2
IE6,7 FF2

Please provide any additional information below.

Original issue reported on code.google.com by goo...@hockeyclubhouse.com on 4 Mar 2008 at 10:11

GoogleCodeExporter commented 9 years ago

Original comment by bobbyvandersluis on 5 Mar 2008 at 9:02

GoogleCodeExporter commented 9 years ago
Again, thanks for the test page, great to test/debug this issue!

Interesting case. When I test the page I can see a consistent 'space' with the 
height of 4px in diverse browsers: 
Firefox, Safari and Opera.

I think that this is an authoring issue. When you add a container element like 
a DIV around your to be replaced 
content (which will be replaced by the OBJECT element), and set a fixed height 
on it the issue disappears. So 
obviously the OBJECT element needs to inherit its correct height from its 
container element.

When we look at the specs the OBJECT element should be able to be used as both 
an inline and a block level 
HTML element. However, as I noticed earlier on for static publishing, the 
validation tools don't digg it if you 
use the OBJECT element directly within the BODY element. I'm pretty sure that 
this has something to do with 
it, although I'm not exactly sure what the interpretation rules should be.

I'll digg deeper into this. Maybe this means we have to adjust the samples for 
dynamic publishing, and add a 
DIV element around them by default.

Original comment by bobbyvandersluis on 5 Mar 2008 at 10:22

GoogleCodeExporter commented 9 years ago
Here is what I found out so far:

http://www.w3.org/TR/html401/sgml/dtd.html#block
- The OBJECT element is of a type "flow" which means it is either a "block" 
level element or an "inline" level 
element
- Quote: "OBJECT is used to embed objects as part of HTML pages PARAM elements 
should precede other 
content. SGML mixed content model technicality precludes specifying this 
formally ...", uhm, ok.

When validating the OBJECT element, nested directly inside the BODY element, 
with XHTML1.0 strict, the W3C 
validator shows the following error message:

'document type does not allow element "object" here; missing one of "p", "h1", 
"h2", "h3", "h4", "h5", "h6", 
"div", "address", "fieldset", "ins", "del" start-tag.'

Furthermore is says:

'The mentioned element is not allowed to appear in the context in which you've 
placed it; the other mentioned 
elements are the only ones that are both allowed there and can contain the 
element mentioned. This might 
mean that you need a containing element, or possibly that you've forgotten to 
close a previous element. One 
possible cause for this message is that you have attempted to put a block-level 
element (such as "<p>" or 
"<table>") inside an inline element (such as "<a>", "<span>", or "<font>").'

Using the WDG validator (http://htmlhelp.com/tools/validator/) we get a similar 
error:

"Error: element object not allowed here; possible cause is an inline element 
containing a block-level element"

Clicking trough it's documentation, there is the following interesting note:

"The OBJECT element is most useful as a BODY element and can be contained 
within either inline or block-
level elements. The content of the OBJECT should be elements that can be 
contained within OBJECT's parent 
element. For example, an A element containing an OBJECT should not have any 
block-level elements as the 
content of the OBJECT."

Still I don't have the feeling that we do something syntactically incorrect 
here, and I don't feel like updating 
the examples until proven otherwise.

Original comment by bobbyvandersluis on 5 Mar 2008 at 12:48

GoogleCodeExporter commented 9 years ago
The is issue here is with strict DTD, which creates the same problem with any 
images
displayed within strict pages. The solution is rather simple, in your CSS, 
declare:

object {
display: block;
}

and the space magically disappears. Thanks bobby for looking into this...

Original comment by goo...@hockeyclubhouse.com on 5 Mar 2008 at 5:00