Closed
Bug 97695
Opened 23 years ago
Closed 21 years ago
Images with percent (%) width/height nested inside an inline element should scale relative to containing block
Categories
(Core :: Layout: Block and Inline, defect, P1)
Core
Layout: Block and Inline
Tracking
()
RESOLVED
FIXED
mozilla1.7alpha
People
(Reporter: nakedchaos, Assigned: dbaron)
References
()
Details
(Keywords: testcase, Whiteboard: [reflow-refactor][patch])
Attachments
(3 files, 2 obsolete files)
549 bytes,
text/html
|
Details | |
418 bytes,
image/gif
|
Details | |
1.81 KB,
patch
|
Details | Diff | Splinter Review |
From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.3) Gecko/20010801 BuildID: 2001080110 Row of buttons along top of page is displayed incorrectly. They are variable-sized eg. 10% of windth, 14% of width. Mozilla handles this incorrectly. Reproducible: Always Steps to Reproduce: 1.visit http://linkx.spinrx.com/cgi-bin/advancesailing/index.html 2. Compare with other browsers 3. Email me if you don't see what I'm talking about Actual Results: The images are scrunched in mozilla. Expected Results: Images should not be scrunched.
Comment 1•23 years ago
|
||
Confirming, simplified test case to follow. This only happens if the images are inside links. It looks like, in that instance, the percentage width being used for each subsequent image is being calculated as a fraction of the remaining page width, rather than total page width.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Toolbar at 2" down across top should stretch across the page as it does in IE or NS but gets scrunched to the left instead → Images with %sizes inside links not scaling properly
Comment 2•23 years ago
|
||
Comment 3•23 years ago
|
||
Comment 4•23 years ago
|
||
is this still happening in recent builds?
Comment 5•23 years ago
|
||
Comment on attachment 47879 [details]
testcase, gif image to go with html - save as b1.gif
Yes, I'm still seeing it in 2001091508 win32
Attachment #47879 -
Attachment description: testcase, gif image to go with html → testcase, gif image to go with html - save as b1.gif
Comment 6•23 years ago
|
||
Apologies for the spam, should have checked this before adding the last comment. Still present in 2001092403, win98SE, also.
Comment 7•23 years ago
|
||
*** Bug 101926 has been marked as a duplicate of this bug. ***
Comment 8•23 years ago
|
||
Please see http://www.usahistory.com/noframe.htm for another testcase from my duped bug 101926. The screenshot there is attachment 51055 [details]. This is 4xp and occurs on Linux as well. ------- Additional Comments From Christopher Hoess 2001-09-27 08:33 ------- The HTML 4.01 spec says of percentage image widths "Note that lengths expressed as percentages are based on the horizontal or vertical space currently available," a rather ambiguous definition. However, CSS width (which applies to replaced elements) says that percentages are calculated in terms of the containing block. Since HTML width="" is supposed to be replaced by the CSS equivalent, the change (fix?) proposed here makes sense...
Keywords: 4xp
OS: Windows 98 → All
Summary: Images with %sizes inside links not scaling properly → Images with %sizes inside links should scale relative to containing block
Comment 9•23 years ago
|
||
*** Bug 115544 has been marked as a duplicate of this bug. ***
Comment 11•23 years ago
|
||
*** Bug 119581 has been marked as a duplicate of this bug. ***
Comment 12•23 years ago
|
||
Nominating; it should be an easy fix. Bug 119581 also has a testcase w/ no table.
Keywords: mozilla0.9.8
Updated•23 years ago
|
Target Milestone: --- → mozilla1.0.1
Comment 13•23 years ago
|
||
Moving Mozilla 1.01 bugs to 'future' milestone with priority P1 I will be pulling bugs from 'future' milestones when scheduling later work.
Priority: -- → P1
Target Milestone: mozilla1.0.1 → Future
Updated•23 years ago
|
Keywords: mozilla0.9.8 → mozilla1.0
Comment 14•23 years ago
|
||
It does not have to be within links. Try www.leifjensen.com. This works always (almost always, might need a reload) in NS 4.77/4.78. I can't make it load the picture at all in any Mozilla 0.9.x/1.0x nor NS6.x.
Comment 15•23 years ago
|
||
Konqueror 2.2.2 loads it nicely.
Comment 16•23 years ago
|
||
mozilla1.0 -> mozilla1.01 There's a testcase with no tables in my dup of this. We're definitely laying this out incorrectly.
Keywords: mozilla1.0 → mozilla1.0.1
Comment 17•23 years ago
|
||
I was hoping this bug was fixed in Mozilla 1.0rc2, but it's still there.
Comment 18•23 years ago
|
||
I noticed a comment that this was only within links. I'm not exactly sure about that phrase, but I have it also with: <img src=..... width=80% height=80%>. (Try www.leifjensen.com!)
Comment 19•23 years ago
|
||
Okay, this patch "works" but I'm thinking it is a little late in the game to fix it here (though I may be wrong). So I've debugged this last night and it appears that when we create our nsHTMLReflowState for an image frame, we're already passing in the wrong computed width of the containing block. The correct fix IMO would be probably in nsLineLayout::ReflowFrame() around here: http://lxr.mozilla.org/mozilla/source/layout/html/base/src/nsLineLayout.cpp?rev=3.135#979 or possibly before we get that far. When we get the containing block's width there, it keeps shrinking every time. That's about as far as I got last night. I'll try investigating more later on.
Assignee | ||
Comment 20•23 years ago
|
||
The real problem is what buster introduced in revision 3.81 of nsLineLayout.cpp. We need to figure out what he was really trying to fix.
Assignee | ||
Comment 21•23 years ago
|
||
I suspect it was for bug 38396 / bug 39901.
Assignee | ||
Comment 22•23 years ago
|
||
So bug 38396 is really a bug about one of the fundamental flaws in the layout engine -- that we try to do min-size and pref-size calculations using the same Reflow method that does layout. It looks like buster fixed it first by breaking percentage widths on images, and then by implementing them incorrectly. Not that that really helped (see bug 115688 / bug 107873).
Assignee | ||
Comment 23•23 years ago
|
||
Comment on attachment 87711 [details] [diff] [review] Patch v1.0 This is going to break stuff like absolutely positioned elements, or anything that really *needs* to pass in the computed height/width rather than letting them be calculated (or is nsLineLayout::ReflowFrame the only caller of that constructor?!).
Attachment #87711 -
Flags: needs-work+
Comment 24•22 years ago
|
||
*** Bug 159666 has been marked as a duplicate of this bug. ***
Comment 25•22 years ago
|
||
attinasi->dbaron, since he produced a patch Nominating for 1.3 milestone -> ---
Assignee: attinasi → dbaron
Keywords: mozilla1.0.1 → mozilla1.3
Hardware: PC → All
Target Milestone: Future → ---
Assignee | ||
Comment 26•22 years ago
|
||
I didn't produce a patch. I marked a patch as "needs work".
Severity: normal → major
Whiteboard: [reflow-refactoring]
Comment 27•22 years ago
|
||
Oops, misread. Feel free to reassign. Attinasi seemed a bad choice...
Updated•22 years ago
|
Summary: Images with %sizes inside links should scale relative to containing block → Images with % width/height nested inside an inline element should scale relative to containing block
Comment 28•22 years ago
|
||
->block & inline
Assignee: dbaron → block-and-inline
Component: Layout → Layout: Block & Inline
QA Contact: petersen → ian
Assignee | ||
Comment 29•22 years ago
|
||
I think I want this, actually.
Assignee: block-and-inline → dbaron
Whiteboard: [reflow-refactoring] → [reflow-refactor]
Comment 30•22 years ago
|
||
*** Bug 110358 has been marked as a duplicate of this bug. ***
Updated•22 years ago
|
Summary: Images with % width/height nested inside an inline element should scale relative to containing block → Images with percent (%) width/height nested inside an inline element should scale relative to containing block
Comment 31•22 years ago
|
||
Reassigning as dupe seems fine, but comments are not being copied across, is this a bugzilla bug? anyway here are my comments copied across: is work on this proceeding?? I was hoping to roll out a site using % and was just wondering... http://www.peepo.com/w3/svg-jpg/svg-jpg.html looks damn silly your way. thanks
Updated•22 years ago
|
Keywords: mozilla1.3
Assignee | ||
Comment 32•22 years ago
|
||
*** Bug 209065 has been marked as a duplicate of this bug. ***
Comment 33•22 years ago
|
||
It turns out that the IMG or IFRAME doesn't need to be inside an anchor to cause the bug. It also happens if it's simply inside a <span>...</span>
Comment 34•22 years ago
|
||
Yes, the bug summary already notes that the image needs to be within an inline.
Comment 35•21 years ago
|
||
Congratulations !! Mozilla 1.4 works with my homepage placing a relative picture as it should.
Comment 36•21 years ago
|
||
*** Bug 221398 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 37•21 years ago
|
||
I think this is the right fix, and it doesn't regress bug 38396.
Assignee | ||
Updated•21 years ago
|
Attachment #87711 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Whiteboard: [reflow-refactor] → [reflow-refactor][patch]
Target Milestone: --- → mozilla1.7alpha
Assignee | ||
Updated•21 years ago
|
Attachment #135953 -
Flags: superreview?(roc)
Attachment #135953 -
Flags: review?(roc)
Comment on attachment 135953 [details] [diff] [review] patch sure
Attachment #135953 -
Flags: superreview?(roc)
Attachment #135953 -
Flags: superreview+
Attachment #135953 -
Flags: review?(roc)
Attachment #135953 -
Flags: review+
Comment 39•21 years ago
|
||
Is there a reason we no longer need to pass "reason" the the new reflow state?
Assignee | ||
Comment 40•21 years ago
|
||
Oh, right, I added |reason| back.
Assignee | ||
Comment 41•21 years ago
|
||
Attachment #135953 -
Attachment is obsolete: true
Comment 42•21 years ago
|
||
could somebody check this in, if it works?
Comment 43•21 years ago
|
||
It will get checked in when the tree opens for 1.7alpha. Patience, young grasshopper.
Assignee | ||
Comment 44•21 years ago
|
||
Fix checked in to trunk, 2003-12-18 21:41 -0800.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 45•21 years ago
|
||
working fine, BuildID 2003121823 Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7a) Gecko/20031218 checked with http://www.peepo.com/w3/svg-jpg/svg-jpg.html failed yesterday, ok now Is it too risky to fix this in the branch?
Flags: blocking1.6?
Assignee | ||
Comment 46•21 years ago
|
||
perhaps I should have put this on the branch a few weeks ago, but I'd rather not at this point. We've shipped many releases with this and one more won't hurt too much. It will be fixed in 1.7.
Flags: blocking1.6? → blocking1.6-
Comment 47•21 years ago
|
||
anyone figure out if this fix cause the regression in http://bugzilla.mozilla.org/show_bug.cgi?id=230332 ?
Comment 48•21 years ago
|
||
It probably did, but our current rendering looks correct (and the old rendering rather broken)...
Comment 49•21 years ago
|
||
Could someone who was involved with this bug please take a look at bug 239778 and let us know if the fix for this bug caused the regression in that one? It began at the same time this one was fixed, and I can't find a better candidate for the cause. thanks!
You need to log in
before you can comment on or make changes to this bug.
Description
•