Closed
Bug 1295
Opened 26 years ago
Closed 25 years ago
Changing styles on table cells via DOM seems to remove table borders
Categories
(Core :: Layout: Tables, defect, P2)
Tracking
()
VERIFIED
FIXED
M10
People
(Reporter: angus, Assigned: karnaze)
References
Details
I think there's something funky going on with the CSS OM code and borders.
Here's some sample code:
<html>
<head>
<script>
var selectedCell = null;
function select(e) {
if (selectedCell) {
selectedCell.style.backgroundColor="white";
selectedCell.style.color="black";
}
selectedCell = this;
this.style.backgroundColor="blue";
this.style.color="white";
}
function init() {
var cells = document.getElementsByTagName("TD");
for (var i=0; i<cells.length; i++) {
cells[i].onmousedown=select;
}
}
</script>
</head>
<body onload="init()">
<table id="mytable" border=1 cellspacing=3 cellpadding=10>
<tr>
<td>Apples</td>
<td>Oranges</td>
<td>Peaches</td>
</tr>
<tr>
<td>Guitar</td>
<td>Violin</td>
<td>Bass</td>
</tr>
<tr>
<td>Basketball</td>
<td>Baseball</td>
<td>Football</td>
</tr>
</table>
</body>
As you click on each cell, it should look "selected." Unfortunately, when I do
this, the borders for the individual cells disappear as well, as though I were
making a style declaration like:
this.style.border="none";
Which I am not. Weird, huh? Not sure if this is tables or DOM or what...
My guess is this:
The table cell border comes indirectly from the table "border" HTML attribute.
Changing an attribute on the cell causes style to get re-resolved.
The cell border is computed in DidSetStyleContext. DidSetStyleContext is only
called if the re-resolved style context is different than the previous style
context. This seems to be the case in the "selectedCell" case even though we're
setting the selected cell's style.
Comment 5•26 years ago
|
||
per leger, assigning QA contacts to all open bugs without QA contacts according
to list at http://bugzilla.mozilla.org/describecomponents.cgi?product=Browser
Updated•26 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M4 → M6
Updated•25 years ago
|
Target Milestone: M6 → M7
Updated•25 years ago
|
Assignee: peterl → karnaze
Status: ASSIGNED → NEW
Comment 6•25 years ago
|
||
This requires the DidSetStyleContext logic for borders to be moved into the
table MapAttributesInto code (stub in place).
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M9 → M10
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 7•25 years ago
|
||
Fixed with latest checkin. You have to load the test page twice to get the
javascript to work, but that's another bug that's probably been filed.
Updated•25 years ago
|
Status: RESOLVED → VERIFIED
Comment 8•25 years ago
|
||
Using 9/16 Apprunner, verified fixed. Clicking on each cell highlights the cell
as selected
You need to log in
before you can comment on or make changes to this bug.
Description
•