Closed Bug 368335 Opened 17 years ago Closed 16 years ago

I am unable to create a caption on a table in firefox with the default settings.

Categories

(Core :: Layout: Tables, defect)

1.8 Branch
x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: simranjeet.kelley, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1

The example site I sent displays that with the default settings, firefox will not create a caption on a table.  If I go into tools-options-advanced and select the tab says "Change status bar text", and then retry the same site, it works.  I am not sure about this, but I do not think that a table caption is part of the status bar, and it should work even without this option being enabled.

Reproducible: Always

Steps to Reproduce:
1.navigate to http://com.w3schools.com/js/tryit.asp?filename=try_dom_table_createcaption
2. click on try this ... and nothing happens




If you go to tools-options-advanced and select the tab says "Change status bar text" and retry the steps to reproduce the problem, it will work.
Component: Toolbars → General
QA Contact: toolbars → general
1. Load testcase
2. Click 'Create caption'

Expected:
"My table caption" appears above the table

Actual:
Nothing happens.

Works in IE6 and Opera 9.1
Nothing thrown in the error console.
Also doesn't work in Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a2pre) Gecko/20070126 Minefield/3.0a2pre ID:2007012602 [cairo]
Keywords: testcase
Version: unspecified → Trunk
I also noticed that I am unable to apply a style to the text in the caption, and the alignment of the caption is different from that of IE.  Try the following code and the style sheet.  In the function createCaption(), you can comment out the various properties of the caption x to see how they affect the captions behavior.

Style Sheet (name this style.css and keep in the same folder as the HTML Code)
.error {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-weight: bold;
	font-size: 71%;
	color: #990000;
}


HTML CODE

<html>
	<head>
		<LINK href="style.css" type="text/css" rel="stylesheet">
		<script type="text/javascript">
			function createCaption()
			{
				var x=document.getElementById('myTable').createCaption()
				x.innerHTML="My table caption"
				x.className="error";
				x.align="left";
			}
		</script>
	</head>
	<body>
		<table id="myTable" border="1">
			<tr>
				<td>Row1 cell1</td>
				<td>Row1 cell2</td>
			</tr>
			<tr>
				<td>Row2 cell1</td>
				<td>Row2 cell2</td>
			</tr>
		</table>
		<br />
		<input type="button" onclick="createCaption()" value="Create caption">
	</body>
</html>

Testcase and URL works for me in Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.2pre) Gecko/20070129 BonEcho/2.0.0.2pre but not in Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9a2pre) Gecko/20070128 Minefield/3.0a2pre ID:2007012809 [cairo]

Might be related to bug 363248 for trunk.

Reporter, can you please try the testcase with firefox 2.0.0.1 in firefox's safemode. I don't understand why it works for me (and others) in 2.0.0.x but not for you.
http://kb.mozillazine.org/Safe_mode
I just tried running firefox in safemode and I repeatedly tested the caption code.  It worked sometimes, and then sometimes it wouldnt.  I tested in many different ways.  

First, I just went to a url and tried it. Clicked Refresh and tried repeatedly.  
Second, I went to the url and tried it.  Then I simply clicked on the green go arrow and retried it repeatedly.

Both of these gave me about a 60-70% success rate.  It would work once, or sometimes for a few repititions, before it would stopped, and then restart working after I repeatedly refreshed or clicked on the green go button.  

I also noticed that when the caption appeared, the style applied from the style sheet worked CORRECTLY (Just thought I'd mention that because about an hour or two ago I added comments to this case tool indicating that they did not work).  
The caption script works for me with 2007050101. Fix range: 
2007042904 fails.
2007043004 works.

The position of the caption is now in the middle of the page. That's covered by bug 363248 (which doesn't seem to have had anything checked in since comment 3).

The style rules in comment 2 all apply correctly.

There is another bug though, the old row 2 is displayed over the new table. It disappears when selecting the text in the table or refreshing the view in some way, eg. minimizing and restoring. That probably needs a bug filed but I haven't searched bugzilla for it yet.

On Fx2.0.0.3 I see the same behaviour as in comment 4. It seems to me that clicking in the location bar increases the likelyhood of failure. Haven't found anything reproducible though.

I'll narrow the fix range and try to find the patch which fixed it.
bug 379229 is what fixed this on recent trunk. Seems to me that it's unrelated to the branch, but I'm just guessing
Component: General → Layout: Tables
Product: Firefox → Core
QA Contact: general → layout.tables
Changing version to 1.8 branch because it was originally reported there and the trunk bug seems to have been a different issue - the testcase works correctly on 2006103104 and regressed some time between then and 20070129.

I still can't reliably reproduce on Fx2.

For reference, I filed bug 379353 for the display issue in comment 5.
Version: Trunk → 1.8 Branch
I did some further investigation of this.

The bug is definitely more reproducible when using the mouse prior to clicking the "Create Caption" button. That includes clicking the refresh icon rather than pressing F5 to refresh.

According to DOM Inspector the caption is inserted, so this seems to be a repainting issue.

I did some archeology with trunk builds, and the earliest trunk build I can find where the insertion works reliably is 2006042104. Bonsai range: http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2007-04-20+04%3A00&maxdate=2007-04-21+04%3A00&cvsroot=%2Fcvsroot
No one fix in that list stands out to me.

I'm not sure if this is in the right component in light of this info.
I get expected results (a table caption is created) after following, applying steps to reproduce with Firefox 2.0.0.12 rv:1.8.1.12 build 20080201 under XP Pro SP2.

WFM
the test case is wfm
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: