Closed Bug 180242 Opened 22 years ago Closed 13 years ago

switching stylesheets is buggy if CSS contains fixed-positionned divs with display:table

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: pascalc, Unassigned)

References

Details

(Keywords: css2, testcase, Whiteboard: [reflow-reason])

Attachments

(4 files)

Mozilla 2002111214

steps to reproduce the bug :

1- open a page which has the following code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
<title>Nouveau</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15">
<link rel="stylesheet" href="tableau.css" type="text/css" media="all"
title="Menu 1">
<link rel="alternate stylesheet" href="bloc.css" type="text/css" media="all"
title="Menu 2">
</head>
<body>

<div id="menu">
<a href="toto.htm">lien 1</a>
<a href="toto.htm">lien 2</a>
<a href="toto.htm">lien 3</a>
<a href="toto.htm">lien 4</a>
<a href="toto.htm">lien 5</a>
</div>
</body>

---
tableau.css has the following code :
#menu {
	position:fixed;
	display:table;
	width:100%;
}


#menu a {
	display:table-cell;
	border:1px solid black;
	width:20%;
}


bloc.css has the following code:
#menu {
	position : fixed;
	right : 10px;
	bottom:10px;
	border : 1px solid Black;
}

#menu a {
	display:block;
}


2/ switch the stylesheet from Menu 1 to Menu 2

3/ switch the stylesheet from menu 2 to menu 1

Expected result:
In step 3 the page should display as in step 1

Actual result:
In step 3, the display:table-cell on links seems to be lost, cells are piled up

it might be a dupe of bug 128207
Attached file testcase, HTML part
The HTML code
I put an online testcase there:
http://pascal.chevrel.free.fr/mozilla/testalternate.htm
Still buggy in build 2003042208
Keywords: testcase
I think I've come accross a (possibly) more general problem with position: fixed.

I have some DIVs with position: fixed set, which contain a table and other divs.
The problem is that when I load (while viewing the page) a new stylesheet that
changes the font size, *nothing* in the position: fixed DIVs seems to get
reflowed. Sure, the text changes size - but the cells of the table, spacing of
the DIVs containing text, etc., just doesn't change.

If I then set display: none on the DIVs, and set it back again (to block), they
show fine (presumably getting a proper reflow this time). I can also fix the
table by hiding/showing one of the rows in it, for example, again probably just
enough of a hint to reflow.
Depends on: 170644
HTML File, which points directly to the style sheets on this server. This makes
it easier to test.
Keywords: css2
Summary: [CSS] switching stylesheets is buggy if CSS contains fixed-positionned divs with display:table → switching stylesheets is buggy if CSS contains fixed-positionned divs with display:table
Fixed by checkin for bug 170644.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Reopening, not fixed. With Win FF 1.5, the testcase loads in Menu 1 style. Selecting Menu 2 style then returning to Menu 1 doesn't show the same layout it did on load.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee: dbaron → nobody
Status: REOPENED → NEW
QA Contact: ian → style-system
This works for me in nightly.  (We've fixed lots of things in things like this, and the current code is quite solid.)
Status: NEW → RESOLVED
Closed: 20 years ago13 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: