Closed Bug 70972 Opened 24 years ago Closed 23 years ago

Object tag includes do not respect CSS width and height for non-plugins

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.0

People

(Reporter: chris, Assigned: alexsavulov)

Details

(Keywords: css1, testcase)

Attachments

(4 files, 1 obsolete file)

If you embed an object in an HTML page using the Object tag, and then set it's
width or height using CSS - the embedded object does not size to those values.

This applies to relative and absolute width and height values.

If you include the image normally using the IMG tag, or set the width as an HTML
attribute on the Object tag, it does work.

This functionality becomes very important when embedding SVG graphics.
Attached file Test case
Keywords: css1
Confirmed
Platform: PC
OS: Linux 2.2.17
Mozilla Build: 2001030108

Marking NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Reassigning to av.
Assignee: karnaze → av
This is also a problem with the <applet> tag
Marc,

Is this just like that other bug I sent you? Should you be the owner?
This is probably an issue with how the OBJECT frame is getting the width and
height values (should be taking them from the style context, not the
attributes). I am not sure if this is realted to the other issues I am looking
at, I don't think it is.
Marc,

Where do you think there would be a good example of code of how this should 
work? We should honor CSS properly.
Assignee: av → peterlubczynski
Target Milestone: --- → mozilla0.9.2
Check out SpacerFrame::Reflow and look for where the position->mHeight is used.
That is how you get the value from the style data. You can also make the object
map the attribute values for width and height into the style struct so you only
have one code patch (eg. always use the styl struct and never the attribute
values in Reflow). See MapAttributesInto in nsHTMLSpaceElement.cpp for how that
is done.
Assignee: peterlubczynski → alexsavulov
-->Alex
neither NAV nor IE displays this issue correctly...
I sincerely hope NAV and IE aren't the benchmark for CSS compliance in 
Mozilla.  This is a basic CSS1 issue, and should be fixed.
moving to 0.9.3
(nsObjectFrame::HandleImage does not get the width from the style system,
if you use width="50" in the object tag it works because the method calls in 
that case hc->GetHTMLAttribute(nsHTMLAtoms::width, val)...)

chris, i totaly agree with you concerning the compliance with CSS, but i assume 
that the web-designers won't use this feature if it doesn't work with the other 
browsers so we can focus on more urgent bugs
Target Milestone: mozilla0.9.2 → mozilla0.9.3
pushing to 0.9.4
Target Milestone: mozilla0.9.3 → mozilla0.9.4
pushing to 0.9.5
Target Milestone: mozilla0.9.4 → mozilla0.9.5
I've encountered the same problem with <a> and <span> tags; the css width
attribute is not honoured.  I suppose that this is the same bug.  I will attach
a test case.  It works fine with IE5.5 but not with Mozilla 0.9.3.  
<a> and <span> are inline tags.  From the spec for 'width' 
(http://www.w3.org/TR/REC-CSS2/visudet.html#the-width-property):

  This property does not apply to non-replaced inline-level elements.

So the fact that IE applies width to <a> and <span> is a bug in IE.
My recent patch to bug 27478 may have fixed this. Can someone test with a recent
build?
Keywords: qawanted
still seeing this with a build pulled at "Mon Sep 24 10:51:47 EDT 2001"
Attached file plugin testcase
My testcase seems to work with plugins. Can someone narrow down the problem here?

Note: The OBJECT tag take a completely different code path for plugins vs.
images vs. subdocuments
Status: NEW → ASSIGNED
Target Milestone: mozilla0.9.5 → mozilla0.9.6
I don't have the flash plugin installed, and am still using build 2001091303 as 
I am not immediately in a position to download a new build.

I don't know if it helps but...
that build does NOT work for the image attachment.
But using the Adobe SVG 3.0 plugin it does work for pixel width and height, and 
works for percentage width, but does not seem to work for percentage height.
Downloaded 2001092403, plugin scaling now works in all cases I tried :-)  Image 
scaling still does not work.
Summary: Object tag includes do not respect CSS width and height → Object tag includes do not respect CSS width and height for non-plugins
looks like i have to put this one in my priority queue
pushing to 0.9.7
Target Milestone: mozilla0.9.6 → mozilla0.9.7
-> 0.9.9 milestone
(i will try to fix this ASAP)
Target Milestone: mozilla0.9.7 → mozilla0.9.9
retargeting
Target Milestone: mozilla0.9.9 → mozilla1.0
The patch replaces the old kidReflowState.mComputedWidth / Height correction
that was getting the attribute values from the content. (the patch looks a
little bit bizare be cause I repaired the indenting too)
BTW: the proposed patch (attachment 65550 [details]) covers (was tested with):

HTML attribute values: pixel, %
CSS property values: px, em, ex, %
Comment on attachment 65550 [details]
proposed patch (works for attributes as well as for CSS properties)

I think you might still set kidDesiredSize.height and kidDesiredSize.width to
NS_UNCONSTRAINEDSIZE, before passing that to ReflowChild and FinishReflowChild
- I believe that it is an output-only argument, but you never know :)  Other
than that, it looks great. sr=attinasi (with the change I mentioned)
Attachment #65550 - Flags: superreview+
same patch with the change attinasi requested

replaces attachment 65550 [details]
Attachment #65550 - Attachment is obsolete: true
Comment on attachment 65652 [details]
same patch with the change attinasi requested

from previous patch
Attachment #65652 - Flags: superreview+
Looks good, but let me run some more plugin tests....
Something happened to DOM style object APPLETS. Applet element do not have a 
DOM style object anymore. This was working fine, please look at bug# 61233. Is 
this related to the fix here somehow?

Comment on attachment 65652 [details]
same patch with the change attinasi requested

r= peter lubczynski (verbal)
Attachment #65652 - Flags: review+
fixed on trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Blocks: 709914
No longer blocks: 709914
Keywords: qawanted
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: