percentage (%) image (img) widths do nothing

VERIFIED FIXED in M18

Status

()

Core
Layout
P3
major
VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: Sitsofe Wheeler, Assigned: buster)

Tracking

(4 keywords)

Trunk
x86
All
css1, html4, regression, testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [nsbeta2-][nsbeta3+], URL)

Attachments

(4 attachments)

(Reporter)

Description

18 years ago
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).

Comment 1

18 years ago
Yes. I can see the problem. Thanks for
finding it.
-P
Status: NEW → ASSIGNED
Target Milestone: --- → M17

Comment 2

18 years ago
Nisheeth:
Have percentages been implemented?
-Pam
Assignee: pnunn → nisheeth
Status: ASSIGNED → NEW

Comment 3

18 years ago
Accepting bug...

Setting target milestone to M18...
Status: NEW → ASSIGNED
Target Milestone: M17 → M18

Comment 4

18 years ago
The percentage scaling was working for <IMG> in Build ID=2000051210 but it 
doesn't work for builds after that.

Comment 5

18 years ago
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

Comment 6

18 years ago
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]
(Reporter)

Comment 7

18 years ago
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.

Comment 8

18 years ago
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.

Comment 9

18 years ago
Setting target milestone to M17...
Target Milestone: M18 → M17

Comment 10

18 years ago
Created attachment 10276 [details]
test.html

Comment 11

18 years ago
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?

Comment 12

18 years ago
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]

Comment 13

18 years ago
Putting on [nsbeta2+] radar for beta2 fix. 
Whiteboard: [nsbeta2+]

Comment 14

18 years ago
*** 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?).
Created attachment 10908 [details] [diff] [review]
this patch seemed to work, but I no longer think it's right...
I'm having trouble reproducing bug 38396.  However, might the following be the 
right thing to do?  I can't really tell.

Comment 19

18 years ago
Adding ETA to status whiteboard...
Whiteboard: [nsbeta2+] → [nsbeta2+] ETA - 7/14/00

Comment 20

18 years ago
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
Keywords: 4xp, correctness, css1, html4, nsbeta3
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. ***
(Reporter)

Comment 26

18 years ago
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
(Reporter)

Comment 28

18 years ago
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).

Comment 29

18 years ago
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

Comment 30

18 years ago
Adding myself to cc.

This is a high profile bug now :-(

Comment 31

18 years ago
[For some folks] until this bug is fixed you can dynamically adjust the width & 
height of images in script.

Comment 32

18 years ago
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?

Comment 33

18 years ago
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

Comment 34

18 years ago
Really re-assigning this time.
Assignee: nisheeth → buster
Status: ASSIGNED → NEW
(Assignee)

Comment 35

18 years ago
I'm back, and I'll look at this next.
Severity: normal → major
Status: NEW → ASSIGNED
Priority: P3 → P1
Blocks: 7954
Keywords: mostfreq, regression
*** Bug 50214 has been marked as a duplicate of this bug. ***

Comment 37

18 years ago
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. ***

Comment 39

18 years ago
Created attachment 13828 [details]
Info on percent scaling of images and example url.

Comment 40

18 years ago
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

Comment 42

18 years ago
(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
(Assignee)

Comment 43

18 years ago
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.

Comment 44

18 years ago
buster, cool!
(Assignee)

Comment 45

18 years ago
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]
(Assignee)

Comment 46

18 years ago
bu sure to verify bug 38396 when verifying this bug
Depends on: 38396
(Assignee)

Comment 47

18 years ago
fix checked in 9/11/00
r=karnaze
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
Whiteboard: [nsbeta2-][nsbeta3+] [fix in hand] → [nsbeta2-][nsbeta3+]

Comment 48

18 years ago
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









(Assignee)

Comment 49

18 years ago
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

Comment 51

18 years ago
*** Bug 51879 has been marked as a duplicate of this bug. ***

Comment 52

18 years ago
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.

Comment 53

18 years ago
Actually my observation is really bug 54119
You need to log in before you can comment on or make changes to this bug.