Closed
Bug 345428
Opened 18 years ago
Closed 16 years ago
No spellcheck on focus out
Categories
(Core :: Spelling checker, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: hyrurg, Assigned: martijn.martijn)
References
Details
Attachments
(4 files, 3 obsolete files)
784 bytes,
text/html
|
Details | |
8.15 KB,
text/plain
|
Details | |
7.86 KB,
patch
|
smaug
:
review+
brettw
:
review+
damons
:
approval1.9+
|
Details | Diff | Splinter Review |
8.88 KB,
text/plain
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060710 Firefox/2.0b1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1b1) Gecko/20060710 Firefox/2.0b1 No spell checking occurs on last typed word if: 1. there are no non-word characters after it 2. textarea lost focus Reproducible: Always Steps to Reproduce: 1. Type some misspelled word into textarea (e.g. exxample) 2. Do not type any character after it and do not move cursor 3. Click outside the textarea Actual Results: The misspelled word doesn't get underlined Expected Results: The misspelled word should get underlined
Assignee | ||
Comment 1•18 years ago
|
||
This reminds me of the discussion in bug 342511.
Assignee: nobody → mscott
Component: General → Spelling checker
Product: Firefox → Core
QA Contact: general → spelling-checker
Version: 2.0 Branch → Trunk
Comment 4•17 years ago
|
||
And as Seth noted, also while tabbing out of single-line textboxes, like a Thunderbird compose subject.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 5•17 years ago
|
||
I was hoping to solve this by simply making mozInlineSpellChecker implement the nsIDOMUIListener (for FocusOut) or nsIDOMFocusListener (for Blur), and forcing a spelling corretion, but that didn't work. (I didn't get called when I expected.) for tab, I was able to add a case for nsIDOMKeyEvent::DOM_VK_TAB to mozInlineSpellChecker::KeyPress() to get called when tabbing, but implementing a blur listener seems like the right fix.
Assignee | ||
Comment 6•17 years ago
|
||
I copied this code more or less from nsFormFillController.cpp and this works, but when I reload a bunch of textareas, I get a heap corruption error in my vc debugger, I have no idea why. I don't get this in mingw.
Assignee | ||
Comment 7•17 years ago
|
||
Comment 8•17 years ago
|
||
martin, thanks for working on this! a couple questions 1) why is this line necessary? +NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMFocusListener) I don't think you need it, as we have: NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMKeyListener) 2) + /*BEGIN implementations of focus event handler interface*/ + NS_IMETHOD Focus(nsIDOMEvent* aEvent); + NS_IMETHOD Blur(nsIDOMEvent* aEvent); Following the style of the existing code, I think you want add: /*END implementations of focus event handler interface*/ 3) I've made the corrections and I'm running locally, and I'm not seeing a heap corruption error
Assignee | ||
Comment 9•16 years ago
|
||
Ok, I guess something goes very wrong when I make changes in my vc build :( I made the changes you suggested here.
Attachment #280756 -
Flags: review?(sspitzer)
Comment 10•16 years ago
|
||
martijn, thanks for making those changes. 1) we need to implement a stub for mozInlineSpellChecker::Focus(), but do need to register (and unregister) the focus event listener? I think we can remove these lines of code: + target->AddEventListener(NS_LITERAL_STRING("focus"), + static_cast<nsIDOMFocusListener *>(this), + PR_TRUE); and + target->RemoveEventListener(NS_LITERAL_STRING("focus"), + static_cast<nsIDOMFocusListener *>(this), + PR_TRUE); 2) can you add a comment to mozInlineSpellChecker::Blur() about why we call HandleNavigationEvent() on blur? Or even just do: HandleNavigationEvent(aKeyEvent, PR_TRUE /* force a spelling correction */); 3) I'm nervous about checking this in when we don't know why you are getting a heap corruption error, and I'm not. to reproduce it, I should just reload https://bugzilla.mozilla.org/attachment.cgi?id=280585 (if so, I'm not seeing anything when I do that.) Are there any good tools for tracking down heap corruption (google tells me about pageheap.exe and gflags.exe, see http://support.microsoft.com/kb/286470, but I've never used them.)
Assignee: mscott → martijn.martijn
Assignee | ||
Comment 11•16 years ago
|
||
Well, I saw some weird crashes earlier with my vc build, see bug 394534, comment 7, so I'm getting pretty sure there is something wrong with it.
Comment 12•16 years ago
|
||
Martijn, I'd really like to see this land on the trunk (and maybe make it's way onto the MOZILLA_1_8_BRANCH, as I'm sure I'm not the only misspeller who would benefit from it.) but, we should be confident that we're not introducing a heap corruption problem. I assume a full clobber / rebuild didn't help? Can you make the two changes in comment #10 and apply one more version of the fix (so I can r=)
Comment 13•16 years ago
|
||
Comment on attachment 280756 [details] [diff] [review] patchv2 r=sspitzer, once you make the changes in comment #10. Is there anyone else that should review this?
Attachment #280756 -
Flags: review?(sspitzer) → review+
Assignee | ||
Comment 14•16 years ago
|
||
This is with the suggestion of comment 10. I'll also ask Brett for review, since he is the owner of spellchecker, afaik. I'll rebuild my vc build from scratch to see if I still get this heap corruption, but I'm pretty sure something is wrong with my vc tree.
Attachment #280893 -
Flags: review?(brettw)
Assignee | ||
Comment 15•16 years ago
|
||
Ok, my problems with the vc build turned out to be that I had ac_add_options --disable-auto-deps set, so that should not be a concern anymore.
Comment 16•16 years ago
|
||
Comment on attachment 280893 [details] [diff] [review] patchv3 Just to be sure, being a listener doesn't make the spellchecking object get leaked, right? You should make sure the destructor gets called still. Otherwise, looks fine.
Attachment #280893 -
Flags: review?(brettw) → review+
Assignee | ||
Comment 17•16 years ago
|
||
How do I test that the destructor of the spellchecking object gets called still with the patch?
Comment 18•16 years ago
|
||
(In reply to comment #17) > How do I test that the destructor of the spellchecking object gets called still > with the patch? By setting a breakpoint with a debugger, or even just a simple printf(), and then making sure it gets called when the object should be destroyed. http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/extensions/spellcheck/src/mozInlineSpellChecker.cpp&rev=1.39#531
Assignee | ||
Comment 19•16 years ago
|
||
Ok, the destructors seems to get called still, afaict.
Assignee | ||
Updated•16 years ago
|
Attachment #280893 -
Flags: approval1.9?
Updated•16 years ago
|
Attachment #280893 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 20•16 years ago
|
||
Checking in mozInlineSpellChecker.h; /cvsroot/mozilla/extensions/spellcheck/src/mozInlineSpellChecker.h,v <-- mozIn lineSpellChecker.h new revision: 1.12; previous revision: 1.11 done Checking in mozInlineSpellChecker.cpp; /cvsroot/mozilla/extensions/spellcheck/src/mozInlineSpellChecker.cpp,v <-- moz InlineSpellChecker.cpp new revision: 1.40; previous revision: 1.39 done Checked in. Thanks for the help.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 21•16 years ago
|
||
Martijn, thanks for fixing this. If it bakes and verifies on the trunk, I think this would be a good fix for the MOZILLA_1_8_BRANCH (for firefox / thunderbird 2.0.0.x)
Comment 22•16 years ago
|
||
This is leaking on Mac and Linux leak tinderboxes
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 23•16 years ago
|
||
Backed out: memory leaks went from ~1.5K to ~6.6K
Comment 24•16 years ago
|
||
Er, RLk went from 0 (Linux) / 4.81K (Mac) to 337K (Linux) / 323K (Mac). Lk went from 1.5M (Linux) / 1.04M (Mac) to 6.5M (Linux) / 3.9M (Mac).
Assignee | ||
Comment 25•16 years ago
|
||
I'm sorry, I only checked for greenness on tinderbox. So if I understand correctly, windows didn't leak? Then it's impossible (at least for now) for me to check how/where/why it's leaking.
Assignee: martijn.martijn → mscott
Status: REOPENED → NEW
Comment 26•16 years ago
|
||
No, we don't have a windows leak box set up. It probably leaks on windows too.
Comment 27•16 years ago
|
||
Meant "M" not "K" in comment 23. I was using the bigger Linux numbers to emphasize this was not a trivial or borderline leak. I really doubt mscott is going to take this, reassigning to nobody so no one has any false hopes or gets discouraged from taking it on.
Assignee: mscott → nobody
Assignee | ||
Comment 28•16 years ago
|
||
Ok, apparently, with the patch, I leak 2 windows and 2 documents after using form autocomplete. Leaked 2 out of 7 DOM Windows Leaked 2 out of 45 documents I don't get this leak with the patch backed out. It doesn't matter if the text input in question has spell check enabled or not.
Updated•16 years ago
|
Assignee: nobody → martijn.martijn
Assignee | ||
Comment 29•16 years ago
|
||
Never mind, scratch comment 28, now I suddenly don't leak anymore at all that way, with or without the patch.
Assignee | ||
Comment 30•16 years ago
|
||
This are the numbers I get when loading this url: http://www.mozilla.org/newlayout/samples/test8.html The first numbers are without the patch, the last numbers are with the patch. So I guess Total Leaked is the number where Rlk is coming from? Before patch: Totol Leaked 4140 bytes After patch: Total Leaked 4196 bytes
Assignee | ||
Comment 31•16 years ago
|
||
Sorry, probably I did something wrong after patch in comment 30. I think I quite reproducible got appr. 361679 bytes for Total Leaked with the patch.
Assignee | ||
Comment 32•16 years ago
|
||
Ok, this seems to work and afaict, doesn't cause memory leaks. This is basically following the code here: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/editor/libeditor/base/nsEditor.cpp&rev=1.501#354
Attachment #280584 -
Attachment is obsolete: true
Attachment #280756 -
Attachment is obsolete: true
Attachment #280893 -
Attachment is obsolete: true
Assignee | ||
Comment 33•16 years ago
|
||
These are the numbers I get with and without the patch. I don't seen an increase in leaks with this, afaict, but I'm not sure how this correlates to the Rlk number.
Updated•16 years ago
|
Attachment #281829 -
Attachment is patch: true
Attachment #281829 -
Attachment mime type: application/octet-stream → text/plain
Assignee | ||
Comment 34•16 years ago
|
||
Comment on attachment 281829 [details] [diff] [review] patchv4 Olli, maybe you can review this and tell if this is a valid way of calling event listeners.
Attachment #281829 -
Flags: review?(Olli.Pettay)
Updated•16 years ago
|
Attachment #281829 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Updated•16 years ago
|
Attachment #281829 -
Flags: review?(brettw)
Updated•16 years ago
|
Attachment #281829 -
Flags: review?(brettw) → review+
Assignee | ||
Comment 35•16 years ago
|
||
Comment on attachment 281829 [details] [diff] [review] patchv4 I promise I'll take a good look at leak numbers this time if I can check this in.
Attachment #281829 -
Flags: approval1.9?
Updated•16 years ago
|
Attachment #281829 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Comment 36•16 years ago
|
||
Checking in Makefile.in; /cvsroot/mozilla/extensions/spellcheck/src/Makefile.in,v <-- Makefile.in new revision: 1.16; previous revision: 1.15 done Checking in mozInlineSpellChecker.h; /cvsroot/mozilla/extensions/spellcheck/src/mozInlineSpellChecker.h,v <-- mozIn lineSpellChecker.h new revision: 1.14; previous revision: 1.13 done Checking in mozInlineSpellChecker.cpp; /cvsroot/mozilla/extensions/spellcheck/src/mozInlineSpellChecker.cpp,v <-- moz InlineSpellChecker.cpp new revision: 1.43; previous revision: 1.42 done Checked in on trunk.
Status: NEW → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 37•16 years ago
|
||
Before patch checked in: Linux fxdbug-linux-tbox Dep: RLk:8.00B Lk:6.99MB MacOSX Darwin 8.8.4 bm-xserve11 Dep Debug + Leak Test: RLk:12.0B Lk:962KB After patch checked in: Linux fxdbug-linux-tbox Dep: RLk:8.00B Lk:7.02MB MacOSX Darwin 8.8.4 bm-xserve11 Dep Debug + Leak Test: RLk:12.0B Lk:962KB So this doesn't seem to have caused any extra leaks with current tests, afaict.
Comment 38•16 years ago
|
||
This has been backed out to investigate the Tp regression talos is showing
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 39•16 years ago
|
||
The tree has been reopened but I am unable to get to re-checking things in. The numbers are a little unclear as to whether this was a cause of some Tp regression so please exercise care when checking back in.
Assignee | ||
Comment 40•16 years ago
|
||
This was checked in at 2007-09-25 04:20: http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2007-09-25+03&maxdate=2007-09-25+20&cvsroot=%2Fcvsroot Afaics, the Tp regression on Talos started just before 18:00:00 25 Sep 2007: (qm-pxp01 tp_Working Set_avg) http://graphs.mozilla.org/graph.html#spst=range&spss=1190610264.7428572&spse=1190813684.9828572&spstart=1180657203&spend=1190828215&bpst=Cursor&bpstart=1190610264.7428572&bpend=1190813684.9828572&m1tid=9&m1bl=0&m1avg=0 (qm-pxp01 tp_Private Bytes_avg) http://graphs.mozilla.org/graph.html#spst=range&spss=1190711974.862857&spse=1190813684.9828572&spstart=1180657203&spend=1190828215&bpst=Cursor&bpstart=1190711974.862857&bpend=1190813684.9828572&m1tid=8&m1bl=0&m1avg=0 Other numbers from talos don't seem useful or show a regression. Am I looking at the right data here? Is there a time difference between talos and bonsai? Because at the time when I checked in, there wasn't a talos perf regression, afaics.
Comment 41•16 years ago
|
||
(In reply to comment #40) > Am I looking at the right data here? > Is there a time difference between talos and bonsai? From the discussion yesterday in #developers, I think there are two problems with the Talos numbers: 1) The graphs page seems to display the data using your local time, rather than PDT (which is what Bonsai uses) 2) The start times reported to tinderbox "test start", not "checkout start". When the test starts, it pulls a build from the FTP server, which is the last built "nightly" build.
Assignee | ||
Comment 42•16 years ago
|
||
Ok, thanks Gavin. Ben Hearsum also explained me what you're explaining in point 2. I'll try to reland this tomorrow, and I'll try to keep an eye on the talos numbers.
Comment 43•16 years ago
|
||
(In reply to comment #41) > 1) The graphs page seems to display the data using your local time I filed that as bug 397683. > 2) The start times reported to tinderbox "test start", not "checkout start". That's bug 396133.
Assignee | ||
Comment 44•16 years ago
|
||
Checking in Makefile.in; /cvsroot/mozilla/extensions/spellcheck/src/Makefile.in,v <-- Makefile.in new revision: 1.18; previous revision: 1.17 done Checking in mozInlineSpellChecker.h; /cvsroot/mozilla/extensions/spellcheck/src/mozInlineSpellChecker.h,v <-- mozIn lineSpellChecker.h new revision: 1.16; previous revision: 1.15 done Checking in mozInlineSpellChecker.cpp; /cvsroot/mozilla/extensions/spellcheck/src/mozInlineSpellChecker.cpp,v <-- moz InlineSpellChecker.cpp new revision: 1.45; previous revision: 1.44 done Patchv4 checked in again.
Status: REOPENED → RESOLVED
Closed: 16 years ago → 16 years ago
Resolution: --- → FIXED
Comment 45•16 years ago
|
||
Martijn, this seems like a pretty useful fix for the spell checker for Fx and Tb, should we consider it for the branch?
Flags: blocking1.8.1.9?
Assignee | ||
Comment 46•16 years ago
|
||
I guess so, if you really think this is a major problem that needs to be fixed asap.
Comment 47•16 years ago
|
||
Not blocking a branch release, but will consider approval requests. Seems like a largish patch though, what's the risk like?
Flags: blocking1.8.1.12? → wanted1.8.1.x+
You need to log in
before you can comment on or make changes to this bug.
Description
•