Closed Bug 345587 Opened 19 years ago Closed 19 years ago

Hang with spell-checked word in this testcase

Categories

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

1.8 Branch
x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla1.8.1beta2

People

(Reporter: martijn.martijn, Assigned: brettw)

References

Details

(Keywords: fixed1.8.1, hang, testcase)

Attachments

(2 files, 1 obsolete file)

See upcoming testcase. To reproduce: To reproduce: -Right-click on the "tesxt" misspelled word (underneath this text) and choose a spell checked word Result: Mozilla hangs with 100% cpu Expected result: No hang and the word should have been spell checked
Attached file testcase
I've extracted this testcase from google (http://www.google.com/webhp?hl=en&btnG=Google+Search ) - Set designmode to 'on' on the page - Find in page 'froogle' - Select 'Highlight All' in the find bar - Now spell check the highlighted 'froogle' word
This regressed on trunk between 2006-07-03 and 2006-07-04, very likely a regression from bug 339066.
Blocks: 339066
Assignee: mscott → brettw
Flags: blocking1.8.1?
OS: Windows XP → All
Priority: -- → P1
Target Milestone: --- → mozilla1.8.1beta2
Version: Trunk → 1.8 Branch
Flags: blocking1.8.1? → blocking1.8.1+
It's weird, the editor is getting confused inserting text at this location: #0 0x420d15de in nsRange::IsIncreasing (aStartN=0x0, aStartOffset=0, aEndN=0x8d593e4, aEndOffset=0) at /usr/local/google/home/brettw/branch/mozilla/content/base/src/nsRange.cpp:751 #1 0x420d04f0 in nsRangeUtils::ComparePoints (this=0x908a7a8, aParent1=0x8d59484, aOffset1=0, aParent2=0x8d593e4, aOffset2=0) at /usr/local/google/home/brettw/branch/mozilla/content/base/src/nsRange.cpp:337 #2 0x448ecfb4 in nsWSRunObject::GetWSPointAfter (this=0xbfffcdcc, aNode=0x8d59484, aOffset=0, outPoint=0xbfffcbec) at /usr/local/google/home/brettw/branch/mozilla/editor/libeditor/html/nsWSRunObject.cpp:1942 #3 0x448ec2bd in nsWSRunObject::GetCharAfter (this=0xbfffcdcc, aNode=0x8d59484, aOffset=0, outPoint=0xbfffcbec) at /usr/local/google/home/brettw/branch/mozilla/editor/libeditor/html/nsWSRunObject.cpp:1619 #4 0x448ededb in nsWSRunObject::CheckLeadingNBSP (this=0xbfffcdcc, aRun=0x8b6ffa0, aNode=0x8d59484, aOffset=0) at /usr/local/google/home/brettw/branch/mozilla/editor/libeditor/html/nsWSRunObject.cpp:2197 #5 0x448e8767 in nsWSRunObject::InsertText (this=0xbfffcdcc, aStringToInsert=@0xbfffce1c, aInOutParent=0xbfffceec, aInOutOffset=0xbfffcdb8, aDoc=0x8a07e24) at /usr/local/google/home/brettw/branch/mozilla/editor/libeditor/html/nsWSRunObject.cpp:324 #6 0x448ae5c3 in nsHTMLEditRules::WillInsertText (this=0x9136478, ---Type <return> to continue, or q <return> to quit--- aAction=2000, aSelection=0x8a65aa0, aCancel=0xbfffce1c, aHandled=0xbfffcdcc, inString=0x87da6f8, outString=0xbfffd05c, aMaxLength=-1) at /usr/local/google/home/brettw/branch/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp:1467 #7 0x448ab844 in nsHTMLEditRules::WillDoAction (this=0x9136478, aSelection=0x8a65aa0, aInfo=0xbfffd01c, aCancel=0x1, aHandled=0x40212ba8) at /usr/local/google/home/brettw/branch/mozilla/editor/libeditor/html/nsHTMLEditRules.cpp:589 #8 0x44903730 in nsPlaintextEditor::InsertText (this=0x8c1e7f8, aStringToInsert=@0x0) at /usr/local/google/home/brettw/branch/mozilla/editor/libeditor/text/nsPlaintextEditor.cpp:732 #9 0x449690cc in mozInlineSpellChecker::ReplaceWord (this=0x843b668, aNode=0x8d594d4, aOffset=3, newword=@0x87da6f8)
Component: Spelling checker → Editor
Attached patch Patch (obsolete) — Splinter Review
The binary search algorithm in nsWSRunObject::GetWSPointBefiore and nsWSRunObject::GetWSPointAfter was plain wrong.
Attachment #232146 - Flags: review?(bryner)
Comment on attachment 232146 [details] [diff] [review] Patch Brett is making a new patch after we stepped through what the right behavior should be.
Attachment #232146 - Flags: review?(bryner) → review-
Assignee: brettw → nobody
QA Contact: spelling-checker
Assignee: nobody → brettw
Attached patch Patch V2Splinter Review
Attachment #232146 - Attachment is obsolete: true
Attachment #232213 - Flags: review?(bryner)
Attachment #232213 - Flags: review?(bryner) → review+
Attachment #232213 - Flags: superreview?(bugmail)
Attachment #232213 - Flags: superreview?(bugmail) → superreview+
Comment on attachment 232213 [details] [diff] [review] Patch V2 Fixed on trunk, leaving open for branch checkin. Can we get this for beta 2?
Attachment #232213 - Flags: approval1.8.1?
Summary: Hang with spell checked word in this testcase → Hang with spell-checked word in this testcase
Comment on attachment 232213 [details] [diff] [review] Patch V2 a=drivers, go ahead and land this on the branch.
Attachment #232213 - Flags: approval1.8.1? → approval1.8.1+
(Brendan wouldn't like the else-after-return, though, and removing the bogus unreachable returns might uncover some silly compiler warnings.)
Fixed on branch. I didn't change the if-else code (it should be changed on trunk if we really need to). This file already spits out more than a page of warnings, so even if we get another one on some compilers (I don't see one) it won't matter much :/
Status: NEW → RESOLVED
Closed: 19 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: