Closed
Bug 25686
Opened 26 years ago
Closed 26 years ago
Clash between style assigned by class and changed in DOM by JavaScript
Categories
(Core :: DOM: CSS Object Model, defect, P3)
Tracking
()
VERIFIED
FIXED
People
(Reporter: gartside, Assigned: vidur)
Details
Build: M13. On linux i686 (as below).
The following html should give a link which hides or shows a division of text.
-Via javascript and DOM2. It works if the division has no class attribute, or if
it does have a class attribute which does not refer to display (explicitly or
implicitly via the `float' style).
But in the example below the hide/show works twice (hides, shows) but then does
not `hide' anymore.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Test</title>
<style>
div.redRight {float: right; width: 50%; background-color: red}
</style>
<script language="Javascript">
function hideShow(obj)
{
if (obj.style.display=="none")
obj.style.display="block";
else obj.style.display="none";
}
</script>
</head>
<body>
<a href="" onClick="hideShow(document.getElementById('testId')); return
false;">Press me!</a>
<div class="redRight" id="testId">
<b>Text Here:</b>
<p>More text</p>
<p>Yes and much more etc etc etc .</p>
</div>
</body>
</html>
| Assignee | ||
Comment 1•26 years ago
|
||
Fixed by a checkin by Troy late last week. The style reresolution after the
style change was returning an old style context because the original floated
element wasn't correctly being deleted.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 2•26 years ago
|
||
I've just downloaded the latest binary, and the test works fine.
Good work!
Updated•25 years ago
|
Component: DOM Level 2 → DOM Style
Comment 3•25 years ago
|
||
Taking QA Contact on all open or unverified DOM Style bugs...
QA Contact: vidur → ian
You need to log in
before you can comment on or make changes to this bug.
Description
•