Commit 7f447473 authored by aaronleventhal%moonset.net's avatar aaronleventhal%moonset.net
Browse files

Bug 346649. Firefox crashes [@ nsHyperTextAccessible::GetPosAndText]. Patch by...

Bug 346649. Firefox crashes [@ nsHyperTextAccessible::GetPosAndText]. Patch by evan.yan. r=ginn.chen, r=aaronlev
parent 0eb79b3c
Loading
Loading
Loading
Loading
+39 −38
Original line number Diff line number Diff line
@@ -222,8 +222,10 @@ nsIFrame* nsHyperTextAccessible::GetPosAndText(PRInt32& aStartOffset, PRInt32& a
  while (NextChild(accessible)) {
    nsCOMPtr<nsPIAccessNode> accessNode(do_QueryInterface(accessible));
    nsIFrame *frame = accessNode->GetFrame();
    if (!frame) {
      continue;
    }
    if (Role(accessible) == ROLE_TEXT_LEAF) {
      if (frame) {
      // Avoid string copies
      PRInt32 substringEndOffset = frame->GetContent()->TextLength();
      if (startOffset < substringEndOffset) {
@@ -250,7 +252,7 @@ nsIFrame* nsHyperTextAccessible::GetPosAndText(PRInt32& aStartOffset, PRInt32& a
          aEndOffset = endOffset;
        }
        if (aText) {
            if (frame && !frame->GetStyleText()->WhiteSpaceIsSignificant()) {
          if (!frame->GetStyleText()->WhiteSpaceIsSignificant()) {
            // Replace \r\n\t in markup with space unless in this is
            // preformatted text  where those characters are significant
            newText.ReplaceChar("\r\n\t", ' ');
@@ -268,7 +270,6 @@ nsIFrame* nsHyperTextAccessible::GetPosAndText(PRInt32& aStartOffset, PRInt32& a
      }
      endOffset -= substringEndOffset;
    }
    }
    else {
      // Embedded object, append marker
      // XXX Append \n for <br>'s