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)
Core
Layout
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.
Reporter | ||
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
Confirmed Platform: PC OS: Linux 2.2.17 Mozilla Build: 2001030108 Marking NEW.
Comment 4•23 years ago
|
||
This is also a problem with the <applet> tag
Comment 5•23 years ago
|
||
Marc, Is this just like that other bug I sent you? Should you be the owner?
Comment 6•23 years ago
|
||
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.
Comment 7•23 years ago
|
||
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
Comment 8•23 years ago
|
||
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.
Updated•23 years ago
|
Assignee: peterlubczynski → alexsavulov
Comment 9•23 years ago
|
||
-->Alex
Assignee | ||
Comment 10•23 years ago
|
||
neither NAV nor IE displays this issue correctly...
Reporter | ||
Comment 11•23 years ago
|
||
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.
Assignee | ||
Comment 12•23 years ago
|
||
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
Comment 15•23 years ago
|
||
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.
Comment 16•23 years ago
|
||
Comment 17•23 years ago
|
||
<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.
Comment 18•23 years ago
|
||
My recent patch to bug 27478 may have fixed this. Can someone test with a recent build?
Keywords: qawanted
Comment 19•23 years ago
|
||
still seeing this with a build pulled at "Mon Sep 24 10:51:47 EDT 2001"
Comment 20•23 years ago
|
||
Comment 21•23 years ago
|
||
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
Reporter | ||
Comment 22•23 years ago
|
||
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.
Reporter | ||
Comment 23•23 years ago
|
||
Downloaded 2001092403, plugin scaling now works in all cases I tried :-) Image scaling still does not work.
Updated•23 years ago
|
Summary: Object tag includes do not respect CSS width and height → Object tag includes do not respect CSS width and height for non-plugins
Assignee | ||
Comment 24•23 years ago
|
||
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
Assignee | ||
Comment 25•23 years ago
|
||
-> 0.9.9 milestone (i will try to fix this ASAP)
Target Milestone: mozilla0.9.7 → mozilla0.9.9
Assignee | ||
Comment 27•23 years ago
|
||
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)
Assignee | ||
Comment 28•23 years ago
|
||
BTW: the proposed patch (attachment 65550 [details]) covers (was tested with):
HTML attribute values: pixel, %
CSS property values: px, em, ex, %
Comment 29•23 years ago
|
||
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+
Assignee | ||
Comment 30•23 years ago
|
||
same patch with the change attinasi requested
replaces attachment 65550 [details]
Attachment #65550 -
Attachment is obsolete: true
Assignee | ||
Comment 31•23 years ago
|
||
Comment on attachment 65652 [details]
same patch with the change attinasi requested
from previous patch
Attachment #65652 -
Flags: superreview+
Comment 32•23 years ago
|
||
Looks good, but let me run some more plugin tests....
Comment 33•23 years ago
|
||
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?
Assignee | ||
Comment 34•23 years ago
|
||
Comment on attachment 65652 [details]
same patch with the change attinasi requested
r= peter lubczynski (verbal)
Attachment #65652 -
Flags: review+
Assignee | ||
Comment 35•23 years ago
|
||
fixed on trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•