1

I have a flash stuff on a web page, which height I want to control basing on parent's explicitly set height. Width should be recalculated to preserve proportions - as it happens when dealing with <img> tag:

<div>
    <object>
      <embed src="..."> <!-- no attributes except src -->
  </object>
</div>

<style>
    div { height: 300px; }
    object, embed { height: 100%;   }
</style>

Instead of expected behaviour I get the flash of absolutely other size: it is much smaller than it's parent in all dimensions. Actually, I don't understand why it takes this particular size - it looks too small (like zoomed out few times).

To make it to behave in a proper way I have to set both width and height for explicitly. It may be done both inline and in CSS.

The question is: why doesn't it calculate height (though it obviously has enough data - <img> can resize properly at the same conditions) based on parent's height and given percentage?.

(Initially I've had many other attributes (including duplicated width and height on both and tags) which all I removed to simplify the example. While doing that, I was checking whether removement changes anything and it didn't except of width and height attributes.)


May I ask what's the point? Your input file is not XML, and you don't want to make it XML by adding CDATA section. What do you gain by knowing whether "some" of the data is XML? It's not like you will be able to use XML tools on it, or that ypo will be able to deliver it as XML.

So really this non-validation doesn't gain you anything. Isn't it a bit of a waste of time then?

4

0 回答 0