Closed
Bug 76279
Opened 24 years ago
Closed 23 years ago
element.removeAttribute("disabled"); does not enable element
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
RESOLVED
WORKSFORME
Future
People
(Reporter: jelwell, Assigned: jst)
References
()
Details
Attachments
(2 files)
Instead of element.setAttribute("disabled", "false"); my code was calling
element.removeAttribute("disabled"); This used to work, but now fails.
I now *have* to setAttribute("disabled", "false") before I remove the attribute
to get my text xul widgets to work.
*Note: If I remove the attribute without setting to false (when it was true)
then the widgets appear enabled (white, rather than gray) but I can't actually
type into them*
Comment 1•24 years ago
|
||
Would it be possible to get some kind of testcase, or an indication of the
widget on which you were testing the disabled attribute?
Thanks :)
| Assignee | ||
Updated•24 years ago
|
Target Milestone: --- → Future
Comment 4•24 years ago
|
||
This is a specific case of a more general problem.
For example setAttribute("display", none) hides an otherwise visible element.
But removeAttribute("display") does not restore it to its original and default
value. This is actually a worst situation since display could have had different
values originally depending on the element thus making the quick fix suggested
in the description won't work well.
The problem also manifests itself when removing attributes through a stylesheet
object. Apparently the engine does not recompute the style correctly, perhaps
not at all.
Comment 5•24 years ago
|
||
When I posted the first message I didn't realize the description was talking
about element.removeAttribute(...) rather than
element.style.removeAttribute(...). What I mentioned is probably another bug.
| Assignee | ||
Comment 6•24 years ago
|
||
Um, element.style doesn't have methods named setAttribute(), or
removeAttribute(), nor does stylesheet objects. What exactly is the problem
here? We need a testcase, or this will be marked INVALID.
Comment 7•23 years ago
|
||
<html>
<head>
<style type="text/css" id="style1">
<!--
P { font-family: Arial, Helvetica, sans-serif; color: red}
.tiny { font-size: 8pt}
-->
</style>
</head>
<body>
<P class="tiny">Small fonts</P>
<script type="text/javascript">
elem = document.getElementById("style1");
//Fialed in both the cases. Should see the text in red. both setAttribute and
removeAttribute did not work
elem.setAttribute("disabled", "false");
elem.removeAttribute("disabled");
</script>
</body>
Priority: -- → P2
Comment 8•23 years ago
|
||
the testcase failed in both the cases.
removeAttribute(disabled) and setAttribute(disabled, false) both did not work
Comment 9•23 years ago
|
||
Sivakiran, I see the text in red and small fonts in 0.9.9.
Attaching a testcase that shows that removeAttribute on HTML text inputs (XUL
text inputs are the same, unless there's a bug in XBL) works fine. Joseph, does
this still happen?
Comment 10•23 years ago
|
||
| Assignee | ||
Comment 11•23 years ago
|
||
WORKSFORME...
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•