Closed Bug 46555 Opened 24 years ago Closed 13 years ago

"Select All" is enabled even when text field is empty

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: elig, Assigned: graememcc)

References

Details

(Keywords: polish)

Attachments

(3 files)

* TITLE/SUMMARY
"Select All" is enabled even when text field is empty

* STEPS TO REPRODUCE
0) Launch Seamonkey
1) Clear the content of the URL bar
2) Open the "Edit" menu

* RESULT
 - What happened

"Select All" is enabled.

 - What was expected 

"Select All" should be disabled unless the URL bar contains content. (Unable to 
check via context menus)

Note that this also occurs in form text fields, both using the main application 
menu and using context menus.

* REGRESSION

 - Occurs On
        Mac OS/Win32/Linux Seamonkey (200072608 optimized build)		

 - Doesn't Occur On
        Communicator 4.7.4 RTM (Mac OS)




* CONFIGURATIONS TESTED

- [Mac] Power Mac G4 (450 Mhz), 256 MB RAM (VM off), 1024x768 (Thousands of 
Colors), Mac OS 9.0

- [Win32] Vectra VL (266 MHz P2), 96 MB RAM, 800x600 (True Color), NT 4.0 SP5.

- [Linux] Vectra VL (266 MHz P2), 96 MB RAM. Red Hat Linux 6.0 (GNOME).
setting to m19
Keywords: polish
Target Milestone: --- → M19
moving to future per review with bij and beppe
Keywords: helpwanted
Target Milestone: M19 → Future
Keywords: mozilla0.9
removing myself from the cc list
Attached patch Proposed patchSplinter Review
This patch fixes the problem.
It exposes an editor buglet, though:
In an HTML textarea (and only in there, not in edits) when I type a letter into
an empty textarea, then delete it (Backspace key), I can still Select all.
If I type a letter, do Select All, then delete it (Del key), the command is
correctly disabled.
Probably should be filed as another bug.
Over to Joe.
Assignee: sfraser → jfrancis
Comment on attachment 93039 [details] [diff] [review]
Proposed patch

r=jfrancis
Attachment #93039 - Flags: review+
simon, sr?
Status: NEW → ASSIGNED
Target Milestone: Future → M1
+      *outCmdEnabled = !(*outCmdEnabled);

That's a bit yucky. How about:

PRBool docIsEmpty;
nsresult res = aEditor->GetDocumentIsEmpty(&docIsEmpty);
...
*outCmdEnabled = !docIsEmpty;
differentiating bug severity of my most critical bugs vai abuse of milestone field
M2: severe
M1: very severe and/or fix in hand
Target Milestone: M1 → M2
QA Contact: sujay → editor
Assignee: mozeditor → nobody
Status: ASSIGNED → NEW
Depends on: 483651
> It exposes an editor buglet, though:
> In an HTML textarea (and only in there, not in edits) when I type a letter into
> an empty textarea, then delete it (Backspace key), I can still Select all.
> If I type a letter, do Select All, then delete it (Del key), the command is
> correctly disabled.
> Probably should be filed as another bug.

Bug 483651
Attachment #554532 - Flags: review?(ehsan)
Comment on attachment 554532 [details] [diff] [review]
Updated patch, with test

Looks good!

Have you also run this through the try server?
Attachment #554532 - Flags: review?(ehsan) → review+
Hm, this isn't ready to be landed yet.

On try, browser/base/content/tests/test_contextmenu.html failed, due to it testing for select all being enabled for an empty text input. Changing the test to reflect that it will be disabled, and the same check fails on Mac. Fun times.

Looking into this...
Depends on: 682338
Depends on: 682618
No longer depends on: 682338
We'll need to land this as well when bug 682618 is fixed.
Attachment #560253 - Flags: review?(gavin.sharp)
Attachment #560253 - Flags: review?(gavin.sharp) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/4297a90d3bea
Assignee: nobody → graememcc_firefox
Status: NEW → ASSIGNED
Flags: in-testsuite+
Keywords: helpwanted
Target Milestone: M2 → mozilla9
https://hg.mozilla.org/mozilla-central/rev/4297a90d3bea
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: