Closed Bug 210515 Opened 22 years ago Closed 21 years ago

Assertion in nsAccessible::GetFlatStringFromContentNode()

Categories

(Core :: Disability Access APIs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: aaronlev)

Details

Attachments

(1 file, 1 obsolete file)

The assertion occurs if you try to do: textContent->CopyText(text); when the text is of length 0
Attachment #126379 - Flags: review?(kyle.yuan)
Comment on attachment 126379 [details] [diff] [review] Don't copy text if the textcontent is length 0 r=kyle + if (text.Length()>0) I prefer a space before & after operators.
Attachment #126379 - Flags: review?(kyle.yuan) → review+
Comment on attachment 126379 [details] [diff] [review] Don't copy text if the textcontent is length 0 Thanks Kyle, I'll fix the spacing around the >
Attachment #126379 - Flags: superreview?(alecf)
Comment on attachment 126379 [details] [diff] [review] Don't copy text if the textcontent is length 0 > nsAutoString text; This should have been moved inside the if block >+ if (origLength > 0) { >+ textContent->CopyText(text); >+ text.CompressWhitespace(); >+ if (text.Length()>0) This should have been fixed to !IsEmpty() >+ aFlatString->Append(text); >+ if (isHTMLBlock && !aFlatString->IsEmpty()) >+ aFlatString->Append(NS_LITERAL_STRING(" "));
Thanks Neil, good eyes.
Attachment #126379 - Attachment is obsolete: true
Comment on attachment 126465 [details] [diff] [review] New patch with Neil's suggestions Carrying r=kyle
Attachment #126465 - Flags: superreview?(alecf)
Attachment #126465 - Flags: review+
Comment on attachment 126379 [details] [diff] [review] Don't copy text if the textcontent is length 0 sr= request is on newer patch now
Attachment #126379 - Flags: superreview?(alecf)
Blocks: 160540
Comment on attachment 126465 [details] [diff] [review] New patch with Neil's suggestions sr=alecf you could also sa aFlatString->Append(PRUnichar(' '); and get the same effect, but take up 16 less bytes.
Attachment #126465 - Flags: superreview?(alecf) → superreview+
mozilla/accessible/src/base/nsAccessible.cpp 1.78
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
No longer blocks: 160540
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: