Closed Bug 98239 Opened 23 years ago Closed 21 years ago

innerHTML on button funkyness

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: jmd, Assigned: john)

References

()

Details

(Keywords: testcase)

Attachments

(4 files)

Go to URL, do the english one... Start and stop...the button gets reaaaly small.
Play with the manual controls and Start again...odd.

That code works fine in IE5 and 5.5.

This works ok if I use an input type=button and change it's .value (the stuff
that's commented out in the source).

If innerHTML is an extention, is there some standard way to change the
<button>'s text?
Yes... just modify the text node that's a child of the button.
or alternatively change its value attribute...
fair enough. I was having problems because I'm no web developer, and can't
really take the time to read W3's incredibly obtuse DOM spec, for this one small
JS my company needed. All the examples out there on the web I came across used
non-standard stuff like innerHTML.

Someone on #mozilla helpfully showed me removeChild(firstChild) / createTextNode
/ appendChild.

I'm fine with a WONTFIX here, if the time could be better spent on making the
REAL DOM work better, or some introductory docs for users used to the old
proprietary DOMs.
Okay, I tried both the innerHTML approach as well as the text node approach but
both cause the button to go haywire.

I've tested this with the latest nightly (2001110921) on linux.
I've added two test cases. One takes the innerhtml approach to change the button
text the other takes the Text Node approach to change the button text.

Both however as I mentioned in my previous comment exhibit the same problem,
namely the button text is annihilated.

Again, I've tested this with the very latest nightly (2001110921) on Linux.
Funky.
bz, any idea what gives with the text node testcase? Sounds like that should
work, really.
Yes, it should.  I remember poking at that code and not seeing obvious errors
that would cause this...  it feels like a form controls bug....
*** Bug 107259 has been marked as a duplicate of this bug. ***
Bug 107259 has a testcase that demonstrates this problem using replaceChild() as 
well....
Over to rods, formcontrol layout problem.
Assignee: jst → rods
Component: DOM Mozilla Extensions → HTML Form Controls
OS: Linux → All
QA Contact: lchiang → madhur
Hardware: PC → All
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Blocks: 120220
*** Bug 154475 has been marked as a duplicate of this bug. ***
This WFM with XBLFC.
Attached file Minimized testcase
Testcase shows that this is still broken. Comment 4 also says that this also
occur if you do the text change via changing the text node.

Using build 2002101308, Windows 2000.
Keywords: mozilla1.2
This testcase works fine, changing the button text with
elm.firstChild.nodeValue instead.
-->
Assignee: rods → jkeiser
Status: ASSIGNED → NEW
Keywords: mozilla1.2mozilla1.3
Keywords: testcase
Keywords: mozilla1.3
Depends on: 226016
Fixed by patch in bug 226016
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: