if (!parentDIV) return NS_ERROR_UNEXPECTED;
nsTextInputSelectionImpl::PageMove(PRBool aForward, PRBool aExtend){#if XXXXX_WORK_TO_BE_COMPLETED_XXXXX  // XXX: this code needs to be finished or rewritten  // expected bahavior for PageMove is to scroll AND move the caret  nsIScrollableView *scrollableView;  nsresult result;  nscoord containerHeight, containerWidth, lineHeight;  nsPoint oldLocation;  result = GetScrollableView(&scrollableView);  if (NS_FAILED(result))    return result;  if (!scrollableView)    return NS_ERROR_NOT_INITIALIZED;  // find out where we are; determine amount to page up/down  result = scrollableView->GetScrollPosition(oldLocation.x, oldLocation.y);  if (NS_FAILED(result))    return result;  result = scrollableView->GetLineHeight(&lineHeight);  if (NS_FAILED(result))    return result;  result = scrollableView->GetContainerSize(&containerWidth, &containerHeight);  if (NS_SUCCEEDED(result))  {    // scroll this amount backwards    if (!aForward)      containerHeight = 0 - containerHeight;    nsPoint desiredLocation(oldLocation.x, oldLocation.y + containerHeight - lineHeight);    result = scrollableView->ScrollTo(desiredLocation.x, desiredLocation.y, NS_VMREFRESH_NO_SYNC);    // grab the parent / root DIV for this text widget    nsCOMPtr<nsIContent> parentDIV;    result = GetLimiter(getter_AddRefs(parentDIV));    if (NS_FAILED(result))      return result;    if (!parentDIV)      return NS_ERROR_UNEXPECTED;    // now we know how much to move up/down, we need to look into the content and     // figure out where that coordinate is and then place the caret at that location    nsCOMPtr<nsIContent> content;    result = frame->GetContentAndOffsetsFromPoint(presContext, desiredLocation, getter_AddRefs(content), startOffset, endOffset, beginFrameContent);    result = GetFrameForNodeOffset(content, PRInt32 aOffset, HINT aHint, nsIFrame **aReturnFrame, PRInt32 *aReturnOffset)  }    return result;#else  return ScrollPage(aForward);#endif}