Last Comment Bug 46555 - "Select All" is enabled even when text field is empty
: "Select All" is enabled even when text field is empty
Status: RESOLVED FIXED
: polish
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: All All
: P3 normal (vote)
: mozilla9
Assigned To: Graeme McCutcheon [:graememcc]
:
: Makoto Kato [:m_kato]
Mentors:
: 393799 (view as bug list)
Depends on: 483651 682618
Blocks: 712871
  Show dependency treegraph
 
Reported: 2000-07-26 14:52 PDT by Eli Goldberg
Modified: 2011-12-22 07:56 PST (History)
10 users (show)
graeme.mccutcheon: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Proposed patch (831 bytes, patch)
2002-07-27 16:32 PDT, Michal Bukovjan
mozeditor: review+
Details | Diff | Splinter Review
Updated patch, with test (4.93 KB, patch)
2011-08-19 13:48 PDT, Graeme McCutcheon [:graememcc]
ehsan: review+
Details | Diff | Splinter Review
Update to test_contextmenu.html (1.00 KB, patch)
2011-09-14 14:42 PDT, Graeme McCutcheon [:graememcc]
gavin.sharp: review+
Details | Diff | Splinter Review

Description Eli Goldberg 2000-07-26 14:52:49 PDT
* 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).
Comment 1 rubydoo123 2000-07-27 08:40:34 PDT
setting to m19
Comment 2 rubydoo123 2000-09-19 18:30:27 PDT
moving to future per review with bij and beppe
Comment 3 rubydoo123 2002-03-08 12:02:06 PST
removing myself from the cc list
Comment 4 Michal Bukovjan 2002-07-27 16:32:30 PDT
Created attachment 93039 [details] [diff] [review]
Proposed patch

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.
Comment 5 Simon Fraser 2002-07-29 09:35:04 PDT
Over to Joe.
Comment 6 Joe Francis 2002-08-07 11:55:45 PDT
Comment on attachment 93039 [details] [diff] [review]
Proposed patch

r=jfrancis
Comment 7 Joe Francis 2002-08-07 11:56:25 PDT
simon, sr?
Comment 8 Simon Fraser 2002-08-07 12:07:36 PDT
+      *outCmdEnabled = !(*outCmdEnabled);

That's a bit yucky. How about:

PRBool docIsEmpty;
nsresult res = aEditor->GetDocumentIsEmpty(&docIsEmpty);
...
*outCmdEnabled = !docIsEmpty;
Comment 9 Joe Francis 2002-11-11 03:46:33 PST
differentiating bug severity of my most critical bugs vai abuse of milestone field
M2: severe
M1: very severe and/or fix in hand
Comment 10 Marco Bonardo [::mak] 2007-08-26 17:35:25 PDT
*** Bug 393799 has been marked as a duplicate of this bug. ***
Comment 11 Graeme McCutcheon [:graememcc] 2009-03-16 12:30:36 PDT
> 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
Comment 12 Graeme McCutcheon [:graememcc] 2011-08-19 13:48:43 PDT
Created attachment 554532 [details] [diff] [review]
Updated patch, with test
Comment 13 :Ehsan Akhgari 2011-08-19 15:18:25 PDT
Comment on attachment 554532 [details] [diff] [review]
Updated patch, with test

Looks good!

Have you also run this through the try server?
Comment 14 Graeme McCutcheon [:graememcc] 2011-08-20 08:13:07 PDT
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...
Comment 15 Graeme McCutcheon [:graememcc] 2011-09-14 14:42:09 PDT
Created attachment 560253 [details] [diff] [review]
Update to test_contextmenu.html

We'll need to land this as well when bug 682618 is fixed.
Comment 16 Graeme McCutcheon [:graememcc] 2011-09-23 15:01:29 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/4297a90d3bea
Comment 17 Ed Morley [:emorley] 2011-09-23 20:46:28 PDT
https://hg.mozilla.org/mozilla-central/rev/4297a90d3bea

Note You need to log in before you can comment on or make changes to this bug.