Closed Bug 1201 Opened 26 years ago Closed 26 years ago

Plugins ignore size parameters and display in 50 x 50 box

Categories

(Core Graveyard :: Plug-ins, defect, P1)

x86
Windows NT

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: hjtoi-bugzilla, Assigned: amusil)

Details

Plugins do not seem to get the correct area for their display. The 1998-10-08 tarball version correctly takes account of the width and height parameters, but for example the nightly build 1998-10-12 does not. The newest CVS version does not use the parameters either. The plugin seems to get something like 50 x 50 pixel area regardless of parameters. This happens at least for EMBED and OBJECT tag. Plugin in EMBED tag seems to work correctly (although the small size makes it useless), while OBJECT tag produces only a black box (50x50) with the plugins I've tried. You can verify the plugin area problem with the .. modules\plugin\test\SimpleTest.html file
Status: NEW → ASSIGNED
Assignee: michaelp → amusil
Status: ASSIGNED → NEW
Severity: normal → major
Status: NEW → ASSIGNED
Priority: P2 → P1
I did a quick fix for me, now I at least got the EMBED tags working. Sometimes there is problems with resize. Here's the patch if you want to use it, although I am sure there is "the right way" to do it also. Note that I have tested this to work on 1998-10-22 source, and this patch is for the latest CVS'd source file so I can not be 100% certain it works. --- nsObjectFrame.cpp Wed Nov 04 06:13:55 1998 +++ Fixed-nsObjectFrame.cpp Tue Nov 10 09:12:33 1998 @@ -326,6 +326,12 @@ else { float p2t = aPresContext->GetPixelsToTwips(); aMetrics.width = NSIntPixelsToTwips(EMBED_DEF_DIM, p2t); + // This solves part of the plugin size problem + if (nsnull != mInstanceOwner) { + PRUint32 result; + if (NS_OK == mInstanceOwner->GetWidth(&result)) + aMetrics.width = NSIntPixelsToTwips(result, p2t); + } } } if (!haveHeight) { @@ -335,6 +341,12 @@ else { float p2t = aPresContext->GetPixelsToTwips(); aMetrics.height = NSIntPixelsToTwips(EMBED_DEF_DIM, p2t); + // This solves part of the plugin size problem + if (nsnull != mInstanceOwner) { + PRUint32 result; + if (NS_OK == mInstanceOwner->GetHeight(&result)) + aMetrics.height = NSIntPixelsToTwips(result, p2t); + } } } aMetrics.ascent = aMetrics.height; @@ -449,6 +461,27 @@ NS_RELEASE(docURL); NS_RELEASE(doc); } + } + + { // This solves another half of the resize problems + // There are still some resizing worries, but nothing really serious + // The first one that worked, much cleaning to do... + float p2t = aPresContext.GetPixelsToTwips(); + PRUint32 result; + nsString value; + char *s; + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute("WIDTH", value)) { + s = value.ToNewCString(); + result = (PRUint32)atol(s); + free(s); + aMetrics.width = NSIntPixelsToTwips(result,p2t); + } + if (NS_CONTENT_ATTR_HAS_VALUE == mContent->GetAttribute("HEIGHT", value)) { + s = value.ToNewCString(); + result = (PRUint32)atol(s); + free(s); + aMetrics.height = NSIntPixelsToTwips(result,p2t); + } } nsIView *parentWithView;
Assignee: amusil → av
Status: ASSIGNED → NEW
Assignee: av → amusil
Status: NEW → ASSIGNED
I already have a fix on my local tree.
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Fixed 11.17.98 - 3:30PM
asking heikki to verify bug
QA Contact: 3849
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.