HTMLInputElement.select() does not work

VERIFIED FIXED in M17

Status

()

Core
Layout: Form Controls
P3
normal
VERIFIED FIXED
19 years ago
17 years ago

People

(Reporter: Simon Fraser, Assigned: Simon Fraser)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: Fix in Hand)

(Assignee)

Description

19 years ago
The select() method on HTMLInputElement() does not work. It calls into 
nsHTMLInputElement::Select(), which calls

formControlFrame->SetProperty(presContext, nsHTMLAtoms::select, "");

on the nsGfxTextControlFrame, but this does nothing.

It seems to me that we should add selection-setting methods to 
nsIGfxTextControlFrame, and call them.

I'm looking at this because of bug 33967, which is related.

Comment 1

18 years ago
Simon, you hit this one right on the head.  It made fixing it a cinch.  I
probably won't get a chance to get it in with some of the other nasty things I'm
trying to fix for M16, so setting Milestone to M17.
Status: NEW → ASSIGNED
OS: Mac System 8.5 → All
Whiteboard: Fix in Hand
Target Milestone: --- → M17
(Assignee)

Comment 2

18 years ago
I have the fix in my tree. Taking bug.
Assignee: pollmann → sfraser
Status: ASSIGNED → NEW

Comment 3

18 years ago
I have a fix in my tree too, as I mentioned above and wrote in the status 
whiteboard yesterday.  Does your fix look like mine?  Here's a patch (may be 
offset, lines added to nsGfxTextControlFrame::SetProperty):

Index: nsGfxTextControlFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp,v
retrieving revision 3.161
diff -r3.161 nsGfxTextControlFrame.cpp
1443a1418,1423
>       }
>     }
>     else if (nsHTMLAtoms::select == aName)
>     {
>       if (mEditor) {
>         mEditor->SelectAll();

If yours is equivalent, please feel free to mark it r=pollmann.

Comment 4

18 years ago
Arg, I think I added yesterday's comment about not getting the fix in until M17 
to the wrong bug.  :S  I see why you grabbed this (I updated milestones on over 
50 bugs yesterday, guess I made at least one mistake).  At any rate the change 
is small, feel free to check it in.
(Assignee)

Comment 5

18 years ago
No, my fix is a little more involved. I've added a method 
SetSelectionRange(PRInt32 start, PRInt32 end) to ns[I]GfxTextControlFrame, 
because I need to implement support for setting the selection specifically from 
JS (see bug 33967). So I have a bunch more code to go in, some of which fixes 
this bug.
Status: NEW → ASSIGNED
(Assignee)

Comment 6

18 years ago
I checked in a fix for this for both <input type="text">, and <textarea>
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED

Comment 7

18 years ago
Thanks Simon, you are 'da man'.  :)

Comment 8

18 years ago
Updating QA contact.
QA Contact: ckritzer → bsharma

Comment 9

17 years ago
Verified on build 2001-08-13-03T os:win98,win95,mac8.6
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.