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

RESOLVED WORKSFORME

Status

()

Core
CSS Parsing and Computation
RESOLVED WORKSFORME
16 years ago
7 years ago

People

(Reporter: pascalc, Unassigned)

Tracking

({css2, testcase})

Trunk
x86
Windows XP
css2, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [reflow-reason])

Attachments

(4 attachments)

(Reporter)

Description

16 years ago
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
(Reporter)

Comment 1

16 years ago
Created attachment 106303 [details]
testcase, HTML part

The HTML code
(Reporter)

Comment 2

16 years ago
Created attachment 106304 [details]
the "menu 1" stylesheet (default stylesheet)
(Reporter)

Comment 3

16 years ago
Created attachment 106305 [details]
the "Menu 2" stylesheet (alternate stylesheet)
(Reporter)

Comment 4

16 years ago
I put an online testcase there:
http://pascal.chevrel.free.fr/mozilla/testalternate.htm
(Reporter)

Comment 5

15 years ago
Still buggy in build 2003042208
Keywords: testcase

Comment 6

15 years ago
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.
Whiteboard: [reflow-reason]

Comment 7

15 years ago
Created attachment 133569 [details]
HTML File (this one directly point to the style sheets on the bugzilla server)

HTML File, which points directly to the style sheets on this server. This makes
it easier to test.

Updated

14 years ago
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
Last Resolved: 14 years ago
Resolution: --- → FIXED

Comment 9

13 years ago
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
Last Resolved: 14 years ago7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.