[RR]Dynamically switching CSS makes display:none "stick"

RESOLVED DUPLICATE of bug 136728

Status

()

Core
CSS Parsing and Computation
RESOLVED DUPLICATE of bug 136728
16 years ago
16 years ago

People

(Reporter: Stefan Huszics, Assigned: dbaron)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 1 obsolete attachment)

(Reporter)

Description

16 years ago
switching CSS {display:none} and {display:inline} in an element fail to work
(once in display:none mode the element stays there) unless an by default inline
element is made into a block level element and placed nesting the other element.

Check testcase.
(Reporter)

Comment 1

16 years ago
Created attachment 79128 [details]
Testcase

You will have to create the 2 external CSS files html.css & xhtml.css 

html.css should contain 
 .html {display:inline;}
 .xhtml {display:none;}

xhtml.css should contain
 code {display:block;}
 .block {display:block;}
 .html {display:none;}
 .xhtml {display:inline;}
(Reporter)

Comment 2

16 years ago
Also posting examplecode here for easier referenace 

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link rel="stylesheet" title="Default" media="screen" href="html.css"
type="text/css" id="switchML" />
<script type="text/javascript">
function changeToXHTML()
{
document.getElementById("switchML").href='xhtml.css';
}

function changeToHTML()
{
document.getElementById("switchML").href='html.css';
}
</script>
</head>

<body>
<p>
When the below links are clicked, all texts should switch from HTML 4.01 to
XHTML 1.0 and back<br />
However this only happens in the boxs with green border, which has a
{display:block} rule for a parent (originally inline) entity.<br />
In the red border boxes all text remains as {display:none} whatever you click
after the first HTML -> XHTML switch.<br />
Compair functionality with IE 6.0.
</p>

<p>
<a href="#" onclick="javascript:changeToHTML()">HTML 4.01</a> | 
<a href="#" onclick="javascript:changeToXHTML()">XHTML 1.0</a>
</p>

<div style="border:1px solid red;">
<span class="html">HTML 4.01</span>
<span class="xhtml">XHTML 1.0</span>
</div>

<p>style="width:100px; height:20px;"</p>

<div style="width:100px; height:20px; border:1px solid red;">
<span class="html">HTML 4.01</span>
<span class="xhtml">XHTML 1.0</span>
</div>

<p>&lt;code&gt;</p>

<div style="border:1px solid green;">
<code>
<span class="html">HTML 4.01</span>
<span class="xhtml">XHTML 1.0</span>
</code>
</div>

<p>&lt;span class="block"&gt;</p>

<div style="border:1px solid green;">
<span class="block">
<span class="html">HTML 4.01</span>
<span class="xhtml">XHTML 1.0</span>
</span>
</div>


<pre>
html.css should contain 
 .html {display:inline;}
 .xhtml {display:none;}

xhtml.css should contain
 code {display:block;}
 .block {display:block;}
 .html {display:none;}
 .xhtml {display:inline;}
</pre>

</body>
</html>
looks like another ReResolveStyleContext bug....
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 98 → All
Hardware: PC → All
Summary: Dynamically switching CSS makes display:none "stick" → [RR]Dynamically switching CSS makes display:none "stick"
(Assignee)

Comment 7

16 years ago
Actually it's not ReResolve, strictly.  It's because we're clearing the
undisplayed content map too much, which should only be done on full frame tree
reconstruct.  And now we're clearing it even more as a workaround to bug 118014.

*** This bug has been marked as a duplicate of 136728 ***
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.