Closed
Bug 195567
Opened 23 years ago
Closed 21 years ago
problems using DOM to toggle display between inline and none
Categories
(Core :: Layout, defect, P3)
Tracking
()
RESOLVED
WORKSFORME
Future
People
(Reporter: gav, Unassigned)
Details
Attachments
(2 files)
Consider this testcase (I'll attach it in a minute):
<html><head><title>Inline demo</title>
<style type="text/css">
.test { background-color: #ddd;
border: 1px solid red;
display: none;}
</style>
<script language="JavaScript" type="text/JavaScript">
function changeProp(objName,theProp,theValue) {
var obj = document.getElementById(objName);
eval("obj."+theProp+"='"+theValue+"'");
}
</script></head>
<body>
<a href="#" onclick="changeProp('tester1','style.display','inline');">show div 1</a>
<a href="#" onclick="changeProp('tester1','style.display','none');">hide div 1</a>
<br>
<a href="#" onclick="changeProp('tester2','style.display','inline');">show div 2</a>
<a href="#" onclick="changeProp('tester2','style.display','none');">hide div 2</a>
<hr>
<div id="tester1" class="test"><ul><li>test div 1</li></ul></div>
<div id="tester2" class="test">test div 2</div>
</body></html>
Clicking the links should show/hide the two divs. The second works, but the
first doesn't, because of the list inside the DIV.
At first glance, this is a block-in-inline situation, similar to that described
in bug 135082.
I'll leave those who understand layout to work out whether this is a duplicate
of that bug, or another, (or even invalid, since you're not supposed to get
blocks inside inlines anyhow)
| Reporter | ||
Comment 1•23 years ago
|
||
| Reporter | ||
Comment 2•23 years ago
|
||
Arg. stuff I forgot (sorry, it's late):
the first div will "show", but not hide.
1.3Beta (2003021008), Win XP.
Apologies for the spam.
Updated•23 years ago
|
Priority: -- → P3
Updated•23 years ago
|
Target Milestone: --- → Future
Comment 3•23 years ago
|
||
I simply took the first testcase and replaced the
changeProp(xxxx,'style.display','inline')
into
changeProp(xxxx,'style.display','block')
| Reporter | ||
Comment 4•23 years ago
|
||
Thanks, but I knew that. What happens when it's inline *is* the bug.
| Reporter | ||
Comment 5•23 years ago
|
||
Aha! The behaviour of this has changed in Moz 1.4 and Mozilla Firebird 0.6.1:
Things now appear and disappear again properly. The first div renders very
strangely, but that's presumably fallout from having a block-in-inline situation.
| Reporter | ||
Comment 6•21 years ago
|
||
As of Firefox 1.0, this is showing/hiding as expected.
It still renders funny, but I'm not fussed about that, given the block-in-inline
shenanigans.
->WFM
| Reporter | ||
Comment 7•21 years ago
|
||
Arg. REALLY ->WFM. Apologies for spam.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•