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)

x86
Linux
defect

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*
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 :)
not mine, handing off to desale
QA Contact: janc → desale
Target Milestone: --- → Future
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala
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.
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.
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.
<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
Attached file testcase
the testcase failed in both the cases. removeAttribute(disabled) and setAttribute(disabled, false) both did not work
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?
WORKSFORME...
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: