From: Doug M. <do...@cr...> - 2003-04-26 04:21:01
Attachments:
Moz_ContentSizeBug.html
|
<html>=0A= <head>=0A= <title>Mozilla cotnentWidth Bug</title>=0A= <script language=3D"JavaScript" src=3D"./src/dynapi.js"></script>=0A= <script language=3D"Javascript">=0A= dynapi.library.setPath('./src/');=0A= dynapi.library.include('dynapi.api');=0A= </script>=0A= <script language=3D"Javascript">=0A= =0A= ParentLayer =3D new DynLayer();=0A= ParentLayer.setBgColor('blue');=0A= ParentLayer.setSize(100,100);=0A= ParentLayer.setLocation(50,200);=0A= =0A= ChildLayer =3D new DynLayer();=0A= ChildLayer.setBgColor('white');=0A= ChildLayer.setSize(100,100);=0A= ChildLayer.setLocation(10,10);=0A= =0A= ChildLayer.setHTML('<table border=3D1 width=3D150 height=3D150><tr><td = align=3Dcenter valign=3Dmiddle>!</td></tr></table>');=0A= =0A= ParentLayer.addChild(ChildLayer)=0A= =0A= dynapi.document.addChild(ParentLayer);=0A= =0A= function doIt(){=0A= alert('Child Layer\'s ContentWidth =3D ' + ChildLayer.getContentWidth() = + '\nChild Layer\'s ContentHeight =3D ' + ChildLayer.getContentHeight())=0A= }=0A= =0A= ParentLayerB =3D new DynLayer();=0A= ParentLayerB.setBgColor('blue');=0A= ParentLayerB.setSize(150,150);=0A= ParentLayerB.setLocation(250,200);=0A= =0A= ChildLayerB =3D new DynLayer();=0A= ChildLayerB.setBgColor('white');=0A= ChildLayerB.setSize(100,100);=0A= ChildLayerB.setLocation(10,10);=0A= =0A= ChildLayerB.setHTML('<table border=3D1 width=3D150 height=3D150><tr><td = align=3Dcenter valign=3Dmiddle>!</td></tr></table>');=0A= =0A= ParentLayerB.addChild(ChildLayerB)=0A= =0A= dynapi.document.addChild(ParentLayerB);=0A= =0A= function doItB(){=0A= alert('Child Layer B\'s ContentWidth =3D ' + = ChildLayerB.getContentWidth() + '\nChild LayerB\'s ContentHeight =3D ' + = ChildLayerB.getContentHeight())=0A= }=0A= =0A= </script>=0A= </head>=0A= <body bgcolor=3D"#999999">=0A= This document demonstartes the mozilla content size bug.<br>=0A= <a href=3D# onclick=3D"doIt()">click here</a> to get the content size of = the child layer.<br>=0A= the expected results are contentWidth =3D 150 and contentHeight =3D = 150<br>=0A= Note that the bug only occurs with the width<br>=0A= In case you did not notice. getContenWidth in Mozilla will actually = return the distance from a child layer's<br>=0A= left to the parent layer's right where the childlayer's right extends = beyond the parent layer's right.<br><br>=0A= If the child layer's area does not extend beyond the parent layer's area = then the value returned is that of the real content width minus the left = position of the child layer.=0A= <a href=3D# onclick=3D"doItB()">click here</a> to get the content size = of the second child layer.<br>=0A= =0A= <script>=0A= dynapi.document.insertAllChildren();=0A= </script>=0A= =0A= </body>=0A= </html>=0A= |
From: Raymond I. <xw...@ya...> - 2003-04-27 16:50:24
|
--- Doug Melvin <do...@cr...> wrote: > See attached document. > note: this is a mozilla (NS6) specific bug. Wow! I wonder if this is a mozilla bug? If it is a bug we might have to release a dynapi-mozilla patch for this bug. Another thing to note is that in IE I also noticed that had to set the width to 1 before it would return the correct content size. Any ideas why? Any other work around for both IE and mozilla getContentWidth() problems? -- Raymond Irving > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system > (http://www.grisoft.com). > Version: 6.0.476 / Virus Database: 273 - Release > Date: 4/24/2003 > --------------------------------- Mozilla cotnentWidth Bugdynapi.library.setPath('./src/');dynapi.library.include('dynapi.api');ParentLayer = new DynLayer();ParentLayer.setBgColor('blue');ParentLayer.setSize(100,100);ParentLayer.setLocation(50,200);ChildLayer = new DynLayer();ChildLayer.setBgColor('white');ChildLayer.setSize(100,100);ChildLayer.setLocation(10,10);ChildLayer.setHTML('!');ParentLayer.addChild(ChildLayer)dynapi.document.addChild(ParentLayer);function doIt(){ alert('Child Layer\'s ContentWidth = ' + ChildLayer.getContentWidth() + '\nChild Layer\'s ContentHeight = ' + ChildLayer.getContentHeight())}ParentLayerB = new DynLayer();ParentLayerB.setBgColor('blue');ParentLayerB.setSize(150,150);ParentLayerB.setLocation(250,200);ChildLayerB = new DynLayer();ChildLayerB.setBgColor('white');ChildLayerB.setSize(100,100);ChildLayerB.setLocation(10,10);ChildLayerB.setHTML('!');ParentLayerB.addChild(ChildLayerB)dynapi.document.addChild(ParentLayerB);function doItB(){ alert('Child Layer B\'s ContentWidth = ' + ChildLayerB.getContentWidth() + '\nChild LayerB\'s ContentHeight = ' + ChildLayerB.getContentHeight())}This document demonstartes the mozilla content size bug. click here to get the content size of the child layer. the expected results are contentWidth = 150 and contentHeight = 150 Note that the bug only occurs with the width In case you did not notice. getContenWidth in Mozilla will actually return the distance from a child layer's left to the parent layer's right where the childlayer's right extends beyond the parent layer's right. If the child layer's area does not extend beyond the parent layer's area then the value returned is that of the real content width minus the left position of the child layer.click here to get the content size of the second child layer. dynapi.document.insertAllChildren(); __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |
From: Benoit M. <mar...@ma...> - 2003-04-27 17:58:48
|
I've seen with IE, in several occasions, that wrapping a content in a table with one cell forces the layout engine to do the right thing. Give it a shot. Benoit On Sunday, April 27, 2003, at 09:50 AM, Raymond Irving wrote: > > --- Doug Melvin <do...@cr...> wrote: >> See attached document. >> note: this is a mozilla (NS6) specific bug. > > Wow! I wonder if this is a mozilla bug? If it is a bug > we might have to release a dynapi-mozilla patch for > this bug. > > Another thing to note is that in IE I also noticed > that had to set the width to 1 before it would return > the correct content size. Any ideas why? Any other > work around for both IE and mozilla getContentWidth() > problems? > > -- > Raymond Irving > >> >> --- >> Outgoing mail is certified Virus Free. >> Checked by AVG anti-virus system >> (http://www.grisoft.com). >> Version: 6.0.476 / Virus Database: 273 - Release >> Date: 4/24/2003 >> > --------------------------------- > Mozilla cotnentWidth > Bugdynapi.library.setPath('./src/ > ');dynapi.library.include('dynapi.api');ParentLayer > = new > DynLayer();ParentLayer.setBgColor('blue');ParentLayer.setSize(100,100); > ParentLayer.setLocation(50,200);ChildLayer > = new > DynLayer();ChildLayer.setBgColor('white');ChildLayer.setSize(100,100);C > hildLayer.setLocation(10,10);ChildLayer.setHTML('!');ParentLayer.addChi > ld(ChildLayer)dynapi.document.addChild(ParentLayer);function > doIt(){ alert('Child Layer\'s ContentWidth = ' + > ChildLayer.getContentWidth() + '\nChild Layer\'s > ContentHeight = ' + > ChildLayer.getContentHeight())}ParentLayerB = new > DynLayer();ParentLayerB.setBgColor('blue');ParentLayerB.setSize(150,150 > );ParentLayerB.setLocation(250,200);ChildLayerB > = new > DynLayer();ChildLayerB.setBgColor('white');ChildLayerB.setSize(100,100) > ;ChildLayerB.setLocation(10,10);ChildLayerB.setHTML('!');ParentLayerB.a > ddChild(ChildLayerB)dynapi.document.addChild(ParentLayerB);function > doItB(){ alert('Child Layer B\'s ContentWidth = ' + > ChildLayerB.getContentWidth() + '\nChild LayerB\'s > ContentHeight = ' + > ChildLayerB.getContentHeight())}This document > demonstartes the mozilla content size bug. > click here to get the content size of the child layer. > the expected results are contentWidth = 150 and > contentHeight = 150 > Note that the bug only occurs with the width > In case you did not notice. getContenWidth in Mozilla > will actually return the distance from a child layer's > left to the parent layer's right where the > childlayer's right extends beyond the parent layer's > right. > > If the child layer's area does not extend beyond the > parent layer's area then the value returned is that of > the real content width minus the left position of the > child layer.click here to get the content size of the > second child layer. > dynapi.document.insertAllChildren(); > > > __________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > http://search.yahoo.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://www.mail-archive.com/dyn...@li.../ > |
From: Doug M. <do...@cr...> - 2003-04-27 23:16:53
|
int he demo I posted.. the content is indeed in a table with one cell. :-) ----- Original Message ----- From: "Benoit Marchant" <mar...@ma...> To: "Raymond Irving" <xw...@ya...> Cc: "DynApi-Dev" <dyn...@li...> Sent: Sunday, April 27, 2003 1:56 PM Subject: Re: [Dynapi-Dev] Mozilla cotnentwidth bug. > I've seen with IE, in several occasions, that wrapping a content in a > table with one cell forces the layout engine to do the right thing. > Give it a shot. > > Benoit > > On Sunday, April 27, 2003, at 09:50 AM, Raymond Irving wrote: > > > > > --- Doug Melvin <do...@cr...> wrote: > >> See attached document. > >> note: this is a mozilla (NS6) specific bug. > > > > Wow! I wonder if this is a mozilla bug? If it is a bug > > we might have to release a dynapi-mozilla patch for > > this bug. > > > > Another thing to note is that in IE I also noticed > > that had to set the width to 1 before it would return > > the correct content size. Any ideas why? Any other > > work around for both IE and mozilla getContentWidth() > > problems? > > > > -- > > Raymond Irving > > > >> > >> --- > >> Outgoing mail is certified Virus Free. > >> Checked by AVG anti-virus system > >> (http://www.grisoft.com). > >> Version: 6.0.476 / Virus Database: 273 - Release > >> Date: 4/24/2003 > >> > > --------------------------------- > > Mozilla cotnentWidth > > Bugdynapi.library.setPath('./src/ > > ');dynapi.library.include('dynapi.api');ParentLayer > > = new > > DynLayer();ParentLayer.setBgColor('blue');ParentLayer.setSize(100,100); > > ParentLayer.setLocation(50,200);ChildLayer > > = new > > DynLayer();ChildLayer.setBgColor('white');ChildLayer.setSize(100,100);C > > hildLayer.setLocation(10,10);ChildLayer.setHTML('!');ParentLayer.addChi > > ld(ChildLayer)dynapi.document.addChild(ParentLayer);function > > doIt(){ alert('Child Layer\'s ContentWidth = ' + > > ChildLayer.getContentWidth() + '\nChild Layer\'s > > ContentHeight = ' + > > ChildLayer.getContentHeight())}ParentLayerB = new > > DynLayer();ParentLayerB.setBgColor('blue');ParentLayerB.setSize(150,150 > > );ParentLayerB.setLocation(250,200);ChildLayerB > > = new > > DynLayer();ChildLayerB.setBgColor('white');ChildLayerB.setSize(100,100) > > ;ChildLayerB.setLocation(10,10);ChildLayerB.setHTML('!');ParentLayerB.a > > ddChild(ChildLayerB)dynapi.document.addChild(ParentLayerB);function > > doItB(){ alert('Child Layer B\'s ContentWidth = ' + > > ChildLayerB.getContentWidth() + '\nChild LayerB\'s > > ContentHeight = ' + > > ChildLayerB.getContentHeight())}This document > > demonstartes the mozilla content size bug. > > click here to get the content size of the child layer. > > the expected results are contentWidth = 150 and > > contentHeight = 150 > > Note that the bug only occurs with the width > > In case you did not notice. getContenWidth in Mozilla > > will actually return the distance from a child layer's > > left to the parent layer's right where the > > childlayer's right extends beyond the parent layer's > > right. > > > > If the child layer's area does not extend beyond the > > parent layer's area then the value returned is that of > > the real content width minus the left position of the > > child layer.click here to get the content size of the > > second child layer. > > dynapi.document.insertAllChildren(); > > > > > > __________________________________ > > Do you Yahoo!? > > The New Yahoo! Search - Faster. Easier. Bingo. > > http://search.yahoo.com > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Dynapi-Dev mailing list > > Dyn...@li... > > http://www.mail-archive.com/dyn...@li.../ > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://www.mail-archive.com/dyn...@li.../ > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 4/24/2003 |