Closed Bug 39901 Opened 24 years ago Closed 24 years ago

percentage (%) image (img) widths do nothing

Categories

(Core :: Layout, defect, P3)

x86
All
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: sitsofe, Assigned: buster)

References

()

Details

(4 keywords, Whiteboard: [nsbeta2-][nsbeta3+])

Attachments

(4 files)

Step to reproduce:
1. Visit http://sucs.swan.ac.uk/~firefury/

Expected
Coloured horizontal dividers to be 95% of the width of the page

Result
Horizontal dividers are default size.

I checked the w3c spec and it appears that percentages are valid for img
widths... (http://www.w3.org/TR/REC-html40/struct/objects.html#edef-IMG and
http://www.w3.org/TR/REC-html40/sgml/dtd.html#Length).
Yes. I can see the problem. Thanks for
finding it.
-P
Status: NEW → ASSIGNED
Target Milestone: --- → M17
Nisheeth:
Have percentages been implemented?
-Pam
Assignee: pnunn → nisheeth
Status: ASSIGNED → NEW
Accepting bug...

Setting target milestone to M18...
Status: NEW → ASSIGNED
Target Milestone: M17 → M18
The percentage scaling was working for <IMG> in Build ID=2000051210 but it 
doesn't work for builds after that.
Nomimating for beta2. The following is description from the HTML 4 DTD:

When the object is an image, it is scaled. User agents should do their best to 
scale an object or image to match the width and height specified by
the author. Note that lengths expressed as percentages are based on the 
horizontal or vertical space currently available, not on the natural size of
the image, object, or applet.
Keywords: nsbeta2
Putting on [nsbeta2+][w/b minus on 6/22] radar.

Would do a outright [nsbeta2+] with no date if this is widely used....is it?  
let PDT know please.
Whiteboard: [nsbeta2+][w/b minus on 6/22]
I have no idea how widely used this is but I was surprised to find that it was 
valid. However, this bug may make sites that use it to shrink/grow an image 
look ugly.

BTW: I don't think NS 4 supports img % but IE does.
I'm attaching a simple test case that works in Nav 4.x and IE but fails in 
Mozilla.  

I think that percentage based images is a core HTML 4.0 feature that is 
prevalent on the web.  We should increse the priority of this bug to a nsbeta2+ 
bug without a date.
Setting target milestone to M17...
Target Milestone: M18 → M17
Attached file test.html
buster's fix to bug 38396 

(http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&f
ile=nsHTMLImageLoader.cpp&root=/cvsroot&subdir=mozilla/layout/html/base/src&comm
and=DIFF_FRAMESET&rev1=1.24&rev2=1.25)

has caused this regression.  Unfortunately, he's now on sabbatical.  I've spent 
spent some time trying to figure out how to change 
nsHTMLImageLoader::GetDesiredSize() so that images with percent widths and fixed 
heights get the right width, but all my attempts so far break bug 38396.

Given that this is a nsbeta2+ bug with a date and I have other nsbeta2+ bugs of 
higher priority, I'm going to let this one sit for awhile.  If I get done with 
other nsbeta2+ bugs, I'll attack this one.

Ccing Chris Waterson.  Chris, did buster run this particular checkin by you?  
Can you make any suggestions off the top of your head?
Removing the PDT with a date designation so that this gets considered for an 
outright nsbeta2+ designation.
Whiteboard: [nsbeta2+][w/b minus on 6/22]
Putting on [nsbeta2+] radar for beta2 fix. 
Whiteboard: [nsbeta2+]
*** Bug 44079 has been marked as a duplicate of this bug. ***
Is buster's fix for bug 38396 the right way to fix that bug?  The real cause of 
that bug is, I think, related to the issues I discussed in bug 41306.  At least, 
after thinking about it for a few minutes, I would think that the problem there 
was that not enough information was being recalculated in an incremental 
reflow, since the percentage size of the image should depend on the second 
pass of table reflow, which should get the cell widths from the first pass 
where the image was reflowed with auto width (if one assumes that percents 
should go to auto widths on the first pass of table reflow).  Or something like 
that...

In other words, I think that to fix both this bug and bug 38396, you need to 
wipe out more information when doing an incremental reflow than you currently 
are.  I'd have to actually look at this to figure out which piece of information 
is being kept that shouldn't be (image width or cell width?).
I'm having trouble reproducing bug 38396.  However, might the following be the 
right thing to do?  I can't really tell.
Adding ETA to status whiteboard...
Whiteboard: [nsbeta2+] → [nsbeta2+] ETA - 7/14/00
Per PDT bug review tonight, moving from [nsbeta2+] to [nsbeta2-] Not critical to 
beta2.
Whiteboard: [nsbeta2+] ETA - 7/14/00 → [nsbeta2-] ETA - 7/14/00
*** Bug 44502 has been marked as a duplicate of this bug. ***
*** Bug 46910 has been marked as a duplicate of this bug. ***
Adding some relevant keywords, nominating for beta3 since this is a serious
standards bug that affects lots of pages, correcting component, and retitling
for better searches.
Component: ImageLib → Layout
Summary: % (percentages) in img width tag don't do anything → percentage (%) image (img) widths do nothing
This bug is visible on the high profile W3C CSS1 test suite:
   http://www.w3.org/Style/CSS/Test/current/sec5523.htm
Keywords: testcase
OS: Linux → All
QA Contact: elig → py8ieh=bugzilla
Whiteboard: [nsbeta2-] ETA - 7/14/00 → [nsbeta2-] ETA - 7/14/00 hit during nsbeta2 standards compliance testing
*** Bug 25612 has been marked as a duplicate of this bug. ***
Adding heights keyword to summary since a quick test in 071020 win build didn't 
make <IMG SRC="dot.gif" width=1 height="100%"> fill the page like it did with 
IE 5. This follows up a comment in http://slashdot.org/comments.pl?
sid=00/08/08/0839247&cid=425
Summary: percentage (%) image (img) widths do nothing → percentage (%) image (img) widths or heights do nothing
If there's a problem with heights, it's a separate bug.  But it may not be a bug
at all.  Don't fill up this bug with it, though.  (There are probably other
existing bugs.)
Summary: percentage (%) image (img) widths or heights do nothing → percentage (%) image (img) widths do nothing
Sorry about that. I thought the two were related after verifying bug 25612 
(which seemed to have issues with both width and height) a dup of this one. The 
correct bug for percentage issues with the img height appears to be bug 33443 
(IMG HEIGHT="xxx%" doesn't work under all circumstances).
nsbeta3+. 
Whiteboard: [nsbeta2-] ETA - 7/14/00 hit during nsbeta2 standards compliance testing → [nsbeta2-] [nsbeta3+] ETA - 7/14/00 hit during nsbeta2 standards compliance testing
Target Milestone: M17 → M18
Adding myself to cc.

This is a high profile bug now :-(
[For some folks] until this bug is fixed you can dynamically adjust the width & 
height of images in script.
Tried resize with some js, works fine, for when you load a page first, but 
mozilla's onresize event handler is also broken, so if someone resizes the 
browser you can't specify a function to change all images dimensions to desired 
width....well you can specify the function but it won't get called.  :( Any 
update on ETA?
Re-assigning to buster, now that he's back from sabbatical.
Whiteboard: [nsbeta2-] [nsbeta3+] ETA - 7/14/00 hit during nsbeta2 standards compliance testing → [nsbeta2-] [nsbeta3+] hit during nsbeta2 standards compliance testing
Really re-assigning this time.
Assignee: nisheeth → buster
Status: ASSIGNED → NEW
I'm back, and I'll look at this next.
Severity: normal → major
Status: NEW → ASSIGNED
Priority: P3 → P1
*** Bug 50214 has been marked as a duplicate of this bug. ***
Hopefully can fix, but will not hold product for this. Moving to P3.  Adding 
[PDTP3]
Priority: P1 → P3
Whiteboard: [nsbeta2-] [nsbeta3+] hit during nsbeta2 standards compliance testing → [nsbeta2-][nsbeta3+][PDTP3] hit during nsbeta2 standards compliance testing
*** Bug 50273 has been marked as a duplicate of this bug. ***
well i just wanted to add that this feature needs to work in tables also.
just take any picture and test it with this source. ie paints it with with=100%
netscape paints it empty and mozilla paints it with original size.

<html>
  <body>
    <table width=100%>
      <tr width=100%>
        <td width=100%>
          <image src="test.jpg" width=100% height=7>
        </td>
      </tr>
    </table>
  </body>
</html>
Nominating for rtm in case this misses beta3.  This is just one of those things
we really can't ship with.
Keywords: rtm
(Just steped over David's changes.)

I just ran into this, and I am not even a web designer...

PDT: If things like that don't work, you can't call this HTML4 or CSS1
compliant. Push out the release, if necessary. Removing [PDTP3] for
reevaluation.
Whiteboard: [nsbeta2-][nsbeta3+][PDTP3] hit during nsbeta2 standards compliance testing → [nsbeta2-][nsbeta3+] hit during nsbeta2 standards compliance testing
this is already +, and I have most of the fix already.  just cleaning up some 
details.  so don't waste any time discussing this in the pdt meetings, it's a 
done deal.
buster, cool!
fix is thoroughly tested and regression tested (to the extent I could test it 
against a broken baseline!)  marking [fix in hand]
Whiteboard: [nsbeta2-][nsbeta3+] hit during nsbeta2 standards compliance testing → [nsbeta2-][nsbeta3+] [fix in hand]
bu sure to verify bug 38396 when verifying this bug
Depends on: 38396
fix checked in 9/11/00
r=karnaze
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: [nsbeta2-][nsbeta3+] [fix in hand] → [nsbeta2-][nsbeta3+]
can you please verify for the bug on solaris2.7 for url's listed below.
(1) http://mozilla.org/quality/browser/standards/html/img_width_percent.html
(2) http://mozilla.org/quality/browser/standards/html/img_height_percent.html
thanx,
-Nasir









if the heights don't work, that would be a separate bug
VERIFIED FIXED on Windows 2000 Commercial Build 2000091308 and Linux Commercial 
Build 2000091312 using second testcase.
Status: RESOLVED → VERIFIED
*** Bug 51879 has been marked as a duplicate of this bug. ***
Just installed NS6. It has NOT been fixed in M18.
<img align="left" src="../cgi-bin/jth.net" alt="logo" height="100%">
which produces a PNG image 1200 pixels high, does not scale down to window
height.
Actually my observation is really bug 54119
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: