Closed Bug 99289 Opened 24 years ago Closed 23 years ago

Script tag in table makes cells expand incorrectly

Categories

(Core :: Layout, defect, P2)

defect

Tracking

()

RESOLVED WORKSFORME
mozilla1.2alpha

People

(Reporter: rebron, Assigned: karnaze)

References

Details

(Keywords: testcase)

Attachments

(6 files)

Using Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20010911 Netscape6/6.2 Go to the URL above and you'll see the problem.
Confirming with linux 2001090712.
Status: NEW → ASSIGNED
Do we know what the problem is with this page yet?
No idea what the problem is yet. I'll attach the source of the main frame - it renders pretty fine by itself...
Hmm. That main frame source works fine in a frameset too. Definitely need a reduced testcase to see what is the problem. Any volunteers to help reduce the page? I think the attachment I made is invalid because the images do not all load...
Priority: -- → P2
Target Milestone: --- → mozilla0.9.5
Here's another site with the table's slightly off. http://www.bu.edu/
Adding Evangelism to the bug
On both http://shopping.netscape.com/deptstores/index.adp and http://home.netscape.com/ex/shak/shopping/index.html, the page works if you comment out the line which looks like: <SCRIPT LANGUAGE="JavaScript1.2"> DisplayMenu(); </SCRIPT> I haven't dug into what the function does, but it may be spitting out something that screws up the table.
"Also a problem on the main Shopping Index page. http://home.netscape.com/ex/shak/shopping/index.html" This is being triggered, according to my tests in 2001092303/Mac, by a SCRIPT element in the left-hand table cell. The "menu" (Auctions/Beauty.../etc.) is driven out of a script, and if you remove it then the page lays out as intended. I'm not sure why this shoudl be so; it might have something to do with what the script produces, or it could be a rendering bug. My test case isn't very minimzed but I'll attach it anyway. "and https://www.healthforums.com/start" This page laid out fine in 2001092303/Mac. Can anyone confirm with a more recent Windows build?
Did a quick QA on the machines that I'm running: 6.1 Mac 0.9.4 Branch NT Trunk Linux Health Forums okay off okay BU.edu okay off off Shopping Index page off off off With off meaning that content is off to the right when it should be centered.
adding marcio
Adding Vincent Tong for now. I think Vincent have contacts with shopping page engineers and they may help us.
------------------------------------------------- Guys, I see that we have two issues: (1) a possible real bug and (2) the evangelism workaround fix since N6.1 is also demonstrating the same problem. I created the following testcase, that isolates the problem. Marc||Eric, please take a look in the following comments: (to see if this is a real bug) -------------------------------------------------------- During the HTML flow, there is one <SCRIPT> DisplayMenu(); </SCRIPT>. This calls the DisplayMenu function that dynamically write the DIV elements related with the menu items. Note that they generate a set of itens like: <div id="xyz" class="MenuItem" style="width:150">menuItemblabla</div> Where... .MenuItem { position: relative; top:0px; left:0px; cursor: "hand"; text-decoration: "none"; color: "#003399"; font-weight: bold; } If we remove the inline style="width:..." definition, then it works. So the following testcase is the same version of the shopping page widthout the style="" property definition.
>>> comment about the site www.bu.edu >>> ----------------------------------------- BTW, the example http://www.bu.edu/ is not the same case. In that case, there is one table with width="580" and inside the cells, two <img width="580">. Mozilla is not wrapping these images and causing a [--580--][--580--].
The width specification, as written in comment <Additional Comments From /\/\arcio Galli 2001-09-27 15:08> is incorrect and should be ignored. the value for the width property needs units, as in: <div id="xyz" class="MenuItem" style="width:150px">menuItemblabla</div> The bad declaration in the attribute (style="width:150") could be causing other problems - not sure.
That's good piece of information. Rafael, so this case the "Shopping" is becomes official evangelism. Do you know if the new checkin in the shopping code is related with the addition of that attribute? Let us know if the workaround (without the style attribute) works for your case.
The last testcase (attachment 51257 [details]) shows the bug while it looks good in IE6 and Opera5 for example. An easy workaround is to move the <SCRIPT>s out of the table into <HEAD>. Still, I think there is real bug here since it displayes differently from IE/Opera.
Keywords: testcase
Where we are on the website side of things: Shopping Index page was fixed for 6.1 and looks good in 6.2. The url provided with the bug http://shopping.netscape.com/deptstores/index.adp still looks bad in 6.2 but works fine in 6.1. Not sure what the next steps are here. Is this a regression that gets fixed or do I need to go get this fixed via a website change?
Please see Bugscape 9958 for further test results.
end of milestone shuffle...
Target Milestone: mozilla0.9.5 → mozilla0.9.6
*** Bug 103319 has been marked as a duplicate of this bug. ***
Bumping milestone
Target Milestone: mozilla0.9.6 → mozilla0.9.7
I have a new testcase which may shed some light on this. My observations are: * The table cell containing the SCRIPT element will expand to equal the defined 'width' for the TABLE element. * Not every cell in a table will be affected by this bug, but the leftmost cells are highly prone to incorrect expansion. * The expansion can be triggered by following the SCRIPT with an element that has an explicitly defined width somewhere in the same cell. In the testcase I used a DIV with 'width: 10px' but any value for 'width' seemed to cause the problem. Placing such a DIV before the SCRIPT did not trip the bug. I'll attach my testcase immediately; it shows four different ways to trip the bug (on my system, anyway) and one that doesn't becuase the sized DIV come before the SCRIPT instead of after. Bear in mind that the bug is only seen the first time a page is loaded; once you've reloaded it the layout will be correct. This makes testing a real pain as one quits and restarts the browser about a zillion times. On the other hand, I did this for about three straight hours under MacOS9.1 and the browser didn't crash once, which is pretty damned impressive. In general, given the rising inccidence of developers using small SCRIPTs to write content into page layouts, this bug ought to get a higher priority. Adding myself to the cc: list.
I also saw this bug under MacOS as well as Win2KPro, so I've flipped the Platform/OS to All/All.
I tested this page http://shopping.netscape.com/deptstores/index.adp on 11_07_09_trunk build and 11_06_22_0.9.4ec build on Win2000 and I can no longer see the problem. Can someone else have a look?
*** Bug 107584 has been marked as a duplicate of this bug. ***
This bug looks fixed now..I tested bug 103319 and that URL is rendering fine...also I tested out the URL in this bug report and that is fine also.. we can RESOLVE this bug.
oops last comment was made by "sujay"...not "shrir"...
The page (http://shopping.netscape.com/deptstores/index.adp) is fixed, but the bug is still in the code (see testcase at comment #20 and also at comment #28) So, as written, this is fixed. There is still a problem that we may want to fix at some time, and there is lots of good info and testcases in this report, so I am updating the summary and moving out the milestone. Thanks everyone.
OS: Windows 2000 → All
Hardware: PC → All
Summary: Table Layout is Off → Script tag in table makes cells expand incorrectly
Target Milestone: mozilla0.9.7 → mozilla0.9.9
Target Milestone: mozilla0.9.9 → mozilla1.2
Attached file 1 simplified testcase
from my testing it seems to me that when a script document.write another <script> it causes this problem.
bug 117695 also has a <script> writing another <script> issue. It might be related.
Sending to Karnaze to look at, since this involves table cell width calculations...
Assignee: attinasi → karnaze
Status: ASSIGNED → NEW
WFM with win98 2002100416, emeyer could you please verify? I think we render this now exactly as IE. This might has been fixed by the patch for bug 154780.
The testcases appear to be rendered correctly in 2002100703-trunk/Mac, so I guess that's a verification.
wfm based on my and emeyers observations
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: