bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

innerHTML on button funkyness

RESOLVED FIXED in Future

Status

()

Core
Layout: Form Controls
RESOLVED FIXED
17 years ago
15 years ago

People

(Reporter: Jeremy M. Dolan, Assigned: John Keiser (jkeiser))

Tracking

({testcase})

Trunk
Future
testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(4 attachments)

(Reporter)

Description

17 years ago
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.

Comment 2

17 years ago
or alternatively change its value attribute...
(Reporter)

Comment 3

17 years ago
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.

Comment 4

17 years ago
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.

Comment 5

17 years ago
Created attachment 57351 [details]
This test case uses the innerHTML approach to change the button text.

Comment 6

17 years ago
Created attachment 57352 [details]
This test case takes the Text Node approach to change the button's text

Comment 7

17 years ago
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.

Comment 8

17 years ago
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

Updated

17 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → Future

Updated

17 years ago
Blocks: 120220
*** Bug 154475 has been marked as a duplicate of this bug. ***

Comment 14

16 years ago
This WFM with XBLFC.

Comment 15

16 years ago
Created attachment 102787 [details]
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.

Updated

16 years ago
Keywords: mozilla1.2

Comment 16

16 years ago
Created attachment 102788 [details]
Testcase using nodeValue

This testcase works fine, changing the button text with
elm.firstChild.nodeValue instead.

Comment 17

16 years ago
-->
Assignee: rods → jkeiser
Status: ASSIGNED → NEW

Updated

16 years ago
Keywords: mozilla1.2 → mozilla1.3

Updated

16 years ago
Keywords: testcase

Updated

15 years ago
Keywords: mozilla1.3
Fixed by patch in bug 226016
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.