Closed
Bug 137357
Opened 22 years ago
Closed 22 years ago
[RR]Dynamically switching CSS makes display:none "stick"
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
DUPLICATE
of bug 136728
People
(Reporter: stefan.huszics, Assigned: dbaron)
Details
Attachments
(3 files, 1 obsolete file)
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•22 years ago
|
||
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•22 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><code></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><span class="block"></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>
Comment 3•22 years ago
|
||
Comment 4•22 years ago
|
||
Comment 5•22 years ago
|
||
Attachment #79128 -
Attachment is obsolete: true
Comment 6•22 years ago
|
||
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•22 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
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•