EMBED inside OBJECT layout problem

Koos Vriezen koos.vriezen at xs4all.nl
Fri Jan 31 18:58:27 GMT 2003


On Sat, 25 Jan 2003, Koos Vriezen wrote:

> This page
> http://wwwa.accuweather.com/adcbin/video/video_frameset.asp?video=889945
> isn't rendered correctly. It has an embedded object of type
> application/x-mplayer2, which can be played with KMPlayer.
> The left middle frame looks like
> <BODY>
>         <object id="MediaPlayer" ...>
>           <param name=...>
>           .....
>           <embed src="..." ....>
>             width="330"
>             height="320"
>           </embed>
>         </object>
> </BODY>
> What happens is that the width of OBJECT is layouted as 50, same for
> height. Which means a very small movie.

Attached a fix for it. It sets the width/height attributes on a
HTMLObjectElementImpl if these are empty and it has a
HTMLEmbedElementImpl as a child.

Ok to commit?

Koos
-------------- next part --------------
Index: rendering/render_frames.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_frames.cpp,v
retrieving revision 1.149
diff -u -3 -p -r1.149 render_frames.cpp
--- rendering/render_frames.cpp	29 Jan 2003 18:19:24 -0000	1.149
+++ rendering/render_frames.cpp	31 Jan 2003 18:53:17 -0000
@@ -697,6 +697,11 @@ void RenderPartObject::updateWidget()
 #endif
               return;
           }
+          HTMLObjectElementImpl *o = static_cast<HTMLObjectElementImpl *>(element());
+          if (o->getAttribute(ATTR_WIDTH).string().isEmpty())
+              o->setAttribute(ATTR_WIDTH, embed->getAttribute(ATTR_WIDTH).string());
+          if (o->getAttribute(ATTR_HEIGHT).string().isEmpty())
+              o->setAttribute(ATTR_HEIGHT, embed->getAttribute(ATTR_HEIGHT).string());
           part->requestObject( this, url, serviceType, params );
       }
   }


More information about the kfm-devel mailing list