Open Bug 759144 Opened 14 years ago Updated 3 years ago

[BC]Dynamic changes to cell border widths can't seem to shrink the used border width

Categories

(Core :: Layout: Tables, defect)

12 Branch
x86_64
Linux
defect

Tracking

()

People

(Reporter: andyearnshaw, Unassigned)

Details

Attachments

(2 files, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Ubuntu/12.04 Chromium/18.0.1025.151 Chrome/18.0.1025.151 Safari/535.19 Steps to reproduce: I have a table, of which several rows are hidden by default for the purposes of animating when the table takes focus. These rows are hidden by setting the font-size and border-width of their child TD elements to 0 in order to work around the limitation of not being able to animate the CSS display property. Actual results: Once a cycle of showing and hiding the elements again has completed, one or more of the TD elements now has a computed height and border-width of 1px. This occurs regardless of animation or choice of pseudo-class used. Expected results: The computed style values should return to their original state once the pseudo-class no longer applies. An example is available at http://jsfiddle.net/NprYn/. Click the table once to expand several hidden rows. Click anywhere else to hide the rows again and look at the top of the table.
td { padding: 0px } was essential to the testcase but only included because it was part of the JSFiddle normalize.css (Please don't use JSFiddle for testcases for bugs.)
Attachment #627742 - Attachment is obsolete: true
Sorry, I'm very lazy and it won't happen again :-)
The basic issue is that BCMapCellInfo::SetBottomBorderWidths and BCMapCellInfo::SetTopBorderWidths can never shrink the border widths of the cell, as far as I can see: 5293 mCell->SetBorderWidth(NS_SIDE_BOTTOM, NS_MAX(aWidth, 5294 mCell->GetBorderWidth(NS_SIDE_BOTTOM))); and 5306 mCell->SetBorderWidth(NS_SIDE_TOP, NS_MAX(aWidth, 5307 mCell->GetBorderWidth(NS_SIDE_TOP))); The code has been this way (modulo some renaming) since this checkin: 3.471 <karnaze@netscape.com> 2002-02-19 07:48 bug 41262 - new table border collapsing code. sr=attinasi, r=alexsavulov. We really need to take an axe to the [BC] stuff. :(
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Certain styles not correctly recalculated for TD elements once ancestor pseudo-class no longer applies → [BC]Dynamic changes to cell border widths can't seem to shrink the used border width
Test ---- http://www.gtalbot.org/BugzillaSection/Bug759144-Dynamic-changes-border-width.html The border-top of the topmost cell is 0px. But since the table's border-top is 50px, then the resulting border-top for that cell is 50px: the wider border of conflicting cells wins. This happens in both tables. Now, after the document has finished loading, the border-top of the topmost cell of the first table, of the dynamic table is dynamically set from 0px to 50px. Since the table's border-top is already also 50px, then the collapsed border of the cell should still remain 50px too. But this execution in Firefox 47 and in Firefox 50.0a1 (buildID=20160701121753) unexpectedly changes the rendering (rightmost part) of the blue border-top of the 3rd cell. There are other tests possible to do on dynamic changes to cell border widths but this one is probably the simpliest I could do.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: